return children
KEYWORDS = ('return', 'import', 'from', 'raise', 'pass', 'del', 'yield', 'assert', 'break', 'continue', 'global', 'nonlocal', 'def', 'if', 'class', 'with', 'for', 'try', 'while', 'as', 'elif', 'else', 'in', 'except', 'finally', 'None', 'True', 'False', 'or', 'and', 'not', 'is', 'lambda')
SOFT_KEYWORDS = ('match', 'case', '_')
void *
_PyPegen_parse(Parser *p)
{
// Initialize keywords
p->keywords = reserved_keywords;
p->n_keyword_lists = n_keyword_lists;
p->soft_keywords = soft_keywords;
// Run parser
void *result = NULL;
if (p->start_rule == Py_file_input) {
result = file_rule(p);
} else if (p->start_rule == Py_single_input) {
result = interactive_rule(p);
} else if (p->start_rule == Py_eval_input) {
result = eval_rule(p);
} else if (p->start_rule == Py_func_type_input) {
result = func_type_rule(p);
} else if (p->start_rule == Py_fstring_input) {
result = fstring_rule(p);
}
return result;
}
If I run
PYTHONPATH=Tools/peg_generator ./python.exe -m pegen python Grammar/python.gramonmainbranch, the result file is broken.There are lots of invalid syntax construct that come from
Cdirectly.Some examples:
It also has this at the bottom:
I am attaching full file to this issue: https://gist.github.com/sobolevn/37cfd12ad9d2c157e72e7589747f4ed2
Pinging @isidentical and @pablogsal