| 1116 | } |
| 1117 | |
| 1118 | skipToRoot() { |
| 1119 | let searchPos = 0; |
| 1120 | while (searchPos < this.length) { |
| 1121 | const slashPos = this.content.indexOf('/', searchPos); |
| 1122 | if (slashPos === -1) break; |
| 1123 | |
| 1124 | // Check if this is a root node (/ followed by whitespace then {) |
| 1125 | let testPos = slashPos + 1; |
| 1126 | while (testPos < this.length && this.isWhitespace(this.content.charCodeAt(testPos))) { |
| 1127 | testPos++; |
| 1128 | } |
| 1129 | |
| 1130 | if (testPos < this.length && this.content.charCodeAt(testPos) === LBRACE) { |
| 1131 | this.pos = slashPos; |
| 1132 | return; |
| 1133 | } |
| 1134 | |
| 1135 | searchPos = slashPos + 1; |
| 1136 | } |
| 1137 | } |
| 1138 | |
| 1139 | parseNode() { |
| 1140 | this.skipWhitespace(); |