Skip to content

Commit 09e046d

Browse files
committed
fix range ends in parser tests (4 failed)
1 parent afa5ca1 commit 09e046d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/test/compiler.test.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ describe('Compiler module', () => {
6262

6363
const tokens = tokenizeSyx('keyword ruleish;');
6464
const ast = syxparser.parseTokens(tokens, 'TEST_FILE');
65-
const stmt: KeywordStatement = { type: NodeType.Keyword, modifiers: [], range: { end: { line: 1, character: 14 }, start: { line: 1, character: 0 } }, word: 'ruleish' };
65+
const stmt: KeywordStatement = { type: NodeType.Keyword, modifiers: [], range: { end: { line: 1, character: 15 }, start: { line: 1, character: 0 } }, word: 'ruleish' };
6666

6767
astTypeExpectations(ast);
6868
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -73,7 +73,7 @@ describe('Compiler module', () => {
7373

7474
const tokens = tokenizeSyx('rule \'function-value-return-enabled\': true;');
7575
const ast = syxparser.parseTokens(tokens, 'TEST_FILE');
76-
const stmt:RuleStatement = {range:{start:{line:1,character:0},end:{line:1,character:41}},modifiers:[],rule:'function-value-return-enabled',value:'true',type:NodeType.Rule};
76+
const stmt:RuleStatement = {range:{start:{line:1,character:0},end:{line:1,character:42}},modifiers:[],rule:'function-value-return-enabled',value:'true',type:NodeType.Rule};
7777

7878
astTypeExpectations(ast);
7979
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -84,7 +84,7 @@ describe('Compiler module', () => {
8484

8585
const tokens = tokenizeSyx('compile(ts,js) \'test\';');
8686
const ast = syxparser.parseTokens(tokens,'TEST_FILE');
87-
const stmt:CompileStatement = {range:{start:{line:1,character:0},end:{line:1,character:20}},formats:['ts','js'],type:NodeType.Compile,modifiers:[],body:[{type:NodeType.String,modifiers:[],range:{start:{line:1,character:15},end:{line:1,character:20}},value:'test'}]};
87+
const stmt:CompileStatement = {range:{start:{line:1,character:0},end:{line:1,character:21}},formats:['ts','js'],type:NodeType.Compile,modifiers:[],body:[{type:NodeType.String,modifiers:[],range:{start:{line:1,character:15},end:{line:1,character:20}},value:'test'}]};
8888

8989
astTypeExpectations(ast);
9090
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -95,7 +95,7 @@ describe('Compiler module', () => {
9595

9696
const tokens = tokenizeSyx('imports(ts,js) \'math\';');
9797
const ast = syxparser.parseTokens(tokens,'TEST_FILE');
98-
const stmt:ImportsStatement = {range:{start:{line:1,character:0},end:{line:1,character:20}},formats:['ts','js'],type:NodeType.Imports,modifiers:[],module:'math'};
98+
const stmt:ImportsStatement = {range:{start:{line:1,character:0},end:{line:1,character:21}},formats:['ts','js'],type:NodeType.Imports,modifiers:[],module:'math'};
9999

100100
astTypeExpectations(ast);
101101
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -106,7 +106,7 @@ describe('Compiler module', () => {
106106

107107
const tokens = tokenizeSyx('global randomizer {}');
108108
const ast = syxparser.parseTokens(tokens,'TEST_FILE');
109-
const stmt:GlobalStatement = {range:{start:{line:1,character:0},end:{line:1,character:19}},name:'randomizer',type:NodeType.Global,modifiers:[],body:[]};
109+
const stmt:GlobalStatement = {range:{start:{line:1,character:0},end:{line:1,character:20}},name:'randomizer',type:NodeType.Global,modifiers:[],body:[]};
110110

111111
astTypeExpectations(ast);
112112
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -117,7 +117,7 @@ describe('Compiler module', () => {
117117

118118
const tokens = tokenizeSyx('function randomizer <int> {}');
119119
const ast = syxparser.parseTokens(tokens,'TEST_FILE');
120-
const stmt:FunctionStatement = {range:{start:{line:1,character:0},end:{line:1,character:27}},name:'randomizer',type:NodeType.Function,modifiers:[],body:[],arguments:['int']};
120+
const stmt:FunctionStatement = {range:{start:{line:1,character:0},end:{line:1,character:28}},name:'randomizer',type:NodeType.Function,modifiers:[],body:[],arguments:['int']};
121121

122122
astTypeExpectations(ast);
123123
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);
@@ -128,7 +128,7 @@ describe('Compiler module', () => {
128128

129129
const tokens = tokenizeSyx('import \'./math\';');
130130
const ast = syxparser.parseTokens(tokens,'TEST_FILE');
131-
const stmt:ImportStatement = {range:{start:{line:1,character:0},end:{line:1,character:14}},type:NodeType.Import,modifiers:[],path:'./math'};
131+
const stmt:ImportStatement = {range:{start:{line:1,character:0},end:{line:1,character:15}},type:NodeType.Import,modifiers:[],path:'./math'};
132132

133133
astTypeExpectations(ast);
134134
expect(ast.body[0]).to.be.a('object').to.be.deep.equal(stmt);

0 commit comments

Comments
 (0)