// This file is part of the Luau programming language and is licensed under MIT License; see LICENSE.txt for details #include "Luau/Ast.h" #include "Luau/Cst.h" #include "Luau/Common.h" namespace Luau { int gCstRttiIndex = 0; CstExprConstantNumber::CstExprConstantNumber(const AstArray& value) : CstNode(CstClassIndex()) , value(value) { } CstExprConstantString::CstExprConstantString(AstArray sourceString, QuoteStyle quoteStyle, unsigned int blockDepth) : CstNode(CstClassIndex()) , sourceString(sourceString) , quoteStyle(quoteStyle) , blockDepth(blockDepth) { LUAU_ASSERT(blockDepth == 0 || quoteStyle == QuoteStyle::QuotedRaw); } CstExprCall::CstExprCall(std::optional openParens, std::optional closeParens, AstArray commaPositions) : CstNode(CstClassIndex()) , openParens(openParens) , closeParens(closeParens) , commaPositions(commaPositions) { } CstExprIndexExpr::CstExprIndexExpr(Position openBracketPosition, Position closeBracketPosition) : CstNode(CstClassIndex()) , openBracketPosition(openBracketPosition) , closeBracketPosition(closeBracketPosition) { } CstExprTable::CstExprTable(const AstArray& items) : CstNode(CstClassIndex()) , items(items) { } CstExprOp::CstExprOp(Position opPosition) : CstNode(CstClassIndex()) , opPosition(opPosition) { } CstExprIfElse::CstExprIfElse(Position thenPosition, Position elsePosition, bool isElseIf) : CstNode(CstClassIndex()) , thenPosition(thenPosition) , elsePosition(elsePosition) , isElseIf(isElseIf) { } CstExprInterpString::CstExprInterpString(AstArray> sourceStrings, AstArray stringPositions) : CstNode(CstClassIndex()) , sourceStrings(sourceStrings) , stringPositions(stringPositions) { } CstStatDo::CstStatDo(Position endPosition) : CstNode(CstClassIndex()) , endPosition(endPosition) { } CstStatRepeat::CstStatRepeat(Position untilPosition) : CstNode(CstClassIndex()) , untilPosition(untilPosition) { } CstStatReturn::CstStatReturn(AstArray commaPositions) : CstNode(CstClassIndex()) , commaPositions(commaPositions) { } CstStatLocal::CstStatLocal(AstArray varsCommaPositions, AstArray valuesCommaPositions) : CstNode(CstClassIndex()) , varsCommaPositions(varsCommaPositions) , valuesCommaPositions(valuesCommaPositions) { } CstStatFor::CstStatFor(Position equalsPosition, Position endCommaPosition, std::optional stepCommaPosition) : CstNode(CstClassIndex()) , equalsPosition(equalsPosition) , endCommaPosition(endCommaPosition) , stepCommaPosition(stepCommaPosition) { } CstStatForIn::CstStatForIn(AstArray varsCommaPositions, AstArray valuesCommaPositions) : CstNode(CstClassIndex()) , varsCommaPositions(varsCommaPositions) , valuesCommaPositions(valuesCommaPositions) { } CstStatAssign::CstStatAssign( AstArray varsCommaPositions, Position equalsPosition, AstArray valuesCommaPositions ) : CstNode(CstClassIndex()) , varsCommaPositions(varsCommaPositions) , equalsPosition(equalsPosition) , valuesCommaPositions(valuesCommaPositions) { } CstStatCompoundAssign::CstStatCompoundAssign(Position opPosition) : CstNode(CstClassIndex()) , opPosition(opPosition) { } CstStatLocalFunction::CstStatLocalFunction(Position functionKeywordPosition) : CstNode(CstClassIndex()) , functionKeywordPosition(functionKeywordPosition) { } CstTypeReference::CstTypeReference( std::optional prefixPointPosition, Position openParametersPosition, AstArray parametersCommaPositions, Position closeParametersPosition ) : CstNode(CstClassIndex()) , prefixPointPosition(prefixPointPosition) , openParametersPosition(openParametersPosition) , parametersCommaPositions(parametersCommaPositions) , closeParametersPosition(closeParametersPosition) { } CstTypeTable::CstTypeTable(AstArray items, bool isArray) : CstNode(CstClassIndex()) , items(items) , isArray(isArray) { } CstTypeTypeof::CstTypeTypeof(Position openPosition, Position closePosition) : CstNode(CstClassIndex()) , openPosition(openPosition) , closePosition(closePosition) { } CstTypeSingletonString::CstTypeSingletonString(AstArray sourceString, CstExprConstantString::QuoteStyle quoteStyle, unsigned int blockDepth) : CstNode(CstClassIndex()) , sourceString(sourceString) , quoteStyle(quoteStyle) , blockDepth(blockDepth) { LUAU_ASSERT(quoteStyle != CstExprConstantString::QuotedInterp); } } // namespace Luau