You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Parser throws error if declarators inside of a structure have extra ";;" terminators. However, it works if the declarator is outside of a structure or an union declaration.
from pycparser import c_parser, c_ast p = c_parser.CParser() src="int a;;;" p.parse(src) p.parse(src).show()
FileAST:
Decl: a, [], [], []
TypeDecl: a, []
IdentifierType: ['int']
src="""struct foo { ... int a;; ... };""" p.parse(src).show()
Traceback (most recent call last):
File "", line 1, in
File "pycparser/c_parser.py", line 146, in parse
debug=debuglevel)
File "pycparser/ply/yacc.py", line 265, in parse
return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
File "pycparser/ply/yacc.py", line 1047, in parseopt_notrack
tok = self.errorfunc(errtoken)
File "pycparser/c_parser.py", line 1680, in p_error
column=self.clex.find_tok_column(p)))
File "pycparser/plyparser.py", line 55, in _parse_error
raise ParseError("%s: %s" % (coord, msg))
pycparser.plyparser.ParseError: :2:7: before: ;
The text was updated successfully, but these errors were encountered:
Parser throws error if declarators inside of a structure have extra ";;" terminators. However, it works if the declarator is outside of a structure or an union declaration.
from pycparser import c_parser, c_ast p = c_parser.CParser() src="int a;;;" p.parse(src) p.parse(src).show()
The text was updated successfully, but these errors were encountered: