mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 05:50:30 +00:00
compiler/semcall: return the correct lineinfo for nkCallStrLit (#12484)
This commit is contained in:
@@ -474,7 +474,8 @@ proc updateDefaultParams(call: PNode) =
|
||||
|
||||
proc getCallLineInfo(n: PNode): TLineInfo =
|
||||
case n.kind
|
||||
of nkAccQuoted, nkBracketExpr, nkCall, nkCommand: getCallLineInfo(n.sons[0])
|
||||
of nkAccQuoted, nkBracketExpr, nkCall, nkCallStrLit, nkCommand:
|
||||
getCallLineInfo(n.sons[0])
|
||||
of nkDotExpr: getCallLineInfo(n.sons[1])
|
||||
else: n.info
|
||||
|
||||
|
||||
11
nimsuggest/tests/tcallstrlit_highlight.nim
Normal file
11
nimsuggest/tests/tcallstrlit_highlight.nim
Normal file
@@ -0,0 +1,11 @@
|
||||
func foo(s: string) = discard
|
||||
|
||||
foo"string"#[!]#
|
||||
|
||||
discard """
|
||||
$nimsuggest --tester $file
|
||||
>highlight $1
|
||||
highlight;;skFunc;;1;;5;;3
|
||||
highlight;;skType;;1;;12;;6
|
||||
highlight;;skFunc;;3;;0;;3
|
||||
"""
|
||||
Reference in New Issue
Block a user