You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constLexer=require('flex-js');varlexer=newLexer();// optionslexer.setIgnoreCase(true);// does not make sense for this scanner, just for reference// definitionslexer.addDefinition('DIGIT',/[0-9]/);// ruleslexer.addRule(/{DIGIT}+\.{DIGIT}+/,function(lexer){console.log('Found float: '+lexer.text);});lexer.addRule(/\s+/);// codelexer.setSource('1.2 3.4 5.6');lexer.lex();
and I got an error
...\node_modules\flex-js\src\Lexer.js:647
re.lastIndex = this.index;
^
TypeError: Cannot set property 'lastIndex' of undefined
at Lexer.execRegExp (...\node_modules\flex-js\src\Lexer.js:647:16)
I am not sure what is the problem but I handled the error with a line of code
if(!re)returnundefined;
Can you guide me?
The text was updated successfully, but these errors were encountered:
I wrote your basic sample in VSCode
and I got an error
I am not sure what is the problem but I handled the error with a line of code
Can you guide me?
The text was updated successfully, but these errors were encountered: