summaryrefslogtreecommitdiffstats
path: root/Misc
diff options
context:
space:
mode:
authorLysandros Nikolaou <lisandrosnik@gmail.com>2020-10-26 22:42:04 (GMT)
committerGitHub <noreply@github.com>2020-10-26 22:42:04 (GMT)
commitbca701403253379409dece03053dbd739c0bd059 (patch)
tree9222677d56d4669ac00f734ffeb7d72797bb6a89 /Misc
parentc8c4200b65b2159bbb13cee10d67dfb3676fef26 (diff)
downloadcpython-bca701403253379409dece03053dbd739c0bd059.zip
cpython-bca701403253379409dece03053dbd739c0bd059.tar.gz
cpython-bca701403253379409dece03053dbd739c0bd059.tar.bz2
bpo-42123: Run the parser two times and only enable invalid rules on the second run (GH-22111)
* Implement running the parser a second time for the errors messages The first parser run is only responsible for detecting whether there is a `SyntaxError` or not. If there isn't the AST gets returned. Otherwise, the parser is run a second time with all the `invalid_*` rules enabled so that all the customized error messages get produced.
Diffstat (limited to 'Misc')
-rw-r--r--Misc/NEWS.d/next/Core and Builtins/2020-10-23-02-43-24.bpo-42123.64gJWC.rst3
1 files changed, 3 insertions, 0 deletions
diff --git a/Misc/NEWS.d/next/Core and Builtins/2020-10-23-02-43-24.bpo-42123.64gJWC.rst b/Misc/NEWS.d/next/Core and Builtins/2020-10-23-02-43-24.bpo-42123.64gJWC.rst
new file mode 100644
index 0000000..6461efd
--- /dev/null
+++ b/Misc/NEWS.d/next/Core and Builtins/2020-10-23-02-43-24.bpo-42123.64gJWC.rst
@@ -0,0 +1,3 @@
+Run the parser two times. On the first run, disable all the rules that only
+generate better error messages to gain performance. If there's a parse
+failure, run the parser a second time with those enabled.