we-like-parsers / cpython

Here we work on integrating pegen into CPython; use branch 'pegen'
https://github.com/gvanrossum/pegen
Other
1 stars 0 forks source link

separate raw_expressions / new expressions cursors #168

Closed isidentical closed 2 years ago

isidentical commented 2 years ago
(.venv) (Python 3.9.5) [ 11:28ÖS ]  [ isidentical@msi:~/projects/cpython(fstring-grammar❌) ]
 $ ./python -m ast t.py                                                                         1,151s
Module(
   body=[
      Expr(
         value=JoinedStr(
            values=[
               Constant(value='test1+1 = '),
               FormattedValue(
                  value=BinOp(
                     left=Constant(value=1),
                     op=Add(),
                     right=Constant(value=1)),
                  conversion=114),
               Constant(value=' test '),
               FormattedValue(
                  value=BinOp(
                     left=Constant(value=2),
                     op=Add(),
                     right=Constant(value=2)),
                  conversion=-1)]))],
   type_ignores=[])
(.venv) (Python 3.9.5) [ 11:29ÖS ]  [ isidentical@msi:~/projects/cpython(fstring-grammar❌) ]
 $ python -m ast t.py                                                                             48ms
Module(
   body=[
      Expr(
         value=JoinedStr(
            values=[
               Constant(value='test1+1 = '),
               FormattedValue(
                  value=BinOp(
                     left=Constant(value=1),
                     op=Add(),
                     right=Constant(value=1)),
                  conversion=114),
               Constant(value=' test '),
               FormattedValue(
                  value=BinOp(
                     left=Constant(value=2),
                     op=Add(),
                     right=Constant(value=2)),
                  conversion=-1)]))],
   type_ignores=[])
(.venv) (Python 3.9.5) [ 11:29ÖS ]  [ isidentical@msi:~/projects/cpython(fstring-grammar❌) ]
 $ ./python -m test test_fstring -m test_debug_conversion                                         38ms
0:00:00 load avg: 0.74 Run tests sequentially
0:00:00 load avg: 0.74 [1/1] test_fstring

== Tests result: SUCCESS ==

1 test OK.

Total duration: 80 ms
Tests result: SUCCESS

Resolves #167