Skip to content

Commit 9e4c621

Browse files
committed
1 parent 0fb96c5 commit 9e4c621

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/main/php/lang/ast/Tokens.class.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
* @test lang.ast.unittest.TokensTest
1111
*/
1212
class Tokens {
13-
const DELIMITERS = " \r\n\t'\$\"=,;.:?!(){}[]#+-*/|&^@%~<>";
13+
const DELIMITERS = " \r\n\t'\$\"`=,;.:?!(){}[]#+-*/|&^@%~<>";
1414
const OPERATORS = [
1515
'<' => ['<=>', '<<=', '<=', '<<', '<>', '<?'],
1616
'>' => ['>>=', '>=', '>>'],
@@ -101,7 +101,7 @@ public function iterator($language) {
101101
$line++;
102102
} else if ("\r" === $token || "\t" === $token || ' ' === $token) {
103103
// Skip over whitespace
104-
} else if ("'" === $token || '"' === $token) {
104+
} else if ("'" === $token || '"' === $token || '`' === $token) {
105105
$string= $token;
106106
$end= '\\'.$token;
107107
do {

src/test/php/lang/ast/unittest/parse/LiteralsTest.class.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ public function non_empty_string() {
5050
$this->assertParsed([new Literal('"Test"', self::LINE)], '"Test";');
5151
}
5252

53+
#[Test]
54+
public function exec_statement() {
55+
$this->assertParsed([new Literal('`ls -al`', self::LINE)], '`ls -al`;');
56+
}
57+
5358
#[Test, Values(['[];', ['array();']])]
5459
public function empty_array($declaration) {
5560
$this->assertParsed([new ArrayLiteral([], self::LINE)], $declaration);

0 commit comments

Comments
 (0)