Staging
v0.5.1
https://github.com/python/cpython
Revision a15c9b3a0524e5ca0434d2ad11076677824af941 authored by Lysandros Nikolaou on 13 May 2020, 19:36:27 UTC, committed by GitHub on 13 May 2020, 19:36:27 UTC
This commit fixes SyntaxError locations when the caret is not displayed,
by doing the following:

- `col_number` always gets set to the location of the offending
  node/expr. When no caret is to be displayed, this gets achieved
  by setting the object holding the error line to None.

- Introduce a new function `_PyPegen_raise_error_known_location`,
  which can be called, when an arbitrary `lineno`/`col_offset`
  needs to be passed. This function then gets used in the grammar
  (through some new macros and inline functions) so that SyntaxError
  locations of the new parser match that of the old.
1 parent de92769
History
Tip revision: a15c9b3a0524e5ca0434d2ad11076677824af941 authored by Lysandros Nikolaou on 13 May 2020, 19:36:27 UTC
bpo-40334: Always show the caret on SyntaxErrors (GH-20050)
Tip revision: a15c9b3
File Mode Size
.azure-pipelines
.github
Doc
Grammar
Include
Lib
Mac
Misc
Modules
Objects
PC
PCbuild
Parser
Programs
Python
Tools
m4
.gitattributes -rw-r--r-- 1.8 KB
.gitignore -rw-r--r-- 1.8 KB
.travis.yml -rw-r--r-- 8.2 KB
CODE_OF_CONDUCT.md -rw-r--r-- 630 bytes
LICENSE -rw-r--r-- 12.5 KB
Makefile.pre.in -rw-r--r-- 68.4 KB
README.rst -rw-r--r-- 9.9 KB
aclocal.m4 -rw-r--r-- 13.1 KB
config.guess -rwxr-xr-x 43.1 KB
config.sub -rwxr-xr-x 35.4 KB
configure -rwxr-xr-x 497.6 KB
configure.ac -rw-r--r-- 167.1 KB
install-sh -rwxr-xr-x 15.0 KB
netlify.toml -rw-r--r-- 82 bytes
pyconfig.h.in -rw-r--r-- 44.4 KB
setup.py -rw-r--r-- 103.4 KB

README.rst

back to top