()
| 120 | } |
| 121 | |
| 122 | static skipWhitespaces() { |
| 123 | while (this.currentCharacterCode <= 32) this.parserPosition++; |
| 124 | // Comments go everywhere whitespaces go and must be skipped as if it were whitespace |
| 125 | if (this.currentCharacter === '/') { |
| 126 | this.parserPosition++; |
| 127 | if (this.currentCharacter === '/') { |
| 128 | // //-style comments |
| 129 | this.skipUntil('\n'); |
| 130 | } else if (this.currentCharacter === '*') { |
| 131 | // /* */-style comments |
| 132 | do { |
| 133 | this.skipUntil('*'); |
| 134 | } while (this.currentCharacter !== '/'); |
| 135 | this.parserPosition++; |
| 136 | } else console.warn(`Unexpected slash.`); |
| 137 | this.skipWhitespaces(); |
| 138 | } |
| 139 | } |
| 140 | /** @param {string} thisCharacter */ |
| 141 | static skipUntil(thisCharacter, skipOverIt = true) { |
| 142 | while (this.currentCharacter !== thisCharacter && !this.isDone) |
no test coverage detected