MCPcopy
hub / github.com/4ian/GDevelop / skipWhitespaces

Method skipWhitespaces

GDevelop.js/scripts/generate-dts.mjs:122–139  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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)

Callers 2

readTypeMethod · 0.80
generate-dts.mjsFile · 0.80

Calls 2

skipUntilMethod · 0.95
warnMethod · 0.45

Tested by

no test coverage detected