示例#1
0
 def check(target):
     class Config:
         cpp_id_attributes = ["id_attr"]
         cpp_paren_attributes = ["paren_attr"]
     parser = DefinitionParser(target, None, Config())
     ast, isShorthand = parser.parse_xref_object()
     parser.assert_end()
示例#2
0
def parse(name, string):
    class Config(object):
        cpp_id_attributes = ["id_attr"]
        cpp_paren_attributes = ["paren_attr"]
    parser = DefinitionParser(string, None, Config())
    ast = parser.parse_declaration(name)
    parser.assert_end()
    # The scopedness would usually have been set by CPPEnumObject
    if name == "enum":
        ast.scoped = None  # simulate unscoped enum
    return ast
示例#3
0
def parse(name, string):
    class Config:
        cpp_id_attributes = ["id_attr"]
        cpp_paren_attributes = ["paren_attr"]
    parser = DefinitionParser(string, None, Config())
    parser.allowFallbackExpressionParsing = False
    ast = parser.parse_declaration(name)
    parser.assert_end()
    # The scopedness would usually have been set by CPPEnumObject
    if name == "enum":
        ast.scoped = None  # simulate unscoped enum
    return ast