Skip to content
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

Wrong syntax highlighting for q comments #1

Open
010100111001 opened this issue May 20, 2013 · 4 comments
Open

Wrong syntax highlighting for q comments #1

010100111001 opened this issue May 20, 2013 · 4 comments

Comments

@010100111001
Copy link

  1. Forward slash for opening block comment must be first and only character on a single line.
  2. Back slash for closing block comment must be first and only character on a single line.
  3. Inline comments must be preceded by closing square brackets or closing bracket or space.
@010100111001
Copy link
Author

My JSON for comments only looks like:
{
"name": "comment.block.source.q",
"begin": "^/[ ]$",
"end" : "^\[ ]
$",
"comment": "string"
},
{
"name": "comment.block.source.q",
"match": "^/.+",
"comment": "string"
},
{
"name": "comment.line.source.q",
"match": " /.*",
"comment": "string"
},

@kimtang
Copy link
Owner

kimtang commented May 24, 2013

Looks good. Thanks for your contribution.
Let me test it on my machine and I will push this into github.

@010100111001
Copy link
Author

There is still one comment highlighting that I have left out since my solution is not elegant. "" by itself on a single line will make the interpreter to ignore the rest of the q script.

Since I couldn't find a regex for EOF, I used a work-around (WAR):
{
"name": "comment.block.source.q",
"begin": "^\\$",
"end" : "<>",
"comment": "string"
},

The WAR does not work if someone does have the text "<>" string after a single line "" in their source

@bravegag
Copy link

I'm not sure if I have the same problem because the issue description is not very clear but syntax highlighting for comments doesn't work unless the comment is at the beginning of the line e.g. if I use any identation due to e.g. functions then my comments are not syntax highlighted correctly e.g.

/- this is hightlighted correctly
________ /- this is NOThightlighted correctly
________ / this is hightlighted correctly
________ /this is NOThightlighted correctly

where ________ is whatever spacing, tabs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants