parent
d0721eadf8
commit
613829f7a4
6 changed files with 72 additions and 5 deletions
|
|
@ -91,7 +91,7 @@ block tlexerex:
|
|||
|
||||
|
||||
|
||||
block tlineinfo:
|
||||
block tcopylineinfo:
|
||||
# issue #5617, feature request
|
||||
type Test = object
|
||||
|
||||
|
|
@ -103,6 +103,27 @@ block tlineinfo:
|
|||
var z = mixer(Test)
|
||||
doAssert z
|
||||
|
||||
block tsetgetlineinfo:
|
||||
# issue #21098, feature request
|
||||
type Test = object
|
||||
|
||||
macro mixer1(n: typed): untyped =
|
||||
let x = newIdentNode("echo")
|
||||
var lineInfo = n.lineInfoObj
|
||||
x.setLineInfo lineInfo
|
||||
result = newLit(x.lineInfo == n.lineInfo)
|
||||
|
||||
macro mixer2(n: typed): untyped =
|
||||
let x = newIdentNode("echo")
|
||||
var lineInfo = n.lineInfoObj
|
||||
lineInfo.line += 1
|
||||
x.setLineInfo lineInfo
|
||||
result = newLit(x.lineInfo != n.lineInfo)
|
||||
|
||||
doAssert mixer1(Test)
|
||||
|
||||
doAssert mixer2(Test)
|
||||
|
||||
|
||||
|
||||
block tdebugstmt:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue