Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed check op < is first token #2238

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/src/javascript/tokenizer.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var punct =
"= ! ? > < : / ^ - + * & % ~ |";

punct = punct.replace(/[-[\]{}()*+?.,\\^$|#]/g, "\\$&");
// ?. but not if followed by a number
// ?. but not if followed by a number
punct = '\\?\\.(?!\\d) ' + punct;
punct = punct.replace(/ /g, '|');

Expand Down Expand Up @@ -297,7 +297,7 @@ Tokenizer.prototype._read_non_javascript = function(c) {

this._input.back();

} else if (c === '<' && this._is_first_token()) {
} else if (c === '<') {
resulting_string = this.__patterns.html_comment_start.read();
if (resulting_string) {
while (this._input.hasNext() && !this._input.testChar(acorn.newline)) {
Expand Down
2 changes: 1 addition & 1 deletion python/jsbeautifier/javascript/tokenizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,7 @@ def _read_non_javascript(self, c):

self._input.back()

elif c == "<" and self._is_first_token():
elif c == "<":
if self._patterns.html_comment_start.read():
c = "<!--"
while self._input.hasNext() and not self._input.testChar(
Expand Down
Loading