Skip to content

Commit

Permalink
compiler/semcall: return the correct lineinfo for nkCallStrLit (nim-l…
Browse files Browse the repository at this point in the history
  • Loading branch information
alaviss authored and alehander92 committed Dec 2, 2019
1 parent d6d65c8 commit cdbc187
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 2 additions & 1 deletion compiler/semcall.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 11 additions & 0 deletions nimsuggest/tests/tcallstrlit_highlight.nim
Original file line number Diff line number Diff line change
@@ -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
"""

0 comments on commit cdbc187

Please sign in to comment.