asbjornenge / Docker.tmbundle

Dockerfile syntax
MIT License
75 stars 27 forks source link

back slash breaks syntax highlighting #8

Closed jasjuang closed 8 years ago

jasjuang commented 8 years ago

If I have something like

RUN echo a=\"b+c\" >> test.txt
# everything below is messed up

I can confirm that it's the backslash that is causing the issue because when I remove them the syntax highlighting goes back to normal

asbjornenge commented 8 years ago

Hi @jasjuang :-)

You on Sublime Text or TextMate? Is this a new issue or has it been like that for a while? Might be related to #6 or #7 ?

//cc @princemaple @andyneff

princemaple commented 8 years ago

PR#9 should fix this one. It was caused by the combination of the backslashes and the quotes. The escaped chars weren't handled in directive args, and the first quote got the rest of the line scoped into string, and the second backslash triggered the escape in string context and escaped the second quote, and caused a missing closing quote, hence the error. Sorry about the inconvenience.

princemaple commented 8 years ago

https://github.com/asbjornenge/Docker.tmbundle/releases/tag/v1.3.2 take a look at the release note, it's so funny that github highlights it wrong in the exact same (old) way.

EDIT: actually not exactly the same way but close.

asbjornenge commented 8 years ago

@princemaple weeell, might not be all that funny since github is using this exact repo for it's Dockerfile highlighting :stuck_out_tongue_closed_eyes: ref #2 At least they were...

I think however they are using the tmLanguage... Have got any time/energy/experience at all to add these fixes & updates to the tmLanguage version?

princemaple commented 8 years ago

Wow didn't realize THAT :sweat_smile: . I can take a look but no guarantees, I have not ever tried to understand or use plist. In fact, I learned how to parse stuff by looking at how sublime-syntax does it...

asbjornenge commented 8 years ago

@princemaple same here :stuck_out_tongue_closed_eyes: Any help would be greatly appreciated. I'm just super swamped at work & home atm. I know there exist some conversion tools that could be a good starting point. Also, perhaps @infininight could take a quick peek?

Should we move this discussions to a new issue perhaps?

princemaple commented 8 years ago

Yep https://github.com/asbjornenge/Docker.tmbundle/issues/10

jasjuang commented 8 years ago

Thanks for the fix. It solves it for me!