Commit 8f09e001 authored by Robert Bradshaw's avatar Robert Bradshaw

merge tweaks

parent 7abc52a4
...@@ -82,7 +82,7 @@ def p_module(path): ...@@ -82,7 +82,7 @@ def p_module(path):
&err, &err,
&flags) &flags)
if n: if n:
# print_tree(n) print_tree(n)
PyNode_Free(n) PyNode_Free(n)
else: else:
PyParser_SetError(&err) PyParser_SetError(&err)
...@@ -23,10 +23,10 @@ decorator: '@' dotted_PY_NAME [ '(' [arglist] ')' ] NEWLINE ...@@ -23,10 +23,10 @@ decorator: '@' dotted_PY_NAME [ '(' [arglist] ')' ] NEWLINE
decorators: decorator+ decorators: decorator+
decorated: decorators (classdef | funcdef | cdef_stmt) decorated: decorators (classdef | funcdef | cdef_stmt)
funcdef: 'def' PY_NAME parameters ['->' test] ':' suite funcdef: 'def' PY_NAME parameters ['->' test] ':' suite
parameters: '(' [typedargslist] [',' '...'] ')' parameters: '(' [typedargslist] ')'
typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [',' typedargslist: (tfpdef ['=' test] (',' tfpdef ['=' test])* [','
['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]] ['*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef]]
| '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) | '*' [tfpdef] (',' tfpdef ['=' test])* [',' '**' tfpdef] | '**' tfpdef) [',' ellipsis]
tfpdef: maybe_typed_name [':' test] tfpdef: maybe_typed_name [':' test]
varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [',' varargslist: (vfpdef ['=' test] (',' vfpdef ['=' test])* [','
['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]] ['*' [vfpdef] (',' vfpdef ['=' test])* [',' '**' vfpdef] | '**' vfpdef]]
...@@ -109,7 +109,7 @@ atom: ('(' [yield_expr|testlist_comp] ')' | ...@@ -109,7 +109,7 @@ atom: ('(' [yield_expr|testlist_comp] ')' |
'[' [testlist_comp] ']' | '[' [testlist_comp] ']' |
'{' [dictorsetmaker] '}' | '{' [dictorsetmaker] '}' |
new_expr | new_expr |
PY_NAME | NUMBER | STRING+ | '...' | 'None' | 'True' | 'False') PY_NAME | NUMBER | STRING+ | ellipsis | 'None' | 'True' | 'False')
testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] ) testlist_comp: (test|star_expr) ( comp_for | (',' (test|star_expr))* [','] )
trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' (PY_NAME | 'sizeof') trailer: '(' [arglist] ')' | '[' subscriptlist ']' | '.' (PY_NAME | 'sizeof')
subscriptlist: subscript (',' subscript)* [','] subscriptlist: subscript (',' subscript)* [',']
...@@ -141,6 +141,9 @@ yield_arg: 'from' test | testlist ...@@ -141,6 +141,9 @@ yield_arg: 'from' test | testlist
# Cython extensions # Cython extensions
# Accommodate to Py2 tokenizer.
ellipsis: '...' | '.' '.' '.'
signedness: 'unsigned' | 'signed' signedness: 'unsigned' | 'signed'
longness: 'char' | 'short' | 'long' | 'long' 'long' longness: 'char' | 'short' | 'long' | 'long' 'long'
# TODO: [unsigned] double doesn't make sens, but we need long double # TODO: [unsigned] double doesn't make sens, but we need long double
...@@ -187,7 +190,7 @@ enum_suite: NEWLINE INDENT (cname ['=' NUMBER] NEWLINE | pass_stmt NEWLINE)+ DED ...@@ -187,7 +190,7 @@ enum_suite: NEWLINE INDENT (cname ['=' NUMBER] NEWLINE | pass_stmt NEWLINE)+ DED
struct: ('struct' | 'union') cname (NEWLINE | (':' struct_suite)) struct: ('struct' | 'union') cname (NEWLINE | (':' struct_suite))
struct_suite: NEWLINE INDENT (cvar_decl | pass_stmt NEWLINE)+ DEDENT struct_suite: NEWLINE INDENT (cvar_decl | pass_stmt NEWLINE)+ DEDENT
cppclass: 'cppclass' cname [teplate_params] [cppclass_bases] (NEWLINE | ':' cppclass_suite) cppclass: 'cppclass' cname [teplate_params] [cppclass_bases] (NEWLINE | ':' cppclass_suite)
cppclass_bases: '(' dotted_name (',' dotted_name [teplate_params])*')' cppclass_bases: '(' dotted_PY_NAME (',' dotted_PY_NAME [teplate_params])*')'
cppclass_suite: NEWLINE INDENT (cvar_decl | ctype_decl | pass_stmt NEWLINE)+ DEDENT cppclass_suite: NEWLINE INDENT (cvar_decl | ctype_decl | pass_stmt NEWLINE)+ DEDENT
# TODO: C++ constructors, operators # TODO: C++ constructors, operators
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment