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

potential fix for issue#4134 #4136

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/languages/dos.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ export default function(hljs) {
{
className: 'function',
begin: LABEL.begin,
end: 'goto:eof',
end: '\n',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, that was a weird end condition, but now D: is incorrectly detected as a label, is it not? From what I'm reading labels always start with : not end with it... so could we just update our label matcher to something like?

[start of line]:[label_name]

I think that would wrap this up nicely.

Copy link
Author

@the-dg04 the-dg04 Oct 12, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, ive made it so that expressions like [start of line]:[label name] are matched as labels and expressions like [start of line]::[something] are not matched as they denote comments.

contains: [
hljs.inherit(hljs.TITLE_MODE, { begin: '([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*' }),
COMMENT
Expand Down