expr => untyped; stmt => typed (#14804)

* expr => untyped; stmt => typed

* changelog + comment
This commit is contained in:
Timothee Cour
2020-06-25 01:22:08 -07:00
committed by GitHub
parent 32f335f594
commit 0c56eeda0e
3 changed files with 9 additions and 2 deletions

View File

@@ -221,6 +221,7 @@ proc mydiv(a, b): int {.raises: [].} =
See [docgen](docgen.html#introduction-quick-start) for details.
- Removed the `--oldNewlines` switch.
- Removed the `--laxStrings` switch for mutating the internal zero terminator on strings.
- `$getType(untyped)` is now "untyped" instead of "expr", `$getType(typed)` is now "typed" instead of "stmt"
## Tool changes

View File

@@ -93,8 +93,8 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
of tyBool: result = atomicType("bool", mBool)
of tyChar: result = atomicType("char", mChar)
of tyNil: result = atomicType("nil", mNil)
of tyUntyped: result = atomicType("expr", mExpr)
of tyTyped: result = atomicType("stmt", mStmt)
of tyUntyped: result = atomicType("untyped", mExpr)
of tyTyped: result = atomicType("typed", mStmt)
of tyVoid: result = atomicType("void", mVoid)
of tyEmpty: result = atomicType("empty", mNone)
of tyUncheckedArray:

View File

@@ -49,6 +49,12 @@ block: # typeToString
doAssert (tuple[a: C2b[MyInt, C4[cstring]], b: cint, c: float]).name3 ==
"tuple[a: C[MyInt{int}, C4[cstring]], b: cint{int32}, c: float]"
macro fn(): string =
# not 100% sure whether this should even compile; if some PR breaks this test,
# this could be revisited, maybe.
newLit $($getType(untyped), $getType(typed))
doAssert fn() == """("untyped", "typed")"""
block distinctBase:
block:
type