* Handle a subscript or superscript with nice errors.
(name)
| 15083 | * Handle a subscript or superscript with nice errors. |
| 15084 | */ |
| 15085 | handleSupSubscript(name) { |
| 15086 | const symbolToken = this.nextToken; |
| 15087 | const symbol = symbolToken.text; |
| 15088 | this.consume(); |
| 15089 | this.consumeSpaces(); // ignore spaces before sup/subscript argument |
| 15090 | |
| 15091 | const group = this.parseGroup(name, false, Parser.SUPSUB_GREEDINESS); |
| 15092 | |
| 15093 | if (!group) { |
| 15094 | throw new ParseError("Expected group after '" + symbol + "'", symbolToken); |
| 15095 | } |
| 15096 | |
| 15097 | return group; |
| 15098 | } |
| 15099 | /** |
| 15100 | * Converts the textual input of an unsupported command into a text node |
| 15101 | * contained within a color node whose color is determined by errorColor |
no test coverage detected