Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
enh(fsharp) Global overhaul #3348
enh(fsharp) Global overhaul #3348
Changes from 1 commit
cb01dd7
58f949e
01a4990
bbc6b2e
8efe882
2e7c63f
fa98e32
1272ee8
478b625
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
title.class
is for names of classes such asWordParser
, etc... (andclass
alone is deprecated) you may want a multi-matcher here... what is the syntax you're trying to cover?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed this because I noticed
class
was deprecated. I thoughttitle.class
was the replacement.The syntax I'm trying to cover is any type definition (the part before the first
=
or(
):It's currently parsed as follows:

I'm not sure I understand the meaning behind all the different standard scopes. What should I do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not care/desire this type of "semantic" flagging (that what we deprecated when we deprecated
class
). IE we don't care about "class definitions". We only care about "class name/title" (which may or may not be in a definition). So above there should be NO nesting.type
is a keywordA
is atitle.class
type A = int * int
(overall is nothing)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can also replace this
excludeEnd
with a look-ahead in theend
regex, what do you think?Should I also replace the
excludeBegin
with abegin
regex in a look behind like so (with a look ahead for the expected content):/(?<=^\s*\[<)(?=\s*\w)/
?(and I just noticed the current regex has an extra
<
in the content look ahead that I inadvertently added when copy pasting from the csharp version...)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I went ahead and resolved these [lookahead vs excludeEnd] in my commit.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I saw, but what about the
excludeBegin
? Should we also strive to replace them with look behinds?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because we can't use look-behinds at all yet - see prior discussion. When we support look-behind that's definitely something we'd have a look at.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I did not understand that, I thought it was only negative look behind we couldn't use, my bad.
Why does the doc seems to indicate look-behinds in
begin
are supported?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The key is in the wording:
The key being "when JS [browsers] supports it". Nothing in our engine prevents them from working for begin - if the JS engine includes support. (as you've seen when using them initially) If you wanted to fork the library or use a 3rd party grammar that uses them - go for it - you just lose support for Mac OS Safari. At least one 3rd party library does feature detection - resulting in inconsistent behavior across browsers - but thats' not a tradeoff we're interested in for Core.
However, the engine itself would break if look-behind was used in
end
because of the way our engine is currently designed - the end matchers do not always have access to preceding content, so there is nothing to "look behind at".There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. I'm still a bit confused by the subtlety, but ok ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://highlightjs.readthedocs.io/en/latest/language-guide.html#regular-expression-features