-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
strformat not highlighted correct in some cases #115
Comments
Another one is:
And also with round brackets for the call it isnt highlighted correct (see tests in strformat.nim) |
hit this again: block: # nim --eval
let opt = "--hints:off"
check fmt"""{nim} {opt} --eval:"echo defined(nimscript)"""".execCmdEx == ("true\n", 0)
check fmt"""{nim} r {opt} --eval:"echo defined(c)"""".execCmdEx == ("true\n", 0)
check fmt"""{nim} r -b:js {opt} --eval:"echo defined(js)"""".execCmdEx == ("true\n", 0)
block: # `hintProcessing` dots should not interfere with `static: echo` + friends
let cmd = fmt"""{nim} r {defaultHintsOff} --hint:processing -f --eval:"static: echo 1+1""""
let (outp, exitCode) = execCmdEx(cmd, options = {poStdErrToStdOut})
template check3(cond) = doAssert cond, $(outp,)
doAssert exitCode == 0
let lines = outp.splitLines
check3 lines.len == 3
when not defined(windows): # xxx: on windows, dots not properly handled, gives: `....2\n\n`
check3 lines[0].isDots
check3 lines[1] == "2"
check3 lines[2] == ""
else:
check3 "2" in outp
=> it works fine in sublime text (which uses https://github.com/Varriount/NimLime for syntax definitions, just like github via github linguist) EDITlooks like the culprit is that syntax definition doesn't understand when there are more than 3 consecutive let cmd = fmt"""{nim} r {defaultHintsOff} --hint:processing -f --eval:"static: echo 1+1""""
=>
let cmd = fmt"""{nim} r {defaultHintsOff} --hint:processing -f --eval:"static: echo 1+1" """ |
The syntax improvements introduced by #105 (comment) don't display correct in the following two cases with "incorrect coloring" :
For me it seemed like I could use
"..."
inside the strformat because the coloring implied it also the compiler error wasn't clear, then I saw that the color highlight needs changes for this case.The text was updated successfully, but these errors were encountered: