Skip to content

Commit

Permalink
Merge pull request #73 from msftrncs/msftrncs-fix
Browse files Browse the repository at this point in the history
inspect.js only reads 'grammer_paths[0]' and swap replace/substr in grammer.ts
  • Loading branch information
alexdima authored Sep 20, 2018
2 parents bd860d3 + 60c6ed6 commit 6b4f4d7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions scripts/inspect.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ var Registry = main.Registry;
var registry = new Registry();
var grammarPromise = null;
for (let path of GRAMMAR_PATHS) {
console.log('LOADING GRAMMAR: ' + GRAMMAR_PATHS[0]);
var content = fs.readFileSync(GRAMMAR_PATHS[0]).toString();
var rawGrammar = main.parseRawGrammar(content, GRAMMAR_PATHS[0]);
console.log('LOADING GRAMMAR: ' + path);
var content = fs.readFileSync(path).toString();
var rawGrammar = main.parseRawGrammar(content, path);
var g = registry.addGrammar(rawGrammar);
grammarPromise = grammarPromise || g;
}
Expand Down
2 changes: 1 addition & 1 deletion src/grammar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -771,7 +771,7 @@ function _tokenizeString(grammar: Grammar, lineText: OnigString, isFirstLine: bo
function scanNext(): void {
if (IN_DEBUG_MODE) {
console.log('');
console.log(`@@scanNext ${linePos}: |${lineText.content.replace(/\n$/, '\\n').substr(linePos)}|`);
console.log(`@@scanNext ${linePos}: |${lineText.content.substr(linePos).replace(/\n$/, '\\n')}|`);
}
let r = matchRuleOrInjections(grammar, lineText, isFirstLine, linePos, stack, anchorPosition);

Expand Down

0 comments on commit 6b4f4d7

Please sign in to comment.