Merge pull request #18901 from overleaf/mj-math-mode-args

[lezer] Parse command arguments in math mode

GitOrigin-RevId: 85a35f412de4c7238d735253c2642066ebffb393
This commit is contained in:
Mathias Jakobsen
2024-06-19 08:04:16 +00:00
committed by Copybot
parent d2ae97427d
commit 9b1c703f6b
4 changed files with 54 additions and 24 deletions
@@ -74,14 +74,15 @@ export const enterNode = (
items.push(thisCommand)
} else if (
node.type.is('UnknownCommand') ||
node.type.is('MathCommand') ||
node.type.is('KnownCommand')
node.type.is('KnownCommand') ||
node.type.is('MathUnknownCommand') ||
node.type.is('MathKnownCommand')
) {
let commandNode: SyntaxNode | null = node.node
if (node.type.is('KnownCommand')) {
// KnownCommands are defined as
if (node.type.is('KnownCommand') || node.type.is('MathKnownCommand')) {
// (Math)KnownCommands are defined as
//
// KnownCommand {
// (Math)KnownCommand {
// CommandName {
// CommandCtrlSeq [args]
// }