Skip to content

Commit

Permalink
Default fields WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Clyybber committed Nov 5, 2019
1 parent 3ba3307 commit 1b4f39e
Show file tree
Hide file tree
Showing 5 changed files with 484 additions and 433 deletions.
18 changes: 12 additions & 6 deletions compiler/parser.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,7 @@ proc parseIdentColonEquals(p: var TParser, flags: TDeclaredIdentFlags): PNode =
optInd(p, result)
addSon(result, parseExpr(p))
else:
addSon(result, newNodeP(nkEmpty, p))
addSon(result, p.emptyNode)

proc parseTuple(p: var TParser, indentAllowed = false): PNode =
#| inlTupleDecl = 'tuple'
Expand Down Expand Up @@ -1899,11 +1899,17 @@ proc parseObjectCase(p: var TParser): PNode =
#| | IND{=} objectBranches)
result = newNodeP(nkRecCase, p)
getTokNoInd(p)
var a = newNodeP(nkIdentDefs, p)
addSon(a, identWithPragma(p))
eat(p, tkColon)
addSon(a, parseTypeDesc(p))
addSon(a, p.emptyNode)
var a = parseIdentColonEquals(p, {withPragma})
# var a = newNodeP(nkIdentDefs, p)
# addSon(a, identWithPragma(p))
# eat(p, tkColon)
# addSon(a, parseTypeDesc(p))
# if p.tok.tokType == tkEquals:
# getTok(p)
# optInd(p, result)
# addSon(a, parseExpr(p))
# else:
# addSon(a, p.emptyNode)
addSon(result, a)
if p.tok.tokType == tkColon: getTok(p)
flexComment(p, result)
Expand Down
Loading

0 comments on commit 1b4f39e

Please sign in to comment.