From 6983001d85c3530f08407f955357ff6085806a66 Mon Sep 17 00:00:00 2001 From: Ali Clark Date: Sun, 20 Sep 2020 09:06:02 +0100 Subject: [PATCH] Add counting lineBreaks in js and btstring --- lib/nearley-language-bootstrapped.js | 2 ++ lib/nearley-language-bootstrapped.ne | 2 ++ 2 files changed, 4 insertions(+) diff --git a/lib/nearley-language-bootstrapped.js b/lib/nearley-language-bootstrapped.js index 6911b972..267f04ee 100644 --- a/lib/nearley-language-bootstrapped.js +++ b/lib/nearley-language-bootstrapped.js @@ -23,6 +23,7 @@ var rules = Object.assign({ js: { match: /\{\%(?:[^%]|\%[^}])*\%\}/, value: x => x.slice(2, -2), + lineBreaks: true, }, word: {match: /[\w\?\+]+/, next: 'afterWord'}, string: { @@ -34,6 +35,7 @@ var rules = Object.assign({ match: /`[^`]*`/, value: x => x.slice(1, -1), next: 'main', + lineBreaks: true, }, }, literals([ ",", "|", "$", "%", "(", ")", diff --git a/lib/nearley-language-bootstrapped.ne b/lib/nearley-language-bootstrapped.ne index 52a0fba3..210bb0bc 100644 --- a/lib/nearley-language-bootstrapped.ne +++ b/lib/nearley-language-bootstrapped.ne @@ -20,6 +20,7 @@ var rules = Object.assign({ js: { match: /\{\%(?:[^%]|\%[^}])*\%\}/, value: x => x.slice(2, -2), + lineBreaks: true, }, word: {match: /[\w\?\+]+/, next: 'afterWord'}, string: { @@ -31,6 +32,7 @@ var rules = Object.assign({ match: /`[^`]*`/, value: x => x.slice(1, -1), next: 'main', + lineBreaks: true, }, }, literals([ ",", "|", "$", "%", "(", ")",