Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing possible start rules in python.gram #32

Merged
merged 10 commits into from Apr 3, 2020

Conversation

lysnikolaou
Copy link

@lysnikolaou lysnikolaou commented Apr 1, 2020

No description provided.

@lysnikolaou lysnikolaou requested review from gvanrossum and pablogsal Apr 1, 2020
Copy link

@gvanrossum gvanrossum left a comment

We should probably land this before #29?

Grammar/python.gram Show resolved Hide resolved
Lib/test/test_peg_parser.py Show resolved Hide resolved
Modules/peg_parser.c Outdated Show resolved Hide resolved
Modules/peg_parser.c Outdated Show resolved Hide resolved
Include/compile.h Outdated Show resolved Hide resolved
Parser/pegen/pegen.c Outdated Show resolved Hide resolved
Copy link

@gvanrossum gvanrossum left a comment

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
Author

lysnikolaou commented Apr 3, 2020

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
Author

lysnikolaou commented Apr 3, 2020

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
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 Apr 3, 2020
Copy link

@gvanrossum gvanrossum left a comment

Yeah!

@lysnikolaou lysnikolaou merged commit 3aa1dd4 into pegen Apr 3, 2020
@lysnikolaou lysnikolaou deleted the multiple-start-rules branch Apr 3, 2020
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.

None yet

2 participants