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

Delimited strings are not recognised #17

Open
unleashy opened this issue Sep 29, 2019 · 2 comments
Open

Delimited strings are not recognised #17

unleashy opened this issue Sep 29, 2019 · 2 comments

Comments

@unleashy
Copy link

See gist:

https://gist.github.com/unleashy/c6a01c0798d99726940aec4ffca7f321

After the (admittedly weird) delimited string, the whole file becomes "string"-highlighted. This is obviously because delimited strings are not recognised, so "(" is recognised as a bog-standard string, and the final " is taken as a bog-standard string again, but it never ends.

I'm ok with making a PR to fix this... as soon as I figure out how textmate grammars work 😛

@Geod24
Copy link

Geod24 commented Nov 11, 2020

@jacob-carlborg : I actually just installed TextMate to test this use case.

void main ()
{
	writeln(q"EOF
		Let's see"
		this is still inside a string"
	EOF");
        string str = "Works?";
}

It's interesting that the last quote after EOF does not result in the result of the file being stringified.

@jacob-carlborg
Copy link
Contributor

It's interesting that the last quote after EOF does not result in the result of the file being stringified.

I think the grammar sees the above code snippet as containing two regular strings. One starting at q"EOF and ending at see". The other one starting at string" and ending at EOF".

The grammar doesn't recognize hex strings, delimited strings or token strings. Much of it is still based on D1.

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