We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b1168db commit 8f1e626Copy full SHA for 8f1e626
βsrc/parser/class.js
@@ -358,7 +358,7 @@ module.exports = {
358
this.next();
359
}
360
361
- if (this.peek() === "=") {
+ if (this.peekSkipComments() === "=") {
362
return [false, null];
363
364
@@ -386,6 +386,21 @@ module.exports = {
386
return [nullable, type];
387
},
388
389
+ peekSkipComments: function () {
390
+ const lexerState = this.lexer.getState();
391
+ let nextToken;
392
+
393
+ do {
394
+ nextToken = this.lexer.lex();
395
+ } while (
396
+ nextToken === this.tok.T_COMMENT ||
397
+ nextToken === this.tok.T_WHITESPACE
398
+ );
399
400
+ this.lexer.setState(lexerState);
401
+ return nextToken;
402
+ },
403
404
/*
405
* reading an interface
406
* ```ebnf
0 commit comments