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

Incorrect highlighting of (non-)matching for/end #1791

Closed
ForceBru opened this issue Dec 28, 2021 · 3 comments · Fixed by #1830
Closed

Incorrect highlighting of (non-)matching for/end #1791

ForceBru opened this issue Dec 28, 2021 · 3 comments · Fixed by #1830
Assignees
Labels
CM6 CodeMirror 6

Comments

@ForceBru
Copy link

ForceBru commented Dec 28, 2021

How to reproduce

Paste this code into a cell:

let
	sum(
		sum(
			x for x in g
		)
		for x in g
	)
end

Now put the cursor after the last end.

Result

The last for is highlighted as a match:

...but it's actually not - the let is the correct match.


Looks like the first for-loop generator expression (that's Python lingo, not sure what this is called in Julia) is the culprit. If I replace the inner sum with sum(g), everything is highlighted correctly:

let
	sum(
		sum(g)
		for x in g
	)
end
@pankgeorg
Copy link
Collaborator

We use a light julia parser which is, unfortunately not equivalent to the real one.

We'll need to add the special case where the generator parenthesis is omitted when within a function - i.e. this is parsed correctly:
image

@dralletje
Copy link
Collaborator

I'M ON IT @pankgeorg !!!!

@dralletje
Copy link
Collaborator

dralletje commented Dec 30, 2021

The problem is the parser didn't understand

let <BLANK>
  <expressions>
end

but it's coming soon! I have a lot of bugs fixed on the julia-lezer side already!
Currently looking at the colors 😏 #1723

@fonsp fonsp added the CM6 CodeMirror 6 label Jan 17, 2022
@fonsp fonsp linked a pull request Jan 20, 2022 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CM6 CodeMirror 6
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants