123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527 |
- discard """
- nimout: '''
- StmtList
- TypeSection
- TypeDef
- Ident "BarePtr"
- Empty
- PtrTy
- TypeDef
- Ident "GenericPtr"
- Empty
- PtrTy
- Bracket
- Ident "int"
- TypeDef
- Ident "PrefixPtr"
- Empty
- PtrTy
- Ident "int"
- TypeDef
- Ident "PtrTuple"
- Empty
- PtrTy
- TupleConstr
- Ident "int"
- Ident "string"
- TypeDef
- Ident "BareRef"
- Empty
- RefTy
- TypeDef
- Ident "GenericRef"
- Empty
- RefTy
- Bracket
- Ident "int"
- TypeDef
- Ident "RefTupleCl"
- Empty
- RefTy
- TupleTy
- TypeDef
- Ident "RefTupleType"
- Empty
- RefTy
- TupleConstr
- Ident "int"
- Ident "string"
- TypeDef
- Ident "RefTupleVars"
- Empty
- RefTy
- TupleConstr
- Ident "a"
- Ident "b"
- TypeDef
- Ident "BareStatic"
- Empty
- Ident "static"
- TypeDef
- Ident "GenericStatic"
- Empty
- BracketExpr
- Ident "static"
- Ident "int"
- TypeDef
- Ident "PrefixStatic"
- Empty
- Command
- Ident "static"
- Ident "int"
- TypeDef
- Ident "StaticTupleCl"
- Empty
- Command
- Ident "static"
- TupleClassTy
- TypeDef
- Ident "StaticTuple"
- Empty
- Command
- Ident "static"
- TupleConstr
- Ident "int"
- Ident "string"
- TypeDef
- Ident "BareType"
- Empty
- Ident "type"
- TypeDef
- Ident "GenericType"
- Empty
- BracketExpr
- Ident "type"
- Ident "float"
- TypeDef
- Ident "TypeTupleGen"
- Empty
- BracketExpr
- Ident "type"
- TupleClassTy
- TypeDef
- Ident "TypeTupleCl"
- Empty
- Command
- Ident "type"
- TupleClassTy
- TypeDef
- Ident "TypeInstance"
- Empty
- Command
- Ident "type"
- BracketExpr
- Ident "Foo"
- RefTy
- TypeDef
- Ident "bareTypeDesc"
- Empty
- Ident "typedesc"
- TypeDef
- Ident "TypeOfVar"
- Empty
- Call
- Ident "type"
- Ident "a"
- TypeDef
- Ident "TypeOfVarAlt"
- Empty
- Command
- Ident "type"
- Par
- Ident "a"
- TypeDef
- Ident "TypeOfTuple1"
- Empty
- Call
- Ident "type"
- Ident "a"
- TypeDef
- Ident "TypeOfTuple2"
- Empty
- Call
- Ident "type"
- Ident "a"
- Ident "b"
- TypeDef
- Ident "TypeOfTuple1A"
- Empty
- Command
- Ident "type"
- TupleConstr
- Ident "a"
- TypeDef
- Ident "TypeOfTuple2A"
- Empty
- Command
- Ident "type"
- TupleConstr
- Ident "a"
- Ident "b"
- TypeDef
- Ident "TypeTuple"
- Empty
- Command
- Ident "type"
- TupleConstr
- Ident "int"
- Ident "string"
- TypeDef
- Ident "GenericTypedesc"
- Empty
- BracketExpr
- Ident "typedesc"
- Ident "int"
- TypeDef
- Ident "T"
- Empty
- Ident "type"
- ProcDef
- Ident "foo"
- Empty
- Empty
- FormalParams
- Ident "type"
- IdentDefs
- Ident "bareType"
- Ident "type"
- Empty
- IdentDefs
- Ident "genType"
- BracketExpr
- Ident "type"
- Ident "int"
- Empty
- IdentDefs
- Ident "typeInt"
- Command
- Ident "type"
- Ident "int"
- Empty
- IdentDefs
- Ident "typeIntAlt"
- Call
- Ident "type"
- Ident "int"
- Empty
- IdentDefs
- Ident "typeOfVar"
- Call
- Ident "type"
- Ident "a"
- Empty
- IdentDefs
- Ident "typeDotType"
- DotExpr
- Ident "foo"
- Ident "type"
- Empty
- IdentDefs
- Ident "typeTupleCl"
- Command
- Ident "type"
- TupleClassTy
- Empty
- IdentDefs
- Ident "bareStatic"
- Ident "static"
- Empty
- IdentDefs
- Ident "genStatic"
- BracketExpr
- Ident "static"
- Ident "int"
- Empty
- IdentDefs
- Ident "staticInt"
- Command
- Ident "static"
- Ident "int"
- Empty
- IdentDefs
- Ident "staticVal1"
- Command
- Ident "static"
- IntLit 10
- Empty
- IdentDefs
- Ident "staticVal2"
- Call
- Ident "static"
- StrLit "str"
- Empty
- IdentDefs
- Ident "staticVal3"
- Command
- Ident "static"
- StrLit "str"
- Empty
- IdentDefs
- Ident "staticVal4"
- CallStrLit
- Ident "static"
- RStrLit "str"
- Empty
- IdentDefs
- Ident "staticDotVal"
- DotExpr
- IntLit 10
- Ident "static"
- Empty
- IdentDefs
- Ident "bareRef"
- RefTy
- Empty
- IdentDefs
- Ident "refTuple1"
- RefTy
- Par
- Ident "int"
- Empty
- IdentDefs
- Ident "refTuple1A"
- RefTy
- TupleConstr
- Ident "int"
- Empty
- IdentDefs
- Ident "refTuple2"
- RefTy
- TupleConstr
- Ident "int"
- Ident "string"
- Empty
- IdentDefs
- Ident "genRef"
- RefTy
- Bracket
- Ident "int"
- Empty
- IdentDefs
- Ident "refInt"
- RefTy
- Ident "int"
- Empty
- IdentDefs
- Ident "refCall"
- RefTy
- Par
- Ident "a"
- Empty
- IdentDefs
- Ident "macroCall1"
- Command
- Ident "foo"
- Ident "bar"
- Empty
- IdentDefs
- Ident "macroCall2"
- Call
- Ident "foo"
- Ident "bar"
- Empty
- IdentDefs
- Ident "macroCall3"
- Call
- DotExpr
- Ident "foo"
- Ident "bar"
- Ident "baz"
- Empty
- IdentDefs
- Ident "macroCall4"
- Call
- BracketExpr
- Ident "foo"
- Ident "bar"
- Ident "baz"
- Empty
- IdentDefs
- Ident "macroCall5"
- Command
- Ident "foo"
- Command
- Ident "bar"
- Ident "baz"
- IntLit 10
- Empty
- Empty
- StmtList
- Asgn
- Ident "staticTen"
- Command
- Ident "static"
- IntLit 10
- Asgn
- Ident "staticA"
- Call
- Ident "static"
- Ident "a"
- Asgn
- Ident "staticCall"
- Command
- Ident "static"
- Call
- Ident "foo"
- IntLit 1
- Asgn
- Ident "staticStrCall"
- Command
- Ident "static"
- CallStrLit
- Ident "foo"
- RStrLit "x"
- Asgn
- Ident "staticChainCall"
- Command
- Ident "static"
- Command
- Ident "foo"
- Ident "bar"
- Asgn
- Ident "typeTen"
- Command
- Ident "type"
- IntLit 10
- Asgn
- Ident "typeA"
- Call
- Ident "type"
- Ident "a"
- Asgn
- Ident "typeCall"
- Command
- Ident "type"
- Call
- Ident "foo"
- IntLit 1
- Asgn
- Ident "typeStrCall"
- Command
- Ident "type"
- CallStrLit
- Ident "foo"
- RStrLit "x"
- Asgn
- Ident "typeChainCall"
- Command
- Ident "type"
- Command
- Ident "foo"
- Ident "bar"
- Asgn
- Ident "normalChainCall"
- Command
- Ident "foo"
- Command
- Ident "bar"
- Ident "baz"
- Asgn
- Ident "normalTupleCall2"
- Call
- Ident "foo"
- Ident "a"
- Ident "b"
- StaticStmt
- StmtList
- Ident "singleStaticStmt"
- StaticStmt
- StmtList
- Ident "staticStmtList1"
- Ident "staticStmtList2"
- '''
- """
- import macros
- dumpTree:
- type
- BarePtr = ptr
- GenericPtr = ptr[int]
- PrefixPtr = ptr int
- PtrTuple = ptr (int, string)
- BareRef = ref
- GenericRef = ref[int]
- RefTupleCl = ref tuple
- RefTupleType = ref (int, string)
- RefTupleVars = ref (a, b)
- BareStatic = static # Used to be Error: invalid indentation
- GenericStatic = static[int]
- PrefixStatic = static int
- StaticTupleCl = static tuple
- StaticTuple = static (int, string)
- BareType = type
- GenericType = type[float]
- TypeTupleGen = type[tuple]
- TypeTupleCl = type tuple # Used to be Error: invalid indentation
- TypeInstance = type Foo[ref]
- bareTypeDesc = typedesc
- TypeOfVar = type(a)
- TypeOfVarAlt = type (a) # Used to be Error: invalid indentation
- TypeOfTuple1 = type(a,)
- TypeOfTuple2 = type(a,b)
- TypeOfTuple1A = type (a,) # Used to be Error: invalid indentation
- TypeOfTuple2A = type (a,b) # Used to be Error: invalid indentation
- TypeTuple = type (int, string) # Used to be Error: invalid indentation
- GenericTypedesc = typedesc[int]
- T = type
- proc foo(
- bareType : type,
- genType : type[int],
- typeInt : type int,
- typeIntAlt : type(int),
- typeOfVar : type(a),
- typeDotType : foo.type,
- typeTupleCl : type tuple, # Used to be Error: ')' expected
- bareStatic : static, # Used to be Error: expression expected, but found ','
- genStatic : static[int],
- staticInt : static int,
- staticVal1 : static 10,
- staticVal2 : static("str"),
- staticVal3 : static "str",
- staticVal4 : static"str", # Used to be Error: expression expected, but found 'str'
- staticDotVal : 10.static,
- bareRef : ref,
- refTuple1 : ref (int),
- refTuple1A : ref (int,),
- refTuple2 : ref (int,string),
- genRef : ref[int],
- refInt : ref int,
- refCall : ref(a),
- macroCall1 : foo bar,
- macroCall2 : foo(bar),
- macroCall3 : foo.bar(baz),
- macroCall4 : foo[bar](baz),
- macroCall5 : foo bar baz = 10
- ): type =
- staticTen = static 10
- staticA = static(a)
- # staticAspace = static (a) # With newTypedesc: Error: invalid indentation
- # staticAtuple = static (a,) # With newTypedesc: Error: invalid indentation
- # staticTuple = static (a,b) # With newTypedesc: Error: invalid indentation
- # staticTypeTuple = static (int,string) # With newTypedesc: Error: invalid indentation
- staticCall = static foo(1)
- staticStrCall = static foo"x"
- staticChainCall = static foo bar
- typeTen = type 10
- typeA = type(a)
- # typeAspace = type (a) # Error: invalid indentation
- # typeAtuple = type (a,) # Error: invalid indentation
- # typeTuple = type (a,b) # Error: invalid indentation
- # typeTypeTuple = type (int,string) # Error: invalid indentation
- typeCall = type foo(1)
- typeStrCall = type foo"x"
- typeChainCall = type foo bar
- normalChainCall = foo bar baz
- # normalTupleCall1 = foo(a,) # Error: invalid indentation
- normalTupleCall2 = foo(a,b)
- # normalTupleCall3 = foo (a,b) # Error: invalid indentation
- static: singleStaticStmt
- static:
- staticStmtList1
- staticStmtList2
|