lineInfoObj (and check, expect) now return absolute paths (#8466)
This commit is contained in:
parent
931273cc6b
commit
818d9be311
3 changed files with 4 additions and 2 deletions
|
|
@ -25,7 +25,6 @@
|
||||||
- The dot style for import paths (e.g ``import path.to.module`` instead of
|
- The dot style for import paths (e.g ``import path.to.module`` instead of
|
||||||
``import path/to/module``) has been deprecated.
|
``import path/to/module``) has been deprecated.
|
||||||
|
|
||||||
|
|
||||||
#### Breaking changes in the standard library
|
#### Breaking changes in the standard library
|
||||||
|
|
||||||
- ``re.split`` for empty regular expressions now yields every character in
|
- ``re.split`` for empty regular expressions now yields every character in
|
||||||
|
|
@ -61,6 +60,8 @@
|
||||||
1-based coordinates on POSIX for correct behaviour; the Windows behaviour
|
1-based coordinates on POSIX for correct behaviour; the Windows behaviour
|
||||||
was always correct).
|
was always correct).
|
||||||
|
|
||||||
|
- ``lineInfoObj`` now returns absolute path instead of project path.
|
||||||
|
It's used by ``lineInfo``, ``check``, ``expect``, ``require``, etc.
|
||||||
|
|
||||||
#### Breaking changes in the compiler
|
#### Breaking changes in the compiler
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1409,7 +1409,7 @@ proc rawExecute(c: PCtx, start: int, tos: PStackFrame): TFullReg =
|
||||||
of opcNGetFile:
|
of opcNGetFile:
|
||||||
decodeB(rkNode)
|
decodeB(rkNode)
|
||||||
let n = regs[rb].node
|
let n = regs[rb].node
|
||||||
regs[ra].node = newStrNode(nkStrLit, toFilename(c.config, n.info))
|
regs[ra].node = newStrNode(nkStrLit, toFullPath(c.config, n.info))
|
||||||
regs[ra].node.info = n.info
|
regs[ra].node.info = n.info
|
||||||
regs[ra].node.typ = n.typ
|
regs[ra].node.typ = n.typ
|
||||||
of opcNGetLine:
|
of opcNGetLine:
|
||||||
|
|
|
||||||
|
|
@ -425,6 +425,7 @@ proc getColumn(arg: NimNode): int {.magic: "NLineInfo", noSideEffect.}
|
||||||
proc getFile(arg: NimNode): string {.magic: "NLineInfo", noSideEffect.}
|
proc getFile(arg: NimNode): string {.magic: "NLineInfo", noSideEffect.}
|
||||||
|
|
||||||
proc lineInfoObj*(n: NimNode): LineInfo {.compileTime.} =
|
proc lineInfoObj*(n: NimNode): LineInfo {.compileTime.} =
|
||||||
|
## returns ``LineInfo`` of ``n``, using absolute path for ``filename``
|
||||||
result.filename = n.getFile
|
result.filename = n.getFile
|
||||||
result.line = n.getLine
|
result.line = n.getLine
|
||||||
result.column = n.getColumn
|
result.column = n.getColumn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue