// Copyright (c) 2020-2022 MathJax Consortium
// SPDX-License-Identifier: Apache-2.0
// Sources: ts/input/tex/mathtools/MathtoolsMethods.ts (MathLap), TexParser.ts.

package tex

import (
	

	
)

func ( *parser) ( string) ([]*mml.Node, error) {
	, ,  := .readBrackets(nil)
	if  != nil {
		if ,  := .(*Error);  && .ID == "MissingCloseBracket" {
			return nil, texError(.ID, "Could not find closing ']' for argument to \\%s", )
		}
		return nil, 
	}
	// ParseArg captures one argument after GetNext's JavaScript whitespace,
	// then parses it in a child TexParser with its own macro counter.
	for .pos < len(.source) && internalTextSpace(.peekRune()) {
		.consumeRune()
	}
	, ,  := .readArgumentAtCursor(, false)
	if  != nil {
		return nil, 
	}
	,  := .parseChild()
	if  != nil {
		return nil, 
	}
	 := setAttributes(node("mpadded", ), map[string]any{"width": 0})
	if strings.HasSuffix(, "llap") {
		.Attributes.Set("lspace", "-1width")
	} else if strings.HasSuffix(, "clap") {
		.Attributes.Set("lspace", "-.5width")
	}
	 := node("mstyle", )
	.Attributes.Set("data-cramped", strings.HasPrefix(, "cramped"))
	setMathtoolsDisplayLevel(, )
	return []*mml.Node{texAtom(, mml.TeXClassOrd)}, nil
}