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

Syntax highlighting: RegExp #154

Closed
faiwer opened this issue Jul 3, 2018 · 2 comments
Closed

Syntax highlighting: RegExp #154

faiwer opened this issue Jul 3, 2018 · 2 comments

Comments

@faiwer
Copy link

faiwer commented Jul 3, 2018

Hello, it's again me. This is a strange one :)

export const a = a =>
{
	return a
		.a(/<\/x>(\s*)<x>/)
		// [b]b[/b] => <b>b</b>
};
export const a = () => {};

img_03_07_01_00f913f3505

There are 2 troubles:

  • the second export const is white instead of red-blue
  • the line with comment (if you cut it to // [b]b[/b] => ) breaks everything:

img_03_07_01_cd2b1a6f516

Is it okay that I create so much syntax-highlighting issues for you? :)

@borela
Copy link
Owner

borela commented Jul 3, 2018

Nice find, this edge case was caused by the regex literal. Fixed https://github.com/borela/naomi/releases/tag/v4.0.2 Not fixed yet, found another edge case.

@borela
Copy link
Owner

borela commented Jul 3, 2018

https://github.com/borela/naomi/releases/tag/v4.0.3 I reduced the flexibility of the code to either allow comments between function calls and parentheses or generics, this is not perfect but will highlight correctly most sources.

@faiwer faiwer closed this as completed Jul 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants