Skip to content

Commit

Permalink
add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Selion05 committed Feb 24, 2021
1 parent 8b77c60 commit 4ca49ba
Show file tree
Hide file tree
Showing 8 changed files with 860 additions and 119 deletions.
2 changes: 1 addition & 1 deletion src/lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const lexer = function (engine) {
this.mode_eval = false;
this.asp_tags = false;
this.short_tags = false;
this.version = 704;
this.version = 800;
this.yyprevcol = 0;
this.keywords = {
__class__: this.tok.T_CLASS_C,
Expand Down
2 changes: 1 addition & 1 deletion src/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const parser = function (lexer, ast) {
this.token = null;
this.prev = null;
this.debug = false;
this.version = 704;
this.version = 800;
this.extractDoc = false;
this.extractTokens = false;
this.suppressErrors = false;
Expand Down
63 changes: 63 additions & 0 deletions test/snapshot/__snapshots__/call.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -793,6 +793,69 @@ Program {
}
`;

exports[`Test call nullsafepropertylookup (2) 1`] = `
Program {
"children": Array [
ExpressionStatement {
"expression": Call {
"arguments": Array [],
"kind": "call",
"what": PropertyLookup {
"kind": "nullsafepropertylookup",
"offset": Identifier {
"kind": "identifier",
"name": "call",
},
"what": PropertyLookup {
"kind": "nullsafepropertylookup",
"offset": Identifier {
"kind": "identifier",
"name": "property",
},
"what": Variable {
"curly": false,
"kind": "variable",
"name": "obj",
},
},
},
},
"kind": "expressionstatement",
},
],
"errors": Array [],
"kind": "program",
}
`;

exports[`Test call nullsafepropertylookup 1`] = `
Program {
"children": Array [
ExpressionStatement {
"expression": Call {
"arguments": Array [],
"kind": "call",
"what": PropertyLookup {
"kind": "nullsafepropertylookup",
"offset": Identifier {
"kind": "identifier",
"name": "call",
},
"what": Variable {
"curly": false,
"kind": "variable",
"name": "obj",
},
},
},
"kind": "expressionstatement",
},
],
"errors": Array [],
"kind": "program",
}
`;

exports[`Test call offsetlookup 1`] = `
Program {
"children": Array [
Expand Down
Loading

0 comments on commit 4ca49ba

Please sign in to comment.