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

Let REM and ' signify comment line when at beginning of line #1

Merged
merged 3 commits into from
Feb 8, 2023

Conversation

hxlnt
Copy link
Contributor

@hxlnt hxlnt commented Feb 1, 2023

Currently, the REM keyword creates comment-style highlighting even when in the middle of a line.

Additionally, the single quote mark ' is not interpreted as an alternative syntax for REM.

This change seeks to address both issues. Please have a look and see if this change is satisfactory. Thank you!

Current behavior of BASIC code block as rendered in GitHub Markdown:
image

hxlnt added 2 commits February 2, 2023 14:23
Allows for midline `: REM`-style comments
Identifies a variety of REM and single-quote comment styles
Copy link
Owner

@telnet23 telnet23 left a comment

Choose a reason for hiding this comment

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

Thanks for contributing.

@telnet23 telnet23 merged commit 1721254 into telnet23:master Feb 8, 2023
@@ -26,7 +26,7 @@ patterns: [
}
{
# comment
match: '(?i:REM.*)'
match: '(?i:\bREM\b.*|^'.*| '.*)'
Copy link

@lildude lildude Feb 21, 2023

Choose a reason for hiding this comment

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

👋 from github/linguist which uses this grammar for highlighting BASIC files on GitHub.com.

This PR introduces a typo which causes our grammar compiler to fail because the new ' chars here aren't escaped which makes this an invalid CSON grammar file.

This should probably be match: '(?i:\bREM\b.*|^\'.*| \'.*)'

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thank you, @lildude. I've made a new PR (#2) to address this feedback.

Hoping to see the new comment syntax support make it to the GitHub syntax highlighter!

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

Successfully merging this pull request may close these issues.

3 participants