Skip to content

Add missing possible start rules in python.gram#32

Merged
lysnikolaou merged 10 commits intopegenfrom
multiple-start-rules
Apr 3, 2020
Merged

Add missing possible start rules in python.gram#32
lysnikolaou merged 10 commits intopegenfrom
multiple-start-rules

Conversation

@lysnikolaou
Copy link
Copy Markdown
Member

No description provided.

Copy link
Copy Markdown

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should probably land this before #29?

Comment thread Grammar/python.gram
Comment thread Lib/test/test_peg_parser.py
Comment thread Modules/peg_parser.c
Comment thread Modules/peg_parser.c
Comment thread Include/compile.h Outdated
Comment thread Parser/pegen/pegen.c Outdated
Copy link
Copy Markdown

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. (We will have to add something for func_type_input later, but that can wait.)

PS. Could you create issues for tasks needed to get all tests to parse?

@lysnikolaou
Copy link
Copy Markdown
Member Author

LGTM. (We will have to add something for func_type_input later, but that can wait.)

PS. Could you create issues for tasks needed to get all tests to parse?

Of course. I'll do that.

@lysnikolaou
Copy link
Copy Markdown
Member Author

There is one more thing I missed. statement_newline should also accept a lone NEWLINE, but I'm not sure what the action should be. I tried to test this, bit didn't find an answer. For example, ast.parse('\n', mode='single') doesn't work.

I'm guessing it should be an empty asdl_seq *, but I'm not sure.

@lysnikolaou
Copy link
Copy Markdown
Member Author

lysnikolaou commented Apr 3, 2020

Turns out, it just generates a Pass node.

asdl_seq_SET(stmts, 0, Pass(n->n_lineno, n->n_col_offset,

@lysnikolaou lysnikolaou requested a review from gvanrossum April 3, 2020 11:34
Copy link
Copy Markdown

@gvanrossum gvanrossum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah!

@lysnikolaou lysnikolaou merged commit 3aa1dd4 into pegen Apr 3, 2020
@lysnikolaou lysnikolaou deleted the multiple-start-rules branch April 3, 2020 17:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants