Skip to content

Commit 2218a40

Browse files
committed
Add test of invalid __halt_compiler without args
All properties should be MissingTokens and non-null
1 parent 9143577 commit 2218a40

File tree

3 files changed

+66
-0
lines changed

3 files changed

+66
-0
lines changed

tests/cases/parser/haltCompiler8.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<?php
2+
__halt_compiler
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[
2+
{
3+
"kind": 0,
4+
"message": "'(' expected.",
5+
"start": 21,
6+
"length": 0
7+
},
8+
{
9+
"kind": 0,
10+
"message": "')' expected.",
11+
"start": 21,
12+
"length": 0
13+
},
14+
{
15+
"kind": 0,
16+
"message": "';' expected.",
17+
"start": 21,
18+
"length": 0
19+
}
20+
]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"SourceFileNode": {
3+
"statementList": [
4+
{
5+
"InlineHtml": {
6+
"scriptSectionEndTag": null,
7+
"text": null,
8+
"scriptSectionStartTag": {
9+
"kind": "ScriptSectionStartTag",
10+
"textLength": 6
11+
}
12+
}
13+
},
14+
{
15+
"HaltCompilerStatement": {
16+
"haltCompilerKeyword": {
17+
"kind": "HaltCompilerKeyword",
18+
"textLength": 15
19+
},
20+
"openParen": {
21+
"error": "MissingToken",
22+
"kind": "OpenParenToken",
23+
"textLength": 0
24+
},
25+
"closeParen": {
26+
"error": "MissingToken",
27+
"kind": "CloseParenToken",
28+
"textLength": 0
29+
},
30+
"semicolonOrCloseTag": {
31+
"error": "MissingToken",
32+
"kind": "SemicolonToken",
33+
"textLength": 0
34+
},
35+
"data": null
36+
}
37+
}
38+
],
39+
"endOfFileToken": {
40+
"kind": "EndOfFileToken",
41+
"textLength": 0
42+
}
43+
}
44+
}

0 commit comments

Comments
 (0)