Skip to content

Commit

Permalink
Adjust heuristic
Browse files Browse the repository at this point in the history
This commit moves the check for BOM at the start of the file and fixes a potential problem of compatibility with re2.
Note that `{3}?` in re2 is interpreted as matching the previous token exactly 3 times exactly while the Oniguruma engine interprets this as matching 3 or 0 times.
  • Loading branch information
DecimalTurn authored Aug 1, 2024
1 parent 8e3b265 commit a881a04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/linguist/heuristics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ disambiguations:
- extensions: ['.bas']
rules:
- language: B4X
pattern: '\A(?:.*(?:\r?\n|\r)){0,9}^\W{3}?B4(?:J|A|R|i)=true'
pattern: '\A(?:\W{3})?(?:.*(?:\r?\n|\r)){0,9}^B4(?:J|A|R|i)=true'
- language: FreeBasic
pattern: '^[ \t]*#(?i)(?:define|endif|endmacro|ifn?def|include|lang|macro)(?:$|\s)'
- language: BASIC
Expand Down

0 comments on commit a881a04

Please sign in to comment.