diff --git a/src/lexer/index.js b/src/lexer/index.js index 1620263..3ff59fe 100644 --- a/src/lexer/index.js +++ b/src/lexer/index.js @@ -7,7 +7,7 @@ let { COMMENT, STRING, NUMBER, - BOOLEAN + BOOLEAN, } = require('./regexp') let peek = require('./peek') @@ -42,7 +42,7 @@ module.exports = function lex (code) { type: 'pragma', value: token.substring(1), line, - column + column, }) cursor += token.length column += token.length @@ -55,7 +55,7 @@ module.exports = function lex (code) { type: 'comment', value: token, line, - column + column, }) cursor += token.length column += token.length @@ -67,7 +67,7 @@ module.exports = function lex (code) { type: 'space', value: ' ', line, - column + column, }) cursor += 1 column += 1 @@ -80,13 +80,13 @@ module.exports = function lex (code) { type: 'space', value: ' ', line, - column + column, }) tokens.push({ type: 'space', value: ' ', line, - column + column, }) cursor += 1 column += 1 @@ -98,7 +98,7 @@ module.exports = function lex (code) { type: 'newline', value: '\n', line, - column + column, }) // special lookahead to see if we got \r\n let twochars = code[cursor] + code[cursor + 1] @@ -117,7 +117,7 @@ module.exports = function lex (code) { type: 'boolean', value: tmp === 'false' ? false : true, // questionable line, - column + column, }) cursor += tmp.length column += tmp.length @@ -133,7 +133,7 @@ module.exports = function lex (code) { type: 'number', value: Number(token), line, - column + column, }) cursor += token.length column += token.length @@ -151,7 +151,7 @@ module.exports = function lex (code) { type: 'string', value: token, line, - column + column, } let quote = singleQuote || doubleQuote || backtick if (quote) { diff --git a/src/lexer/peek.js b/src/lexer/peek.js index 830fbc4..bbb3e96 100644 --- a/src/lexer/peek.js +++ b/src/lexer/peek.js @@ -2,7 +2,7 @@ const { DASHERIZED, SPACE, NEWLINE, - STRING + STRING, } = require('./regexp') const PragmaSyntaxError = require('../errors/lex-pragma-syntax') @@ -91,5 +91,5 @@ module.exports = { } return token } - } + }, } diff --git a/src/parser/array.js b/src/parser/array.js index e8b31c6..33278d5 100644 --- a/src/parser/array.js +++ b/src/parser/array.js @@ -16,7 +16,7 @@ module.exports = function array (lines) { type: 'array', line: copy[0][0].line, column: copy[0][0].column, - values: copy[0].slice(0) + values: copy[0].slice(0), } return { end, value } diff --git a/src/parser/index.js b/src/parser/index.js index 8c56c21..ed50160 100644 --- a/src/parser/index.js +++ b/src/parser/index.js @@ -54,7 +54,7 @@ module.exports = function parse (tokens) { raw: token.value, line: token.line, column: token.column, - values: [] + values: [], } arcfile.values.push(pragma) index += 1 diff --git a/src/parser/map.js b/src/parser/map.js index f4eba8a..2beaeff 100644 --- a/src/parser/map.js +++ b/src/parser/map.js @@ -89,6 +89,6 @@ module.exports = function map (tokens) { return { end, - value: { type: 'map', name, raw, values } + value: { type: 'map', name, raw, values }, } } diff --git a/src/parser/vector.js b/src/parser/vector.js index 3684698..9e7a8ee 100644 --- a/src/parser/vector.js +++ b/src/parser/vector.js @@ -35,6 +35,6 @@ module.exports = function vector (tokens) { return { end: first.length + values.length, - value: { type: 'vector', name, raw, values } + value: { type: 'vector', name, raw, values }, } } diff --git a/test/01-ast-scalar-test.js b/test/01-ast-scalar-test.js index 08c2873..3ee0976 100644 --- a/test/01-ast-scalar-test.js +++ b/test/01-ast-scalar-test.js @@ -25,10 +25,10 @@ test('ast empty', t => { { type: 'newline', value: '\n', line: 3, column: 18 }, { type: 'space', value: ' ', line: 4, column: 1 }, { type: 'space', value: ' ', line: 4, column: 2 }, - { type: 'comment', value: '# comment3', line: 4, column: 3 } - ] - } - ] + { type: 'comment', value: '# comment3', line: 4, column: 3 }, + ], + }, + ], } let parsed = parse.parser(parse.lexer(mock)) @@ -67,10 +67,10 @@ true` { type: 'newline', value: '\n', line: 5, column: 4 }, { type: 'number', value: 2, line: 6, column: 1 }, { type: 'newline', value: '\n', line: 6, column: 2 }, - { type: 'boolean', value: true, line: 7, column: 1 } - ] - } - ] + { type: 'boolean', value: true, line: 7, column: 1 }, + ], + }, + ], } let parsed = parse.parser(parse.lexer(mock)) @@ -116,13 +116,13 @@ one true 3 # comment2` type: 'comment', value: '# comment2', line: 5, - column: 12 - } - ] - } - ] - } - ] + column: 12, + }, + ], + }, + ], + }, + ], } let tokens = parse.lexer(mock) diff --git a/test/02-ast-complex-test.js b/test/02-ast-complex-test.js index fb661ac..75d45ff 100644 --- a/test/02-ast-complex-test.js +++ b/test/02-ast-complex-test.js @@ -78,14 +78,14 @@ this should be ignored` type: 'comment', value: '# comment4', line: 8, - column: 3 + column: 3, }, { type: 'newline', value: '\n', line: 8, column: 13 }, { type: 'space', value: ' ', line: 9, column: 1 }, { type: 'space', value: ' ', line: 9, column: 2 }, { type: 'string', value: 'values', line: 9, column: 3 }, - { type: 'newline', value: '\n', line: 9, column: 9 } - ] + { type: 'newline', value: '\n', line: 9, column: 9 }, + ], }, { type: 'array', @@ -98,12 +98,12 @@ this should be ignored` { type: 'space', value: ' ', line: 10, column: 12 }, { type: 'string', value: 'be', line: 10, column: 13 }, { type: 'space', value: ' ', line: 10, column: 15 }, - { type: 'string', value: 'ignored', line: 10, column: 16 } - ] - } - ] - } - ] + { type: 'string', value: 'ignored', line: 10, column: 16 }, + ], + }, + ], + }, + ], } let parsed = parse.parser(parse.lexer(mock)) console.dir(parsed, { depth: null }) diff --git a/test/04-compiler-test.js b/test/04-compiler-test.js index 47fcaee..ee13f8b 100644 --- a/test/04-compiler-test.js +++ b/test/04-compiler-test.js @@ -42,7 +42,7 @@ ssr "node_modules/@enhance/ssr"` t.same(arc, { bundles: [ [ 'my-package', 'node_modules/my-package' ], [ 'store', 'node_modules/@enhance/store' ], - [ 'ssr', 'node_modules/@enhance/ssr' ] + [ 'ssr', 'node_modules/@enhance/ssr' ], ] }) console.log(arc) }) @@ -133,8 +133,8 @@ cat let arc = parse.compiler(ast) t.same(arc, { pets: [ - { cat: { names: [ 'sutr0', 'tux3d0' ] } } - ] + { cat: { names: [ 'sutr0', 'tux3d0' ] } }, + ], }) console.dir(arc, { depth: null }) }) diff --git a/test/09-architect-test.js b/test/09-architect-test.js index 102ba93..b846928 100644 --- a/test/09-architect-test.js +++ b/test/09-architect-test.js @@ -56,7 +56,7 @@ test('Test full Architect project manifest mock', t => { 'scheduled', 'queues', 'tables', - 'indexes' + 'indexes', ] let pragmaConfig = { app: 1, @@ -69,7 +69,7 @@ test('Test full Architect project manifest mock', t => { scheduled: 1, queues: 3, tables: 2, - indexes: 2 + indexes: 2, } t.plan(1 + (pragmas.length * 2)) let isArray = i => Array.isArray(i)