diff --git a/ast/always_inline_attr.go b/ast/always_inline_attr.go index 388e2714e..021c32b90 100644 --- a/ast/always_inline_attr.go +++ b/ast/always_inline_attr.go @@ -3,7 +3,7 @@ package ast type AlwaysInlineAttr struct { Address string Position string - Children []interface{} + Children []Node } func parseAlwaysInlineAttr(line string) *AlwaysInlineAttr { @@ -15,7 +15,7 @@ func parseAlwaysInlineAttr(line string) *AlwaysInlineAttr { return &AlwaysInlineAttr{ Address: groups["address"], Position: groups["position"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/asm_label_attr.go b/ast/asm_label_attr.go index b121f89f1..0195c5697 100644 --- a/ast/asm_label_attr.go +++ b/ast/asm_label_attr.go @@ -4,7 +4,7 @@ type AsmLabelAttr struct { Address string Position string FunctionName string - Children []interface{} + Children []Node } func parseAsmLabelAttr(line string) *AsmLabelAttr { @@ -17,7 +17,7 @@ func parseAsmLabelAttr(line string) *AsmLabelAttr { Address: groups["address"], Position: groups["position"], FunctionName: groups["function"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/ast_test.go b/ast/ast_test.go index b59de617d..d8936bac8 100644 --- a/ast/ast_test.go +++ b/ast/ast_test.go @@ -5,12 +5,12 @@ import ( "testing" ) -var nodes = map[string]interface{}{ +var nodes = map[string]Node{ // AlwaysInlineAttr `0x7fce780f5018 always_inline`: &AlwaysInlineAttr{ Address: "0x7fce780f5018", Position: "/usr/include/sys/cdefs.h:313:68", - Children: []interface{}{}, + Children: []Node{}, }, // ArraySubscriptExpr @@ -19,7 +19,7 @@ var nodes = map[string]interface{}{ Position: "col:63, col:69", Type: "char *", Kind: "lvalue", - Children: []interface{}{}, + Children: []Node{}, }, // AsmLabelAttr @@ -27,7 +27,7 @@ var nodes = map[string]interface{}{ Address: "0x7ff26d8224e8", Position: "/usr/include/sys/cdefs.h:569:36", FunctionName: "_fopen", - Children: []interface{}{}, + Children: []Node{}, }, // AvailabilityAttr @@ -41,7 +41,7 @@ var nodes = map[string]interface{}{ Unavailable: false, Message1: "", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc5ff8e60d0 watchos 3.0 0 0 "" ""`: &AvailabilityAttr{ Address: "0x7fc5ff8e60d0", @@ -53,7 +53,7 @@ var nodes = map[string]interface{}{ Unavailable: false, Message1: "", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc5ff8e6170 tvos 10.0 0 0 "" ""`: &AvailabilityAttr{ Address: "0x7fc5ff8e6170", @@ -65,7 +65,7 @@ var nodes = map[string]interface{}{ Unavailable: false, Message1: "", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc5ff8e61d8 ios 10.0 0 0 "" ""`: &AvailabilityAttr{ Address: "0x7fc5ff8e61d8", @@ -77,7 +77,7 @@ var nodes = map[string]interface{}{ Unavailable: false, Message1: "", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc5ff8f0e18 swift 0 0 0 Unavailable "Use snprintf instead." ""`: &AvailabilityAttr{ Address: "0x7fc5ff8f0e18", @@ -89,7 +89,7 @@ var nodes = map[string]interface{}{ Unavailable: true, Message1: "Use snprintf instead.", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc5ff8f1988 swift 0 0 0 Unavailable "Use mkstemp(3) instead." ""`: &AvailabilityAttr{ Address: "0x7fc5ff8f1988", @@ -101,7 +101,7 @@ var nodes = map[string]interface{}{ Unavailable: true, Message1: "Use mkstemp(3) instead.", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, `0x104035438 macosx 10.10 0 0 ""`: &AvailabilityAttr{ Address: "0x104035438", @@ -113,7 +113,7 @@ var nodes = map[string]interface{}{ Unavailable: false, Message1: "", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, // BinaryOperator @@ -122,26 +122,26 @@ var nodes = map[string]interface{}{ Position: "col:11, col:23", Type: "unsigned char", Operator: "=", - Children: []interface{}{}, + Children: []Node{}, }, // BreakStmt `0x7fca2d8070e0 `: &BreakStmt{ Address: "0x7fca2d8070e0", Position: "col:11, col:23", - Children: []interface{}{}, + Children: []Node{}, }, // BuiltinType `0x7f8a43023f40 '__int128'`: &BuiltinType{ Address: "0x7f8a43023f40", Type: "__int128", - Children: []interface{}{}, + Children: []Node{}, }, `0x7f8a43023ea0 'unsigned long long'`: &BuiltinType{ Address: "0x7f8a43023ea0", Type: "unsigned long long", - Children: []interface{}{}, + Children: []Node{}, }, // CallExpr @@ -149,13 +149,13 @@ var nodes = map[string]interface{}{ Address: "0x7f9bf3033240", Position: "col:11, col:25", Type: "int", - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9bf3035c20 'int'`: &CallExpr{ Address: "0x7f9bf3035c20", Position: "line:7:4, col:64", Type: "int", - Children: []interface{}{}, + Children: []Node{}, }, // CharacterLiteral @@ -164,19 +164,19 @@ var nodes = map[string]interface{}{ Position: "col:62", Type: "int", Value: 10, - Children: []interface{}{}, + Children: []Node{}, }, // CompoundStmt `0x7fbd0f014f18 `: &CompoundStmt{ Address: "0x7fbd0f014f18", Position: "col:54, line:358:1", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fbd0f8360b8 `: &CompoundStmt{ Address: "0x7fbd0f8360b8", Position: "line:4:1, line:13:1", - Children: []interface{}{}, + Children: []Node{}, }, // ConditionalOperator @@ -184,7 +184,7 @@ var nodes = map[string]interface{}{ Address: "0x7fc6ae0bc678", Position: "col:6, col:89", Type: "void", - Children: []interface{}{}, + Children: []Node{}, }, // ConstAttr @@ -192,7 +192,7 @@ var nodes = map[string]interface{}{ Address: "0x7fa3b88bbb38", Position: "line:4:1, line:13:1", Tags: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // ConstantArrayType @@ -200,13 +200,13 @@ var nodes = map[string]interface{}{ Address: "0x7f94ad016a40", Type: "struct __va_list_tag [1]", Size: 1, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f8c5f059d20 'char [37]' 37`: &ConstantArrayType{ Address: "0x7f8c5f059d20", Type: "char [37]", Size: 37, - Children: []interface{}{}, + Children: []Node{}, }, // CStyleCastExpr @@ -215,7 +215,7 @@ var nodes = map[string]interface{}{ Position: "col:50, col:56", Type: "char", Kind: "IntegralCast", - Children: []interface{}{}, + Children: []Node{}, }, // DeclRefExpr @@ -228,7 +228,7 @@ var nodes = map[string]interface{}{ Address2: "0x7fc9720642d0", Name: "_p", Type2: "FILE *", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fc97206a958 'int (int, FILE *)' Function 0x7fc972064198 '__swbuf' 'int (int, FILE *)'`: &DeclRefExpr{ Address: "0x7fc97206a958", @@ -239,7 +239,7 @@ var nodes = map[string]interface{}{ Address2: "0x7fc972064198", Name: "__swbuf", Type2: "int (int, FILE *)", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fa36680f170 'struct programming':'struct programming' lvalue Var 0x7fa36680dc20 'variable' 'struct programming':'struct programming'`: &DeclRefExpr{ Address: "0x7fa36680f170", @@ -250,14 +250,14 @@ var nodes = map[string]interface{}{ Address2: "0x7fa36680dc20", Name: "variable", Type2: "struct programming", - Children: []interface{}{}, + Children: []Node{}, }, // DeclStmt `0x7fb791846e80 `: &DeclStmt{ Address: "0x7fb791846e80", Position: "line:11:4, col:31", - Children: []interface{}{}, + Children: []Node{}, }, // DeprecatedAttr @@ -266,7 +266,7 @@ var nodes = map[string]interface{}{ Position: "line:180:48, col:63", Message1: "This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.", Message2: "", - Children: []interface{}{}, + Children: []Node{}, }, // ElaboratedType @@ -274,14 +274,14 @@ var nodes = map[string]interface{}{ Address: "0x7f873686c120", Type: "union __mbstate_t", Tags: "sugar", - Children: []interface{}{}, + Children: []Node{}, }, // Enum `0x7f980b858308 'foo'`: &Enum{ Address: "0x7f980b858308", Name: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // EnumDecl @@ -290,7 +290,7 @@ var nodes = map[string]interface{}{ Position: "line:180:1, line:186:1", Position2: "", Name: "__codecvt_result", - Children: []interface{}{}, + Children: []Node{}, }, // EnumConstantDecl @@ -300,14 +300,14 @@ var nodes = map[string]interface{}{ Position2: "", Name: "__codecvt_noconv", Type: "int", - Children: []interface{}{}, + Children: []Node{}, }, // EnumType `0x7f980b858309 'foo'`: &EnumType{ Address: "0x7f980b858309", Name: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // FieldDecl @@ -318,7 +318,7 @@ var nodes = map[string]interface{}{ Name: "_ur", Type: "int", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fef510c46f8 col:16 _ub 'struct __sbuf':'struct __sbuf'`: &FieldDecl{ Address: "0x7fef510c46f8", @@ -327,7 +327,7 @@ var nodes = map[string]interface{}{ Name: "_ub", Type: "struct __sbuf", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fef510c3fe0 col:19 _read 'int (* _Nullable)(void *, char *, int)':'int (*)(void *, char *, int)'`: &FieldDecl{ Address: "0x7fef510c3fe0", @@ -336,7 +336,7 @@ var nodes = map[string]interface{}{ Name: "_read", Type: "int (* _Nullable)(void *, char *, int)", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fef51073a60 col:40 __cleanup_stack 'struct __darwin_pthread_handler_rec *'`: &FieldDecl{ Address: "0x7fef51073a60", @@ -345,7 +345,7 @@ var nodes = map[string]interface{}{ Name: "__cleanup_stack", Type: "struct __darwin_pthread_handler_rec *", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fef510738e8 col:7 __opaque 'char [16]'`: &FieldDecl{ Address: "0x7fef510738e8", @@ -354,7 +354,7 @@ var nodes = map[string]interface{}{ Name: "__opaque", Type: "char [16]", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fe9f5072268 col:6 referenced _lbfsize 'int'`: &FieldDecl{ Address: "0x7fe9f5072268", @@ -363,7 +363,7 @@ var nodes = map[string]interface{}{ Name: "_lbfsize", Type: "int", Referenced: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9bc9083d00 line:91:5 'unsigned short'`: &FieldDecl{ Address: "0x7f9bc9083d00", @@ -372,7 +372,7 @@ var nodes = map[string]interface{}{ Name: "", Type: "unsigned short", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x30363a0 __val 'int [2]'`: &FieldDecl{ Address: "0x30363a0", @@ -381,7 +381,7 @@ var nodes = map[string]interface{}{ Name: "__val", Type: "int [2]", Referenced: false, - Children: []interface{}{}, + Children: []Node{}, }, // FloatingLiteral @@ -390,7 +390,7 @@ var nodes = map[string]interface{}{ Position: "col:24", Type: "double", Value: 1.23, - Children: []interface{}{}, + Children: []Node{}, }, // FormatAttr @@ -402,7 +402,7 @@ var nodes = map[string]interface{}{ FunctionName: "printf", Unknown1: 2, Unknown2: 3, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fcc8d8ecff8 printf 2 3`: &FormatAttr{ Address: "0x7fcc8d8ecff8", @@ -412,7 +412,7 @@ var nodes = map[string]interface{}{ FunctionName: "printf", Unknown1: 2, Unknown2: 3, - Children: []interface{}{}, + Children: []Node{}, }, `0x273b4d0 Inherited printf 2 3`: &FormatAttr{ Address: "0x273b4d0", @@ -422,7 +422,7 @@ var nodes = map[string]interface{}{ FunctionName: "printf", Unknown1: 2, Unknown2: 3, - Children: []interface{}{}, + Children: []Node{}, }, // FunctionDecl @@ -436,7 +436,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsImplicit: false, IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fb5a90e2a50 /usr/include/sys/stdio.h:39:5 renameat 'int (int, const char *, int, const char *)'`: &FunctionDecl{ Address: "0x7fb5a90e2a50", @@ -448,7 +448,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsImplicit: false, IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fb5a90e9b70 col:6 implicit fprintf 'int (FILE *, const char *, ...)' extern`: &FunctionDecl{ Address: "0x7fb5a90e9b70", @@ -460,7 +460,7 @@ var nodes = map[string]interface{}{ IsExtern: true, IsImplicit: true, IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fb5a90e9d40 prev 0x7fb5a90e9b70 /usr/include/stdio.h:244:6 fprintf 'int (FILE *, const char *, ...)'`: &FunctionDecl{ Address: "0x7fb5a90e9d40", @@ -472,7 +472,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsImplicit: false, IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fb5a90ec210 col:6 implicit used printf 'int (const char *, ...)' extern`: &FunctionDecl{ Address: "0x7fb5a90ec210", @@ -484,7 +484,7 @@ var nodes = map[string]interface{}{ IsExtern: true, IsImplicit: true, IsUsed: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x2ae30d8 :17:1 __acos 'double (double)' extern`: &FunctionDecl{ Address: "0x2ae30d8", @@ -496,7 +496,7 @@ var nodes = map[string]interface{}{ IsExtern: true, IsImplicit: false, IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, // FunctionProtoType @@ -504,21 +504,21 @@ var nodes = map[string]interface{}{ Address: "0x7fa3b88bbb30", Type: "struct _opaque_pthread_t *", Kind: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // ForStmt `0x7f961e018848 `: &ForStmt{ Address: "0x7f961e018848", Position: "line:9:4, line:10:70", - Children: []interface{}{}, + Children: []Node{}, }, // IfStmt `0x7fc0a69091d0 `: &IfStmt{ Address: "0x7fc0a69091d0", Position: "line:11:7, line:18:7", - Children: []interface{}{}, + Children: []Node{}, }, // ImplicitCastExpr @@ -527,14 +527,14 @@ var nodes = map[string]interface{}{ Position: "col:8", Type: "FILE *", Kind: "LValueToRValue", - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9f5b0a7828 'int (*)(int, FILE *)' `: &ImplicitCastExpr{ Address: "0x7f9f5b0a7828", Position: "col:11", Type: "int (*)(int, FILE *)", Kind: "FunctionToPointerDecay", - Children: []interface{}{}, + Children: []Node{}, }, // IntegerLiteral @@ -543,14 +543,14 @@ var nodes = map[string]interface{}{ Position: "col:14", Type: "int", Value: 1, - Children: []interface{}{}, + Children: []Node{}, }, // MallocAttr `0x7fc0a69091d1 `: &MallocAttr{ Address: "0x7fc0a69091d1", Position: "line:11:7, line:18:7", - Children: []interface{}{}, + Children: []Node{}, }, // MemberExpr @@ -561,7 +561,7 @@ var nodes = map[string]interface{}{ Lvalue: true, Name: "_w", Address2: "0x7fcc758d60c8", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fcc76004210 'unsigned char *' lvalue ->_p 0x7fcc758d6018`: &MemberExpr{ Address: "0x7fcc76004210", @@ -570,7 +570,7 @@ var nodes = map[string]interface{}{ Lvalue: true, Name: "_p", Address2: "0x7fcc758d6018", - Children: []interface{}{}, + Children: []Node{}, }, `0x7f85338325b0 'float' lvalue .constant 0x7f8533832260`: &MemberExpr{ Address: "0x7f85338325b0", @@ -579,7 +579,7 @@ var nodes = map[string]interface{}{ Lvalue: true, Name: "constant", Address2: "0x7f8533832260", - Children: []interface{}{}, + Children: []Node{}, }, `0x7f8533832670 'char *' lvalue .pointer 0x7f85338322b8`: &MemberExpr{ Address: "0x7f8533832670", @@ -588,7 +588,7 @@ var nodes = map[string]interface{}{ Lvalue: true, Name: "pointer", Address2: "0x7f85338322b8", - Children: []interface{}{}, + Children: []Node{}, }, // ModeAttr @@ -596,26 +596,26 @@ var nodes = map[string]interface{}{ Address: "0x7f980b858309", Position: "line:11:7, line:18:7", Name: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // NoThrowAttr `0x7fa1488273a0 `: &NoThrowAttr{ Address: "0x7fa1488273a0", Position: "line:7:4, line:11:4", - Children: []interface{}{}, + Children: []Node{}, }, // NonNullAttr `0x7fa1488273b0 1`: &NonNullAttr{ Address: "0x7fa1488273b0", Position: "line:7:4, line:11:4", - Children: []interface{}{}, + Children: []Node{}, }, `0x2cce280 1`: &NonNullAttr{ Address: "0x2cce280", Position: "/sys/cdefs.h:286:44, /bits/mathcalls.h:115:69", - Children: []interface{}{}, + Children: []Node{}, }, // ParenExpr @@ -623,7 +623,7 @@ var nodes = map[string]interface{}{ Address: "0x7fb0bc8b2308", Position: "col:10, col:25", Type: "unsigned char", - Children: []interface{}{}, + Children: []Node{}, }, // ParmVarDecl @@ -635,7 +635,7 @@ var nodes = map[string]interface{}{ Name: "", Type2: "", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f973380f070 col:31 'const char *'`: &ParmVarDecl{ Address: "0x7f973380f070", @@ -645,7 +645,7 @@ var nodes = map[string]interface{}{ Name: "", Type2: "", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9733816e50 col:37 __filename 'const char *__restrict'`: &ParmVarDecl{ Address: "0x7f9733816e50", @@ -655,7 +655,7 @@ var nodes = map[string]interface{}{ Name: "__filename", Type2: "", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9733817418 <> 'FILE *'`: &ParmVarDecl{ Address: "0x7f9733817418", @@ -665,7 +665,7 @@ var nodes = map[string]interface{}{ Name: "", Type2: "", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f9733817c30 col:47 __size 'size_t':'unsigned long'`: &ParmVarDecl{ Address: "0x7f9733817c30", @@ -675,7 +675,7 @@ var nodes = map[string]interface{}{ Name: "__size", Type2: "unsigned long", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f973382fa10 col:34 'int (* _Nullable)(void *, char *, int)':'int (*)(void *, char *, int)'`: &ParmVarDecl{ Address: "0x7f973382fa10", @@ -685,7 +685,7 @@ var nodes = map[string]interface{}{ Name: "", Type2: "int (*)(void *, char *, int)", IsUsed: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f97338355b8 col:14 used argc 'int'`: &ParmVarDecl{ Address: "0x7f97338355b8", @@ -695,14 +695,14 @@ var nodes = map[string]interface{}{ Name: "argc", Type2: "", IsUsed: true, - Children: []interface{}{}, + Children: []Node{}, }, // PointerType `0x7fa3b88bbb30 'struct _opaque_pthread_t *'`: &PointerType{ Address: "0x7fa3b88bbb30", Type: "struct _opaque_pthread_t *", - Children: []interface{}{}, + Children: []Node{}, }, // PredefinedExpr @@ -712,7 +712,7 @@ var nodes = map[string]interface{}{ Type: "const char [25]", Lvalue: true, Name: "__PRETTY_FUNCTION__", - Children: []interface{}{}, + Children: []Node{}, }, // QualType @@ -720,14 +720,14 @@ var nodes = map[string]interface{}{ Address: "0x7fa3b88bbb31", Type: "struct _opaque_pthread_t *", Kind: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // Record `0x7fd3ab857950 '__sFILE'`: &Record{ Address: "0x7fd3ab857950", Type: "__sFILE", - Children: []interface{}{}, + Children: []Node{}, }, // RecordDecl @@ -739,7 +739,7 @@ var nodes = map[string]interface{}{ Kind: "union", Name: "", Definition: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f85360285c8 line:57:8 struct __darwin_pthread_handler_rec definition`: &RecordDecl{ Address: "0x7f85360285c8", @@ -749,7 +749,7 @@ var nodes = map[string]interface{}{ Kind: "struct", Name: "__darwin_pthread_handler_rec", Definition: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x7f85370248a0 col:8 struct __sFILEX`: &RecordDecl{ Address: "0x7f85370248a0", @@ -759,14 +759,14 @@ var nodes = map[string]interface{}{ Kind: "struct", Name: "__sFILEX", Definition: false, - Children: []interface{}{}, + Children: []Node{}, }, // RecordType `0x7fd3ab84dda0 'struct _opaque_pthread_condattr_t'`: &RecordType{ Address: "0x7fd3ab84dda0", Type: "struct _opaque_pthread_condattr_t", - Children: []interface{}{}, + Children: []Node{}, }, // RestrictAttr @@ -774,14 +774,14 @@ var nodes = map[string]interface{}{ Address: "0x7f980b858305", Position: "line:11:7, line:18:7", Name: "foo", - Children: []interface{}{}, + Children: []Node{}, }, // ReturnStmt `0x7fbb7a8325e0 `: &ReturnStmt{ Address: "0x7fbb7a8325e0", Position: "line:13:4, col:11", - Children: []interface{}{}, + Children: []Node{}, }, // StringLiteral @@ -791,20 +791,20 @@ var nodes = map[string]interface{}{ Type: "char [45]", Lvalue: true, Value: "Number of command line arguments passed: %d\n", - Children: []interface{}{}, + Children: []Node{}, }, // TranslationUnitDecl `0x7fe78a815ed0 <> `: &TranslationUnitDecl{ Address: "0x7fe78a815ed0", - Children: []interface{}{}, + Children: []Node{}, }, // Typedef `0x7f84d10dc1d0 '__darwin_ssize_t'`: &Typedef{ Address: "0x7f84d10dc1d0", Type: "__darwin_ssize_t", - Children: []interface{}{}, + Children: []Node{}, }, // TypedefDecl @@ -817,7 +817,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: false, IsReferenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7ffb9f824278 <> implicit __uint128_t 'unsigned __int128'`: &TypedefDecl{ Address: "0x7ffb9f824278", @@ -828,7 +828,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: true, IsReferenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7ffb9f824898 <> implicit referenced __builtin_va_list 'struct __va_list_tag [1]'`: &TypedefDecl{ Address: "0x7ffb9f824898", @@ -839,7 +839,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: true, IsReferenced: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x7ffb9f8248f8 col:24 __int8_t 'signed char'`: &TypedefDecl{ Address: "0x7ffb9f8248f8", @@ -850,7 +850,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: false, IsReferenced: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7ffb9f8dbf50 col:27 referenced __darwin_va_list '__builtin_va_list':'struct __va_list_tag [1]'`: &TypedefDecl{ Address: "0x7ffb9f8dbf50", @@ -861,7 +861,7 @@ var nodes = map[string]interface{}{ Type2: "struct __va_list_tag [1]", IsImplicit: false, IsReferenced: true, - Children: []interface{}{}, + Children: []Node{}, }, `0x34461f0 __io_read_fn '__ssize_t (void *, char *, size_t)'`: &TypedefDecl{ Address: "0x34461f0", @@ -872,7 +872,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: false, IsReferenced: false, - Children: []interface{}{}, + Children: []Node{}, }, // Issue: #26 `0x55b9da8784b0 line:341:19 __io_write_fn '__ssize_t (void *, const char *, size_t)'`: &TypedefDecl{ @@ -884,7 +884,7 @@ var nodes = map[string]interface{}{ Type2: "", IsImplicit: false, IsReferenced: false, - Children: []interface{}{}, + Children: []Node{}, }, // TypedefType @@ -892,7 +892,7 @@ var nodes = map[string]interface{}{ Address: "0x7f887a0dc760", Type: "__uint16_t", Tags: "sugar", - Children: []interface{}{}, + Children: []Node{}, }, // UnaryOperator @@ -903,7 +903,7 @@ var nodes = map[string]interface{}{ IsLvalue: false, IsPrefix: true, Operator: "--", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fe0260fb468 'unsigned char' lvalue prefix '*'`: &UnaryOperator{ Address: "0x7fe0260fb468", @@ -912,7 +912,7 @@ var nodes = map[string]interface{}{ IsLvalue: true, IsPrefix: true, Operator: "*", - Children: []interface{}{}, + Children: []Node{}, }, `0x7fe0260fb448 'unsigned char *' postfix '++'`: &UnaryOperator{ Address: "0x7fe0260fb448", @@ -921,7 +921,7 @@ var nodes = map[string]interface{}{ IsLvalue: false, IsPrefix: false, Operator: "++", - Children: []interface{}{}, + Children: []Node{}, }, // VarDecl @@ -935,7 +935,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsUsed: false, IsCInit: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fd5e90e9078 col:14 __stdinp 'FILE *' extern`: &VarDecl{ Address: "0x7fd5e90e9078", @@ -947,7 +947,7 @@ var nodes = map[string]interface{}{ IsExtern: true, IsUsed: false, IsCInit: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fd5e90ed630 col:47 __size 'size_t':'unsigned long'`: &VarDecl{ Address: "0x7fd5e90ed630", @@ -959,7 +959,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsUsed: false, IsCInit: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fee35907a78 col:8 used c 'int'`: &VarDecl{ Address: "0x7fee35907a78", @@ -971,7 +971,7 @@ var nodes = map[string]interface{}{ IsExtern: false, IsUsed: true, IsCInit: false, - Children: []interface{}{}, + Children: []Node{}, }, `0x7fb0fd90ba30 tests/assert/assert.c:13:9 used b 'int *' cinit`: &VarDecl{ Address: "0x7fb0fd90ba30", @@ -983,14 +983,14 @@ var nodes = map[string]interface{}{ IsExtern: false, IsUsed: true, IsCInit: true, - Children: []interface{}{}, + Children: []Node{}, }, // WhileStmt `0x7fa1478273a0 `: &WhileStmt{ Address: "0x7fa1478273a0", Position: "line:7:4, line:11:4", - Children: []interface{}{}, + Children: []Node{}, }, } diff --git a/ast/availability_attr.go b/ast/availability_attr.go index 0a7865fb9..dd513997a 100644 --- a/ast/availability_attr.go +++ b/ast/availability_attr.go @@ -10,7 +10,7 @@ type AvailabilityAttr struct { Unavailable bool Message1 string Message2 string - Children []interface{} + Children []Node } func parseAvailabilityAttr(line string) *AvailabilityAttr { @@ -36,7 +36,7 @@ func parseAvailabilityAttr(line string) *AvailabilityAttr { Unavailable: len(groups["unavalable"]) > 0, Message1: removeQuotes(groups["message1"]), Message2: removeQuotes(groups["message2"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/break_stmt.go b/ast/break_stmt.go index 426192e36..04ba15135 100644 --- a/ast/break_stmt.go +++ b/ast/break_stmt.go @@ -3,7 +3,7 @@ package ast type BreakStmt struct { Address string Position string - Children []interface{} + Children []Node } func parseBreakStmt(line string) *BreakStmt { @@ -15,7 +15,7 @@ func parseBreakStmt(line string) *BreakStmt { return &BreakStmt{ Address: groups["address"], Position: groups["position"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/builtin_type.go b/ast/builtin_type.go index 4f845aeac..c29c0c743 100644 --- a/ast/builtin_type.go +++ b/ast/builtin_type.go @@ -3,7 +3,7 @@ package ast type BuiltinType struct { Address string Type string - Children []interface{} + Children []Node } func parseBuiltinType(line string) *BuiltinType { @@ -15,7 +15,7 @@ func parseBuiltinType(line string) *BuiltinType { return &BuiltinType{ Address: groups["address"], Type: groups["type"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/character_literal.go b/ast/character_literal.go index a5236c88c..378cd7ede 100644 --- a/ast/character_literal.go +++ b/ast/character_literal.go @@ -5,7 +5,7 @@ type CharacterLiteral struct { Position string Type string Value int - Children []interface{} + Children []Node } func parseCharacterLiteral(line string) *CharacterLiteral { @@ -19,7 +19,7 @@ func parseCharacterLiteral(line string) *CharacterLiteral { Position: groups["position"], Type: groups["type"], Value: atoi(groups["value"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/const_attr.go b/ast/const_attr.go index 09129ab40..961ce78aa 100644 --- a/ast/const_attr.go +++ b/ast/const_attr.go @@ -4,7 +4,7 @@ type ConstAttr struct { Address string Position string Tags string - Children []interface{} + Children []Node } func parseConstAttr(line string) *ConstAttr { @@ -17,7 +17,7 @@ func parseConstAttr(line string) *ConstAttr { Address: groups["address"], Position: groups["position"], Tags: groups["tags"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/decl_ref_expr.go b/ast/decl_ref_expr.go index b99ace329..59b6a890d 100644 --- a/ast/decl_ref_expr.go +++ b/ast/decl_ref_expr.go @@ -9,7 +9,7 @@ type DeclRefExpr struct { Address2 string Name string Type2 string - Children []interface{} + Children []Node } func parseDeclRefExpr(line string) *DeclRefExpr { @@ -34,7 +34,7 @@ func parseDeclRefExpr(line string) *DeclRefExpr { Address2: groups["address2"], Name: groups["name"], Type2: groups["type2"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/deprecated_attr.go b/ast/deprecated_attr.go index 70aafe0ab..55826716d 100644 --- a/ast/deprecated_attr.go +++ b/ast/deprecated_attr.go @@ -5,7 +5,7 @@ type DeprecatedAttr struct { Position string Message1 string Message2 string - Children []interface{} + Children []Node } func parseDeprecatedAttr(line string) *DeprecatedAttr { @@ -19,7 +19,7 @@ func parseDeprecatedAttr(line string) *DeprecatedAttr { Position: groups["position"], Message1: removeQuotes(groups["message1"]), Message2: removeQuotes(groups["message2"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/enum.go b/ast/enum.go index a8917b8c9..248b20ca4 100644 --- a/ast/enum.go +++ b/ast/enum.go @@ -3,7 +3,7 @@ package ast type Enum struct { Address string Name string - Children []interface{} + Children []Node } func parseEnum(line string) *Enum { @@ -15,7 +15,7 @@ func parseEnum(line string) *Enum { return &Enum{ Address: groups["address"], Name: groups["name"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/floating_literal.go b/ast/floating_literal.go index 59b31e0c8..257d0d45e 100644 --- a/ast/floating_literal.go +++ b/ast/floating_literal.go @@ -7,7 +7,7 @@ type FloatingLiteral struct { Position string Type string Value float64 - Children []interface{} + Children []Node } func parseFloatingLiteral(line string) *FloatingLiteral { @@ -21,7 +21,7 @@ func parseFloatingLiteral(line string) *FloatingLiteral { Position: groups["position"], Type: groups["type"], Value: atof(groups["value"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/format_attr.go b/ast/format_attr.go index 220a21ef4..2cde1997f 100644 --- a/ast/format_attr.go +++ b/ast/format_attr.go @@ -8,7 +8,7 @@ type FormatAttr struct { FunctionName string Unknown1 int Unknown2 int - Children []interface{} + Children []Node } func parseFormatAttr(line string) *FormatAttr { @@ -30,7 +30,7 @@ func parseFormatAttr(line string) *FormatAttr { FunctionName: groups["function"], Unknown1: atoi(groups["unknown1"]), Unknown2: atoi(groups["unknown2"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/integer_literal.go b/ast/integer_literal.go index 577630e2b..333863997 100644 --- a/ast/integer_literal.go +++ b/ast/integer_literal.go @@ -7,7 +7,7 @@ type IntegerLiteral struct { Position string Type string Value int - Children []interface{} + Children []Node } func parseIntegerLiteral(line string) *IntegerLiteral { @@ -21,7 +21,7 @@ func parseIntegerLiteral(line string) *IntegerLiteral { Position: groups["position"], Type: groups["type"], Value: atoi(groups["value"]), - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/malloc_attr.go b/ast/malloc_attr.go index b9a3afaa1..f650a15a0 100644 --- a/ast/malloc_attr.go +++ b/ast/malloc_attr.go @@ -3,7 +3,7 @@ package ast type MallocAttr struct { Address string Position string - Children []interface{} + Children []Node } func parseMallocAttr(line string) *MallocAttr { @@ -15,7 +15,7 @@ func parseMallocAttr(line string) *MallocAttr { return &MallocAttr{ Address: groups["address"], Position: groups["position"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/mode_attr.go b/ast/mode_attr.go index 48ac36178..4446f9622 100644 --- a/ast/mode_attr.go +++ b/ast/mode_attr.go @@ -4,7 +4,7 @@ type ModeAttr struct { Address string Position string Name string - Children []interface{} + Children []Node } func parseModeAttr(line string) *ModeAttr { @@ -17,7 +17,7 @@ func parseModeAttr(line string) *ModeAttr { Address: groups["address"], Position: groups["position"], Name: groups["name"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/no_throw_attr.go b/ast/no_throw_attr.go index 644035d0f..d44578d34 100644 --- a/ast/no_throw_attr.go +++ b/ast/no_throw_attr.go @@ -3,7 +3,7 @@ package ast type NoThrowAttr struct { Address string Position string - Children []interface{} + Children []Node } func parseNoThrowAttr(line string) *NoThrowAttr { @@ -15,7 +15,7 @@ func parseNoThrowAttr(line string) *NoThrowAttr { return &NoThrowAttr{ Address: groups["address"], Position: groups["position"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/non_null_attr.go b/ast/non_null_attr.go index 2bfa9cfc0..7b784a7ce 100644 --- a/ast/non_null_attr.go +++ b/ast/non_null_attr.go @@ -3,7 +3,7 @@ package ast type NonNullAttr struct { Address string Position string - Children []interface{} + Children []Node } func parseNonNullAttr(line string) *NonNullAttr { @@ -15,7 +15,7 @@ func parseNonNullAttr(line string) *NonNullAttr { return &NonNullAttr{ Address: groups["address"], Position: groups["position"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/record.go b/ast/record.go index 82d2a5682..fc1c67e6a 100644 --- a/ast/record.go +++ b/ast/record.go @@ -3,7 +3,7 @@ package ast type Record struct { Address string Type string - Children []interface{} + Children []Node } func parseRecord(line string) *Record { @@ -15,7 +15,7 @@ func parseRecord(line string) *Record { return &Record{ Address: groups["address"], Type: groups["type"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/restrict_attr.go b/ast/restrict_attr.go index 3935a91d3..c4df7ebaa 100644 --- a/ast/restrict_attr.go +++ b/ast/restrict_attr.go @@ -4,7 +4,7 @@ type RestrictAttr struct { Address string Position string Name string - Children []interface{} + Children []Node } func parseRestrictAttr(line string) *RestrictAttr { @@ -17,7 +17,7 @@ func parseRestrictAttr(line string) *RestrictAttr { Address: groups["address"], Position: groups["position"], Name: groups["name"], - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/string_literal.go b/ast/string_literal.go index 68f9e52be..c74800195 100644 --- a/ast/string_literal.go +++ b/ast/string_literal.go @@ -11,7 +11,7 @@ type StringLiteral struct { Type string Value string Lvalue bool - Children []interface{} + Children []Node } func parseStringLiteral(line string) *StringLiteral { @@ -26,7 +26,7 @@ func parseStringLiteral(line string) *StringLiteral { Type: groups["type"], Value: unescapeString(groups["value"]), Lvalue: true, - Children: []interface{}{}, + Children: []Node{}, } } diff --git a/ast/typedef.go b/ast/typedef.go index c412c52dd..8d05213dd 100644 --- a/ast/typedef.go +++ b/ast/typedef.go @@ -3,7 +3,7 @@ package ast type Typedef struct { Address string Type string - Children []interface{} + Children []Node } func parseTypedef(line string) *Typedef { @@ -15,7 +15,7 @@ func parseTypedef(line string) *Typedef { return &Typedef{ Address: groups["address"], Type: groups["type"], - Children: []interface{}{}, + Children: []Node{}, } }