-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moved parsing of paragraph and line separators as valid string charac…
…ters in ES2019 parser
- Loading branch information
Showing
6 changed files
with
110 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,11 +9,28 @@ | |
*/ | ||
namespace Peast\Syntax\ES2019; | ||
|
||
use \Peast\Syntax\Utils; | ||
|
||
/** | ||
* ES2019 scanner. | ||
* | ||
* @author Marco Marchiò <[email protected]> | ||
*/ | ||
class Scanner extends \Peast\Syntax\ES2018\Scanner | ||
{ | ||
/** | ||
* Class constructor | ||
* | ||
* @param string $source Source code | ||
* @param string $encoding Source code encoding, if not specified it | ||
* will assume UTF-8 | ||
*/ | ||
function __construct($source, $encoding = null) | ||
{ | ||
parent::__construct($source, $encoding); | ||
|
||
//Allow paragraph and line separators in strings | ||
$this->stringsStopsLSM->remove(Utils::unicodeToUtf8(0x2028)); | ||
$this->stringsStopsLSM->remove(Utils::unicodeToUtf8(0x2029)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters