Skip to content

Commit

Permalink
fix(reasonml) fix poly backtracking issue
Browse files Browse the repository at this point in the history
- fix typo/bug with using `s` vs `\s` (string vs regex mistake)
- simply `[pattern]?[pattern]?` to just `[pattern]{0,2}`
- fix ambiguous `\s*` poly issues
  • Loading branch information
joshgoebel committed Dec 3, 2020
1 parent d496052 commit fa46dd1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/languages/reasonml.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ export default function(hljs) {
const RE_MODULE_IDENT = '`?[A-Z$_][0-9a-zA-Z$_]*';

const RE_PARAM_TYPEPARAM = '\'?[a-z$_][0-9a-z$_]*';
const RE_PARAM_TYPE = '\s*:\s*[a-z$_][0-9a-z$_]*(\(\s*(' + RE_PARAM_TYPEPARAM + '\s*(,' + RE_PARAM_TYPEPARAM + ')*)?\s*\))?';
const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + ')?(' + RE_PARAM_TYPE + ')?';
const RE_PARAM_TYPE = '\\s*:\\s*[a-z$_][0-9a-z$_]*(\\(\\s*(' + RE_PARAM_TYPEPARAM + '\\s*(,' + RE_PARAM_TYPEPARAM + '\\s*)*)?\\))?';
const RE_PARAM = RE_IDENT + '(' + RE_PARAM_TYPE + '){0,2}';
const RE_OPERATOR = "(" + orReValues([
'||',
'++',
Expand Down

0 comments on commit fa46dd1

Please sign in to comment.