fixes multiline comments
This commit is contained in:
parent
2c2ab6884c
commit
71cf1f650e
2 changed files with 20 additions and 2 deletions
|
|
@ -934,7 +934,9 @@ proc skip(L: var TLexer, tok: var TToken) =
|
||||||
if buf[pos+1] == '#': break
|
if buf[pos+1] == '#': break
|
||||||
if buf[pos+1] == '[':
|
if buf[pos+1] == '[':
|
||||||
skipMultiLineComment(L, tok, pos+2, false)
|
skipMultiLineComment(L, tok, pos+2, false)
|
||||||
return
|
pos = L.bufpos
|
||||||
|
buf = L.buf
|
||||||
|
else:
|
||||||
while buf[pos] notin {CR, LF, nimlexbase.EndOfFile}: inc(pos)
|
while buf[pos] notin {CR, LF, nimlexbase.EndOfFile}: inc(pos)
|
||||||
else:
|
else:
|
||||||
break # EndOfFile also leaves the loop
|
break # EndOfFile also leaves the loop
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,8 @@ proc main* =
|
||||||
Yay, that is so cool.
|
Yay, that is so cool.
|
||||||
]##
|
]##
|
||||||
echo "foo bar"
|
echo "foo bar"
|
||||||
|
for s in ["one", "two", #["three",]# "four"]:
|
||||||
|
echo s
|
||||||
|
|
||||||
var foo #[ Test the new inline comments ]#: int = 3
|
var foo #[ Test the new inline comments ]#: int = 3
|
||||||
##[ A
|
##[ A
|
||||||
|
|
@ -16,3 +18,17 @@ novel documentation comment
|
||||||
]#
|
]#
|
||||||
]##
|
]##
|
||||||
echo $foo
|
echo $foo
|
||||||
|
|
||||||
|
#[Comment here.
|
||||||
|
Multiple lines
|
||||||
|
are not a problem.]#
|
||||||
|
|
||||||
|
#[ #[ Multiline comment in already
|
||||||
|
commented out code. ]#
|
||||||
|
proc p[T](x: T) = discard
|
||||||
|
]#
|
||||||
|
|
||||||
|
proc bar =
|
||||||
|
##[Long documentation comment
|
||||||
|
here.
|
||||||
|
]##
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue