-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Added case-insensitive matches for FreeBasic. #6367
Conversation
After looking a little more into it, I'm not sure if it's a good idea to make the heuristics case-insensitive for FreeBasic mainly because when I look at FreeBasic code on GitHub, I see that the use of lowercase is prevalent and I actually found no use of uppercase in the first five pages of results when looking at the highlighted keywords. Do you have any examples of FreeBasic repos or files missclassified because they were using a different casing convention than the norm? |
For example, here is a capital letter: |
I see that this file still makes use of lowercase However, after looking further, I've found the following file: It does only include the use of In that case, I'm in favor of this change even if it won't make a big difference since this won't interfere with other languages currently supported in Linguist. |
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.
While we're here, we might as well harden these heuristics to deal with files that aren't terminated by a trailing newline (something that's more common on Windows). For example:
regex = /^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)\s/
"Foo\nBar\n#endif\n" =~ regex # => 8
"Foo\nBar\n#endif" =~ regex # => nil
Co-authored-by: John Gardner <gardnerjohng@gmail.com>
Co-authored-by: John Gardner <gardnerjohng@gmail.com>
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.
LGTM. Thanks.
Note: this PR will not be merged until close to when the next release is made. See here for more details.
Description
Added case-insensitive matches for FreeBasic heuristics.
Checklist:
I am fixing a misclassified language (FreeBasic)
I am changing the source of a syntax highlighting grammar
I am updating a grammar submodule
I am adding new or changing current functionality
I am changing the color associated with a language