Skip to content

Commit

Permalink
Modify to pass tests with nodejs 10 as well
Browse files Browse the repository at this point in the history
  • Loading branch information
takamin committed Jan 23, 2021
1 parent c630020 commit f008fc3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions sample/calc.js
Expand Up @@ -21,7 +21,7 @@ const calc = new Language([
*/
(term) => {
// get no whitespace tokens
const terms = term.contents().flat();
const terms = [].concat(...term.contents());
let acc = terms[0];
for(let i = 1; i < terms.length; i += 2) {
const ope = terms[i];
Expand All @@ -48,7 +48,7 @@ const calc = new Language([
["unary-expression", "multiplicative-expression-rest*"],
],
(term) => {
const terms = term.contents().flat();
const terms = [].concat(...term.contents());
let acc = terms[0];
for(let i = 1; i < terms.length; i += 2) {
const ope = terms[i];
Expand Down
2 changes: 1 addition & 1 deletion test/language.test.js
Expand Up @@ -68,7 +68,7 @@ describe("Language", () => {
[["integer-constant", "additive-expression-rest*"]],
(term) => {
debug(`additive-expression.term: ${JSON.stringify(term, null, 2)}`);
const terms = term.contents().flat();
const terms = [].concat(...term.contents());
debug(`additive-expression.terms: ${JSON.stringify(terms, null, 2)}`);
let acc = terms[0];
for(let i = 1; i < terms.length; i += 2) {
Expand Down

0 comments on commit f008fc3

Please sign in to comment.