@typespec/prettier-plugin-typespec 1.9.0-dev.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1815 -1815
- package/dist/index.js.map +4 -4
- package/package.json +5 -6
package/dist/index.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../compiler/src/formatter/index.ts", "../../compiler/src/
|
|
4
|
-
"sourcesContent": ["import type { Parser, SupportLanguage } from \"prettier\";\nimport { Node } from \"../core/types.js\";\nimport { parse } from \"./parser.js\";\nimport { typespecPrinter } from \"./print/index.js\";\n\nexport const defaultOptions = {};\n\nexport const languages: SupportLanguage[] = [\n {\n name: \"TypeSpec\",\n parsers: [\"typespec\"],\n extensions: [\".tsp\"],\n vscodeLanguageIds: [\"typespec\"],\n },\n];\n\nconst TypeSpecParser: Parser = {\n parse,\n astFormat: \"typespec-format\",\n locStart(node: Node) {\n return node.pos;\n },\n locEnd(node: Node) {\n return node.end;\n },\n};\nexport const parsers = {\n typespec: TypeSpecParser,\n};\n\nexport const printers = {\n \"typespec-format\": typespecPrinter,\n};\n", "import { CharCode } from \"./charcode.js\";\nimport { getAnyExtensionFromPath } from \"./path-utils.js\";\nimport type { SourceFile, SourceFileKind } from \"./types.js\";\n\nexport function createSourceFile(text: string, path: string): SourceFile {\n let lineStarts: number[] | undefined = undefined;\n\n return {\n text,\n path,\n getLineStarts,\n getLineAndCharacterOfPosition,\n };\n\n function getLineStarts() {\n return (lineStarts = lineStarts ?? scanLineStarts(text));\n }\n\n function getLineAndCharacterOfPosition(position: number) {\n const starts = getLineStarts();\n\n let line = binarySearch(starts, position);\n\n // When binarySearch returns < 0 indicating that the value was not found, it\n // returns the bitwise complement of the index where the value would need to\n // be inserted to keep the array sorted. So flipping the bits back to this\n // positive index tells us what the line number would be if we were to\n // create a new line starting at the given position, and subtracting 1 from\n // that therefore gives us the line number we're after.\n if (line < 0) {\n line = ~line - 1;\n }\n\n return {\n line,\n character: position - starts[line],\n };\n }\n}\n\nexport function getSourceFileKindFromExt(path: string): SourceFileKind | undefined {\n const ext = getAnyExtensionFromPath(path);\n if (ext === \".js\" || ext === \".mjs\") {\n return \"js\";\n } else if (ext === \".tsp\") {\n return \"typespec\";\n } else {\n return undefined;\n }\n}\n\nfunction scanLineStarts(text: string): number[] {\n const starts = [];\n let start = 0;\n let pos = 0;\n\n while (pos < text.length) {\n const ch = text.charCodeAt(pos);\n pos++;\n switch (ch) {\n case CharCode.CarriageReturn:\n if (text.charCodeAt(pos) === CharCode.LineFeed) {\n pos++;\n }\n // fallthrough\n case CharCode.LineFeed:\n starts.push(start);\n start = pos;\n break;\n }\n }\n\n starts.push(start);\n return starts;\n}\n\n/**\n * Search sorted array of numbers for the given value. If found, return index\n * in array where value was found. If not found, return a negative number that\n * is the bitwise complement of the index where value would need to be inserted\n * to keep the array sorted.\n */\nfunction binarySearch(array: readonly number[], value: number) {\n let low = 0;\n let high = array.length - 1;\n while (low <= high) {\n const middle = low + ((high - low) >> 1);\n const v = array[middle];\n if (v < value) {\n low = middle + 1;\n } else if (v > value) {\n high = middle - 1;\n } else {\n return middle;\n }\n }\n\n return ~low;\n}\n", "import type { JSONSchemaType as AjvJSONSchemaType } from \"ajv\";\nimport type { ModuleResolutionResult } from \"../module-resolver/index.js\";\nimport type { YamlPathTarget, YamlScript } from \"../yaml/types.js\";\nimport type { Numeric } from \"./numeric.js\";\nimport type { Program } from \"./program.js\";\nimport type { TokenFlags } from \"./scanner.js\";\n\n// prettier-ignore\nexport type MarshalledValue<Value> = \nValue extends StringValue ? string\n : Value extends NumericValue ? number | Numeric\n : Value extends BooleanValue ? boolean\n : Value extends ObjectValue ? Record<string, unknown>\n : Value extends ArrayValue ? unknown[]\n : Value extends EnumValue ? EnumMember\n : Value extends NullValue ? null\n : Value extends ScalarValue ? Value\n : Value\n\n/**\n * Type System types\n */\n\nexport type DecoratorArgumentValue = Type | number | string | boolean;\n\nexport interface DecoratorArgument {\n value: Type | Value;\n /**\n * Marshalled value for use in Javascript.\n */\n jsValue:\n | Type\n | Value\n | Record<string, unknown>\n | unknown[]\n | string\n | number\n | boolean\n | Numeric\n | null;\n node?: Node;\n}\n\nexport interface DecoratorApplication {\n definition?: Decorator;\n decorator: DecoratorFunction;\n args: DecoratorArgument[];\n node?: DecoratorExpressionNode | AugmentDecoratorStatementNode;\n}\n\n/**\n * Signature for a decorator JS implementation function.\n * Use `@typespec/tspd` to generate an accurate signature from the `extern dec`\n */\nexport interface DecoratorFunction {\n (\n program: DecoratorContext,\n target: any,\n ...customArgs: any[]\n ): DecoratorValidatorCallbacks | void;\n namespace?: string;\n}\n\nexport type ValidatorFn = () => readonly Diagnostic[];\n\nexport interface DecoratorValidatorCallbacks {\n /**\n * Run validation after all decorators are run on the same type. Useful if trying to validate this decorator is compatible with other decorators without relying on the order they are applied.\n * @note This is meant for validation which means the type graph should be treated as readonly in this function.\n */\n readonly onTargetFinish?: ValidatorFn;\n\n /**\n * Run validation after everything is checked in the type graph. Useful when trying to get an overall view of the program.\n * @note This is meant for validation which means the type graph should be treated as readonly in this function.\n */\n readonly onGraphFinish?: ValidatorFn;\n}\n\nexport interface BaseType {\n readonly entityKind: \"Type\";\n kind: string;\n /** Node used to construct this type. If the node is undefined it means the type was dynamically built. With typekit for example. */\n node?: Node;\n instantiationParameters?: Type[];\n\n /**\n * If the type is currently being created.\n */\n creating?: true;\n\n /**\n * Reflect if a type has been finished(Decorators have been called).\n * There is multiple reasons a type might not be finished:\n * - a template declaration will not\n * - a template instance that argument that are still template parameters\n * - a template instance that is only partially instantiated(like a templated operation inside a templated interface)\n */\n isFinished: boolean;\n}\n\nexport interface DecoratedType {\n decorators: DecoratorApplication[];\n}\n\n/**\n * Union of all the types that implement TemplatedTypeBase\n */\nexport type TemplatedType = Model | Operation | Interface | Union | Scalar;\n\nexport interface TypeMapper {\n partial: boolean;\n getMappedType(type: TemplateParameter): Type | Value | IndeterminateEntity;\n args: readonly (Type | Value | IndeterminateEntity)[];\n /** @internal Node used to create this type mapper. */\n readonly source: {\n readonly node: Node;\n readonly mapper: TypeMapper | undefined;\n };\n /** @internal */\n map: Map<TemplateParameter, Type | Value | IndeterminateEntity>;\n}\n\nexport interface TemplatedTypeBase {\n templateMapper?: TypeMapper;\n templateNode?: Node;\n}\n\n/**\n * Represent every single entity that are part of the TypeSpec program. Those are composed of different elements:\n * - Types\n * - Values\n * - Value Constraints\n */\nexport type Entity = Type | Value | MixedParameterConstraint | IndeterminateEntity;\n\nexport type Type =\n | BooleanLiteral\n | Decorator\n | Enum\n | EnumMember\n | FunctionParameter\n | Interface\n | IntrinsicType\n | Model\n | ModelProperty\n | Namespace\n | NumericLiteral\n | Operation\n | Scalar\n | ScalarConstructor\n | StringLiteral\n | StringTemplate\n | StringTemplateSpan\n | TemplateParameter\n | Tuple\n | Union\n | UnionVariant;\n\nexport type StdTypes = {\n // Models\n Array: Model;\n Record: Model;\n} & Record<IntrinsicScalarName, Scalar>;\nexport type StdTypeName = keyof StdTypes;\n\nexport interface ObjectType extends BaseType {\n kind: \"Object\";\n properties: Record<string, Type>;\n}\n\nexport interface MixedParameterConstraint {\n readonly entityKind: \"MixedParameterConstraint\";\n readonly node?: UnionExpressionNode | Expression;\n\n /** Type constraints */\n readonly type?: Type;\n\n /** Expecting value */\n readonly valueType?: Type;\n}\n\n/** When an entity that could be used as a type or value has not figured out if it is a value or type yet. */\nexport interface IndeterminateEntity {\n readonly entityKind: \"Indeterminate\";\n readonly type:\n | StringLiteral\n | StringTemplate\n | NumericLiteral\n | BooleanLiteral\n | EnumMember\n | UnionVariant\n | NullType;\n}\n\nexport interface IntrinsicType extends BaseType {\n kind: \"Intrinsic\";\n name: \"ErrorType\" | \"void\" | \"never\" | \"unknown\" | \"null\";\n}\n\nexport interface ErrorType extends IntrinsicType {\n name: \"ErrorType\";\n}\n\nexport interface VoidType extends IntrinsicType {\n name: \"void\";\n}\n\nexport interface NeverType extends IntrinsicType {\n name: \"never\";\n}\n\nexport interface UnknownType extends IntrinsicType {\n name: \"unknown\";\n}\nexport interface NullType extends IntrinsicType {\n name: \"null\";\n}\n\nexport type IntrinsicScalarName =\n | \"bytes\"\n | \"numeric\"\n | \"integer\"\n | \"float\"\n | \"int64\"\n | \"int32\"\n | \"int16\"\n | \"int8\"\n | \"uint64\"\n | \"uint32\"\n | \"uint16\"\n | \"uint8\"\n | \"safeint\"\n | \"float32\"\n | \"float64\"\n | \"decimal\"\n | \"decimal128\"\n | \"string\"\n | \"plainDate\"\n | \"plainTime\"\n | \"utcDateTime\"\n | \"offsetDateTime\"\n | \"duration\"\n | \"boolean\"\n | \"url\";\n\nexport type NeverIndexer = {\n readonly key: NeverType;\n readonly value: undefined;\n};\n\nexport type ModelIndexer = {\n readonly key: Scalar;\n readonly value: Type;\n};\n\nexport interface ArrayModelType extends Model {\n indexer: { key: Scalar; value: Type };\n}\n\nexport interface RecordModelType extends Model {\n indexer: { key: Scalar; value: Type };\n}\n\nexport interface Model extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Model\";\n name: string;\n node?: ModelStatementNode | ModelExpressionNode | IntersectionExpressionNode | ObjectLiteralNode;\n namespace?: Namespace;\n indexer?: ModelIndexer;\n\n /**\n * The properties of the model.\n *\n * Properties are ordered in the order that they appear in source.\n * Properties obtained via `model is` appear before properties defined in\n * the model body. Properties obtained via `...` are inserted where the\n * spread appears in source.\n *\n * Properties inherited via `model extends` are not included. Use\n * {@link walkPropertiesInherited} to enumerate all properties in the\n * inheritance hierarchy.\n */\n properties: RekeyableMap<string, ModelProperty>;\n\n /**\n * Model this model extends. This represent inheritance.\n */\n baseModel?: Model;\n\n /**\n * Direct children. This is the reverse relation of {@link baseModel}\n */\n derivedModels: Model[];\n\n /**\n * The model that is referenced via `model is`.\n */\n sourceModel?: Model;\n\n /**\n * Models that were used to build this model. This include any model referenced in `model is`, `...` or when intersecting models.\n */\n sourceModels: SourceModel[];\n\n /**\n * Late-bound symbol of this model type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface SourceModel {\n /**\n * How was this model used.\n * - is: `model A is B`\n * - spread: `model A {...B}`\n * - intersection: `alias A = B & C`\n */\n readonly usage: \"is\" | \"spread\" | \"intersection\";\n /** Source model */\n readonly model: Model;\n\n /** Node where this source model was referenced. */\n readonly node?: Node;\n}\n\nexport interface ModelProperty extends BaseType, DecoratedType {\n kind: \"ModelProperty\";\n node?: ModelPropertyNode | ModelSpreadPropertyNode | ObjectLiteralPropertyNode;\n name: string;\n type: Type;\n // when spread or intersection operators make new property types,\n // this tracks the property we copied from.\n sourceProperty?: ModelProperty;\n optional: boolean;\n defaultValue?: Value;\n model?: Model;\n}\n\n//#region Values\nexport type Value =\n | ScalarValue\n | NumericValue\n | StringValue\n | BooleanValue\n | ObjectValue\n | ArrayValue\n | EnumValue\n | NullValue;\n\n/** @internal */\nexport type ValueWithTemplate = Value | TemplateValue;\n\ninterface BaseValue {\n readonly entityKind: \"Value\";\n readonly valueKind: string;\n /**\n * Represent the storage type of a value.\n * @example\n * ```tsp\n * const a = \"hello\"; // Type here would be \"hello\"\n * const b: string = a; // Type here would be string\n * const c: string | int32 = b; // Type here would be string | int32\n * ```\n */\n type: Type;\n}\n\nexport interface ObjectValue extends BaseValue {\n valueKind: \"ObjectValue\";\n node?: ObjectLiteralNode;\n properties: Map<string, ObjectValuePropertyDescriptor>;\n}\n\nexport interface ObjectValuePropertyDescriptor {\n node?: ObjectLiteralPropertyNode;\n name: string;\n value: Value;\n}\n\nexport interface ArrayValue extends BaseValue {\n valueKind: \"ArrayValue\";\n node?: ArrayLiteralNode;\n values: Value[];\n}\n\nexport interface ScalarValue extends BaseValue {\n valueKind: \"ScalarValue\";\n scalar: Scalar;\n value: { name: string; args: Value[] };\n}\n\nexport interface NumericValue extends BaseValue {\n valueKind: \"NumericValue\";\n scalar: Scalar | undefined;\n value: Numeric;\n}\nexport interface StringValue extends BaseValue {\n valueKind: \"StringValue\";\n scalar: Scalar | undefined;\n value: string;\n}\nexport interface BooleanValue extends BaseValue {\n valueKind: \"BooleanValue\";\n scalar: Scalar | undefined;\n value: boolean;\n}\nexport interface EnumValue extends BaseValue {\n valueKind: \"EnumValue\";\n value: EnumMember;\n}\nexport interface NullValue extends BaseValue {\n valueKind: \"NullValue\";\n value: null;\n}\n\n/**\n * This is an internal type that represent a value while in a template declaration.\n * This type should currently never be exposed on the type graph(unlike TemplateParameter).\n * @internal\n */\nexport interface TemplateValue extends BaseValue {\n valueKind: \"TemplateValue\";\n}\n\n//#endregion Values\n\nexport interface Scalar extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Scalar\";\n name: string;\n node?: ScalarStatementNode;\n /**\n * Namespace the scalar was defined in.\n */\n namespace?: Namespace;\n\n /**\n * Scalar this scalar extends.\n */\n baseScalar?: Scalar;\n\n /**\n * Direct children. This is the reverse relation of @see baseScalar\n */\n derivedScalars: Scalar[];\n\n constructors: Map<string, ScalarConstructor>;\n /**\n * Late-bound symbol of this scalar type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface ScalarConstructor extends BaseType {\n kind: \"ScalarConstructor\";\n node?: ScalarConstructorNode;\n name: string;\n scalar: Scalar;\n parameters: SignatureFunctionParameter[];\n}\n\nexport interface Interface extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Interface\";\n name: string;\n node?: InterfaceStatementNode;\n namespace?: Namespace;\n\n /**\n * The interfaces that provide additional operations via `interface extends`.\n *\n * Note that despite the same `extends` keyword in source form, this is a\n * different semantic relationship than the one from {@link Model} to\n * {@link Model.baseModel}. Operations from extended interfaces are copied\n * into {@link Interface.operations}.\n */\n sourceInterfaces: Interface[];\n\n /**\n * The operations of the interface.\n *\n * Operations are ordered in the order that they appear in the source.\n * Operations obtained via `interface extends` appear before operations\n * declared in the interface body.\n */\n operations: RekeyableMap<string, Operation>;\n\n /**\n * Late-bound symbol of this interface type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface Enum extends BaseType, DecoratedType {\n kind: \"Enum\";\n name: string;\n node?: EnumStatementNode;\n namespace?: Namespace;\n\n /**\n * The members of the enum.\n *\n * Members are ordered in the order that they appear in source. Members\n * obtained via `...` are inserted where the spread appears in source.\n */\n members: RekeyableMap<string, EnumMember>;\n\n /**\n * Late-bound symbol of this enum type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface EnumMember extends BaseType, DecoratedType {\n kind: \"EnumMember\";\n name: string;\n enum: Enum;\n node?: EnumMemberNode;\n value?: string | number;\n /**\n * when spread operators make new enum members,\n * this tracks the enum member we copied from.\n */\n sourceMember?: EnumMember;\n}\n\nexport interface Operation extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Operation\";\n node?: OperationStatementNode;\n name: string;\n namespace?: Namespace;\n interface?: Interface;\n parameters: Model;\n returnType: Type;\n\n /**\n * The operation that is referenced via `op is`.\n */\n sourceOperation?: Operation;\n}\n\nexport interface Namespace extends BaseType, DecoratedType {\n kind: \"Namespace\";\n name: string;\n namespace?: Namespace;\n node?: NamespaceStatementNode | JsNamespaceDeclarationNode;\n\n /**\n * The models in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n models: Map<string, Model>;\n\n /**\n * The scalars in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n scalars: Map<string, Scalar>;\n\n /**\n * The operations in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n operations: Map<string, Operation>;\n\n /**\n * The sub-namespaces in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n namespaces: Map<string, Namespace>;\n\n /**\n * The interfaces in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n interfaces: Map<string, Interface>;\n\n /**\n * The enums in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n enums: Map<string, Enum>;\n\n /**\n * The unions in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n unions: Map<string, Union>;\n\n /**\n * The decorators declared in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n decoratorDeclarations: Map<string, Decorator>;\n}\n\nexport type LiteralType = StringLiteral | NumericLiteral | BooleanLiteral;\n\nexport interface StringLiteral extends BaseType {\n kind: \"String\";\n node?: StringLiteralNode;\n value: string;\n}\n\nexport interface NumericLiteral extends BaseType {\n kind: \"Number\";\n node?: NumericLiteralNode;\n value: number;\n numericValue: Numeric;\n valueAsString: string;\n}\n\nexport interface BooleanLiteral extends BaseType {\n kind: \"Boolean\";\n node?: BooleanLiteralNode;\n value: boolean;\n}\n\nexport interface StringTemplate extends BaseType {\n kind: \"StringTemplate\";\n /** If the template can be render as as string this is the string value */\n stringValue?: string;\n node?: StringTemplateExpressionNode;\n spans: StringTemplateSpan[];\n}\n\nexport type StringTemplateSpan = StringTemplateSpanLiteral | StringTemplateSpanValue;\n\nexport interface StringTemplateSpanLiteral extends BaseType {\n kind: \"StringTemplateSpan\";\n node?: StringTemplateHeadNode | StringTemplateMiddleNode | StringTemplateTailNode;\n isInterpolated: false;\n type: StringLiteral;\n}\n\nexport interface StringTemplateSpanValue extends BaseType {\n kind: \"StringTemplateSpan\";\n node?: Expression;\n isInterpolated: true;\n type: Type;\n}\n\nexport interface Tuple extends BaseType {\n kind: \"Tuple\";\n node?: TupleExpressionNode | ArrayLiteralNode;\n values: Type[];\n}\n\nexport interface Union extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Union\";\n name?: string;\n node?: UnionExpressionNode | UnionStatementNode;\n namespace?: Namespace;\n\n /**\n * The variants of the union.\n *\n * Variants are ordered in order that they appear in source.\n */\n variants: RekeyableMap<string | symbol, UnionVariant>;\n\n expression: boolean;\n\n /**\n * Late-bound symbol of this interface type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface UnionVariant extends BaseType, DecoratedType {\n kind: \"UnionVariant\";\n name: string | symbol;\n node?: UnionVariantNode | undefined;\n type: Type;\n union: Union;\n}\n\n/**\n * This is a type you should never see in the program.\n * If you do you might be missing a `isTemplateDeclaration` check to exclude that type.\n * Working with template declaration is not something that is currently supported.\n *\n * @experimental\n */\nexport interface TemplateParameter extends BaseType {\n kind: \"TemplateParameter\";\n /** @internal */\n node: TemplateParameterDeclarationNode;\n /** @internal */\n constraint?: MixedParameterConstraint;\n /** @internal */\n default?: Type | Value | IndeterminateEntity;\n}\n\nexport interface Decorator extends BaseType {\n kind: \"Decorator\";\n node?: DecoratorDeclarationStatementNode;\n name: `@${string}`;\n namespace: Namespace;\n target: MixedFunctionParameter;\n parameters: MixedFunctionParameter[];\n implementation: (...args: unknown[]) => void;\n}\n\nexport interface FunctionParameterBase extends BaseType {\n kind: \"FunctionParameter\";\n node?: FunctionParameterNode;\n name: string;\n optional: boolean;\n rest: boolean;\n}\n\n/** Represent a function parameter that could accept types or values in the TypeSpec program. */\nexport interface MixedFunctionParameter extends FunctionParameterBase {\n mixed: true;\n type: MixedParameterConstraint;\n}\n/** Represent a function parameter that represent the parameter signature(i.e the type would be the type of the value passed) */\nexport interface SignatureFunctionParameter extends FunctionParameterBase {\n mixed: false;\n type: Type;\n}\nexport type FunctionParameter = MixedFunctionParameter | SignatureFunctionParameter;\n\nexport interface Sym {\n readonly flags: SymbolFlags;\n\n /**\n * Nodes which contribute to this declaration, present if SymbolFlags.Declaration is set.\n */\n readonly declarations: readonly Node[];\n\n /**\n * Node which resulted in this symbol, present if SymbolFlags.Declaration is not set.\n */\n readonly node: Node;\n\n /**\n * The name of the symbol\n */\n readonly name: string;\n\n /**\n * A unique identifier for this symbol. Used to look up the symbol links.\n */\n readonly id?: number;\n\n /**\n * The symbol containing this symbol, if any. E.g. for things declared in\n * a namespace, this refers to the namespace.\n */\n readonly parent?: Sym;\n\n /**\n * Externally visible symbols contained inside this symbol. E.g. all declarations\n * in a namespace, or members of an enum.\n */\n readonly exports?: SymbolTable;\n\n /**\n * Symbols for members of this symbol which must be referenced off the parent symbol\n * and cannot be referenced by other means (i.e. by unqualified lookup of the symbol\n * name).\n */\n readonly members?: SymbolTable;\n\n /**\n * Symbol table\n */\n readonly metatypeMembers?: SymbolTable;\n\n /**\n * For using symbols, this is the used symbol.\n */\n readonly symbolSource?: Sym;\n\n /**\n * For late-bound symbols, this is the type referenced by the symbol.\n */\n readonly type?: Type;\n\n /**\n * For decorator and function symbols, this is the JS function implementation.\n */\n readonly value?: (...args: any[]) => any;\n}\n\nexport interface SymbolLinks {\n type?: Type;\n\n /** For types that can be instanitated this is the type of the declaration */\n declaredType?: Type;\n /** For types that can be instanitated those are the types per instantiation */\n instantiations?: TypeInstantiationMap;\n\n /** For const statements the value of the const */\n value?: Value | null;\n\n /**\n * When a symbol contains unknown members, symbol lookup during\n * name resolution should always return unknown if it can't definitely\n * find a member.\n */\n hasUnknownMembers?: boolean;\n\n /**\n * True if we have completed the early binding of member symbols for this model during\n * the name resolution phase.\n */\n membersBound?: boolean;\n\n /**\n * The symbol aliased by an alias symbol. When present, guaranteed to be a\n * non-alias symbol. Will not be present when the name resolver could not\n * determine a symbol for the alias, e.g. when it is a computed type.\n */\n aliasedSymbol?: Sym;\n\n /**\n * The result of resolving the aliased reference. When resolved, aliasedSymbol\n * will contain the resolved symbol. Otherwise, aliasedSymbol may be present\n * if the alias is a type literal with a symbol, otherwise it will be\n * undefined.\n */\n aliasResolutionResult?: ResolutionResultFlags;\n\n // TODO: any better idea?\n aliasResolutionIsTemplate?: boolean;\n\n /**\n * The symbol for the constraint of a type parameter. Will not be present when\n * the name resolver could not determine a symbol for the constraint, e.g.\n * when it is a computed type.\n */\n constraintSymbol?: Sym;\n\n /**\n * The result of resolving the type parameter constraint. When resolved,\n * constraintSymbol will contain the resolved symbol. Otherwise,\n * constraintSymbol may be present if the constraint is a type literal with a\n * symbol, otherwise it will be undefined.\n */\n constraintResolutionResult?: ResolutionResultFlags;\n}\n\nexport interface ResolutionResult {\n resolutionResult: ResolutionResultFlags;\n isTemplateInstantiation?: boolean;\n resolvedSymbol: Sym | undefined;\n finalSymbol: Sym | undefined;\n ambiguousSymbols?: Sym[];\n}\n\nexport interface NodeLinks {\n /** the result of type checking this node */\n resolvedType?: Type;\n\n /**The syntax symbol resolved by this node. */\n resolvedSymbol?: Sym;\n\n /** If the resolvedSymbol is an alias point to the symbol the alias reference(recursively), otherwise is the same as resolvedSymbol */\n finalSymbol?: Sym | undefined;\n\n /**\n * If the link involve template argument.\n * Note that this only catch if template arguments are used. If referencing the default instance(e.g Foo for Foo<string = \"abc\">) this will not be set to true.\n * This is by design as the symbol reference has different meaning depending on the context:\n * - For augment decorator it would reference the template declaration\n * - For type references it would reference the default instance.\n */\n isTemplateInstantiation?: boolean;\n\n /**\n * The result of resolution of this reference node.\n *\n * When the the result is `Resolved`, `resolvedSymbol` contains the result.\n **/\n resolutionResult?: ResolutionResultFlags;\n\n /** If the resolution result is Ambiguous list of symbols that are */\n ambiguousSymbols?: Sym[];\n}\n\nexport enum ResolutionResultFlags {\n None = 0,\n Resolved = 1 << 1,\n Unknown = 1 << 2,\n Ambiguous = 1 << 3,\n NotFound = 1 << 4,\n\n ResolutionFailed = Unknown | Ambiguous | NotFound,\n}\n\n/**\n * @hidden bug in typedoc\n */\nexport interface SymbolTable extends ReadonlyMap<string, Sym> {\n /**\n * Duplicate\n */\n readonly duplicates: ReadonlyMap<Sym, ReadonlySet<Sym>>;\n}\n\nexport interface MutableSymbolTable extends SymbolTable {\n set(key: string, value: Sym): void;\n\n /**\n * Put the symbols in the source table into this table.\n * @param source table to copy\n * @param parentSym Parent symbol that the source symbol should update to.\n */\n include(source: SymbolTable, parentSym?: Sym): void;\n}\n\n// prettier-ignore\nexport const enum SymbolFlags {\n None = 0,\n Model = 1 << 1,\n Scalar = 1 << 2,\n Operation = 1 << 3,\n Enum = 1 << 4,\n Interface = 1 << 5,\n Union = 1 << 6,\n Alias = 1 << 7,\n Namespace = 1 << 8,\n Decorator = 1 << 9,\n TemplateParameter = 1 << 10,\n Function = 1 << 11,\n FunctionParameter = 1 << 12,\n Using = 1 << 13,\n DuplicateUsing = 1 << 14,\n SourceFile = 1 << 15,\n Member = 1 << 16,\n Const = 1 << 17,\n\n\n /**\n * A symbol which represents a declaration. Such symbols will have at least\n * one entry in the `declarations[]` array referring to a node with an `id`.\n * \n * Symbols which do not represent declarations \n */\n Declaration = 1 << 20,\n\n Implementation = 1 << 21,\n \n /**\n * A symbol which was late-bound, in which case, the type referred to\n * by this symbol is stored directly in the symbol.\n */\n LateBound = 1 << 22,\n\n ExportContainer = Namespace | SourceFile,\n /**\n * Symbols whose members will be late bound (and stored on the type)\n */\n MemberContainer = Model | Enum | Union | Interface | Scalar,\n}\n\n/**\n * Maps type arguments to instantiated type.\n */\nexport interface TypeInstantiationMap {\n get(args: readonly (Type | Value | IndeterminateEntity)[]): Type | undefined;\n set(args: readonly (Type | Value | IndeterminateEntity)[], type: Type): void;\n}\n\n/**\n * A map where keys can be changed without changing enumeration order.\n * @hidden bug in typedoc\n */\nexport interface RekeyableMap<K, V> extends Map<K, V> {\n /**\n * Change the given key without impacting enumeration order.\n *\n * @param existingKey Existing key\n * @param newKey New key\n * @returns boolean if updated successfully.\n */\n rekey(existingKey: K, newKey: K): boolean;\n}\n\n/**\n * AST types\n */\nexport enum SyntaxKind {\n TypeSpecScript,\n JsSourceFile,\n ImportStatement,\n Identifier,\n AugmentDecoratorStatement,\n DecoratorExpression,\n DirectiveExpression,\n MemberExpression,\n NamespaceStatement,\n UsingStatement,\n OperationStatement,\n OperationSignatureDeclaration,\n OperationSignatureReference,\n ModelStatement,\n ModelExpression,\n ModelProperty,\n ModelSpreadProperty,\n ScalarStatement,\n InterfaceStatement,\n UnionStatement,\n UnionVariant,\n EnumStatement,\n EnumMember,\n EnumSpreadMember,\n AliasStatement,\n DecoratorDeclarationStatement,\n FunctionDeclarationStatement,\n FunctionParameter,\n UnionExpression,\n IntersectionExpression,\n TupleExpression,\n ArrayExpression,\n StringLiteral,\n NumericLiteral,\n BooleanLiteral,\n StringTemplateExpression,\n StringTemplateHead,\n StringTemplateMiddle,\n StringTemplateTail,\n StringTemplateSpan,\n ExternKeyword,\n VoidKeyword,\n NeverKeyword,\n UnknownKeyword,\n ValueOfExpression,\n TypeReference,\n TemplateParameterDeclaration,\n EmptyStatement,\n InvalidStatement,\n LineComment,\n BlockComment,\n Doc,\n DocText,\n DocParamTag,\n DocPropTag,\n DocReturnsTag,\n DocErrorsTag,\n DocTemplateTag,\n DocUnknownTag,\n Return,\n JsNamespaceDeclaration,\n TemplateArgument,\n TypeOfExpression,\n ObjectLiteral,\n ObjectLiteralProperty,\n ObjectLiteralSpreadProperty,\n ArrayLiteral,\n ConstStatement,\n CallExpression,\n ScalarConstructor,\n}\n\nexport const enum NodeFlags {\n None = 0,\n /**\n * If this is set, the DescendantHasError bit can be trusted. If this not set,\n * children need to be visited still to see if DescendantHasError should be\n * set.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n DescendantErrorsExamined = 1 << 0,\n\n /**\n * Indicates that a parse error was associated with this specific node.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n ThisNodeHasError = 1 << 1,\n\n /**\n * Indicates that a child of this node (or one of its children,\n * transitively) has a parse error.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n DescendantHasError = 1 << 2,\n\n /**\n * Indicates that a node was created synthetically and therefore may not be parented.\n */\n Synthetic = 1 << 3,\n}\n\nexport interface BaseNode extends TextRange {\n readonly kind: SyntaxKind;\n readonly parent?: Node;\n readonly directives?: readonly DirectiveExpressionNode[];\n readonly docs?: readonly DocNode[];\n readonly flags: NodeFlags;\n /**\n * Could be undefined but making this optional creates a lot of noise. In practice,\n * you will likely only access symbol in cases where you know the node has a symbol.\n * @internal\n */\n readonly symbol: Sym;\n /** Unique id across the process used to look up NodeLinks */\n _id?: number;\n}\n\nexport interface TemplateDeclarationNode {\n readonly templateParameters: readonly TemplateParameterDeclarationNode[];\n readonly templateParametersRange: TextRange;\n readonly locals?: SymbolTable;\n}\n\n/**\n * owner node and other related information according to the position\n */\nexport interface PositionDetail {\n readonly node: Node | undefined;\n readonly position: number;\n readonly char: number;\n readonly preChar: number;\n readonly nextChar: number;\n readonly inTrivia: boolean;\n\n /**\n * if the position is in a trivia, return the start position of the trivia containing the position\n * if the position is not a trivia, return the start position of the trivia before the text(identifier code) containing the position\n *\n * Please be aware that this may not be the pre node in the tree because some non-trivia char is ignored in the tree but will counted here\n *\n * also comments are considered as trivia\n */\n readonly triviaStartPosition: number;\n /**\n * if the position is in a trivia, return the end position (exclude as other 'end' means) of the trivia containing the position\n * if the position is not a trivia, return the end position (exclude as other 'end' means) of the trivia after the node containing the position\n *\n * Please be aware that this may not be the next node in the tree because some non-trivia char is ignored in the tree but will considered here\n *\n * also comments are considered as trivia\n */\n readonly triviaEndPosition: number;\n /** get the PositionDetail of positionBeforeTrivia */\n readonly getPositionDetailBeforeTrivia: () => PositionDetail;\n /** get the PositionDetail of positionAfterTrivia */\n readonly getPositionDetailAfterTrivia: () => PositionDetail;\n}\n\nexport type Node =\n | TypeSpecScriptNode\n | JsSourceFileNode\n | JsNamespaceDeclarationNode\n | TemplateArgumentNode\n | TemplateParameterDeclarationNode\n | ModelPropertyNode\n | UnionVariantNode\n | OperationStatementNode\n | OperationSignatureDeclarationNode\n | OperationSignatureReferenceNode\n | EnumMemberNode\n | EnumSpreadMemberNode\n | ModelSpreadPropertyNode\n | DecoratorExpressionNode\n | DirectiveExpressionNode\n | Statement\n | Expression\n | FunctionParameterNode\n | StringTemplateSpanNode\n | StringTemplateHeadNode\n | StringTemplateMiddleNode\n | StringTemplateTailNode\n | Modifier\n | DocNode\n | DocContent\n | DocTag\n | ReferenceExpression\n | ObjectLiteralNode\n | ObjectLiteralPropertyNode\n | ObjectLiteralSpreadPropertyNode\n | ScalarConstructorNode\n | ArrayLiteralNode;\n\n/**\n * Node that can be used as template\n */\nexport type TemplateableNode =\n | ModelStatementNode\n | ScalarStatementNode\n | AliasStatementNode\n | InterfaceStatementNode\n | OperationStatementNode\n | UnionStatementNode;\n\n/**\n * Node types that can have referencable members\n */\nexport type MemberContainerNode =\n | ModelStatementNode\n | ModelExpressionNode\n | InterfaceStatementNode\n | EnumStatementNode\n | UnionStatementNode\n | IntersectionExpressionNode\n | ScalarStatementNode;\n\nexport type MemberNode =\n | ModelPropertyNode\n | EnumMemberNode\n | OperationStatementNode\n | UnionVariantNode\n | ScalarConstructorNode;\n\nexport type MemberContainerType = Model | Enum | Interface | Union | Scalar;\n\n/**\n * Type that can be used as members of a container type.\n */\nexport type MemberType = ModelProperty | EnumMember | Operation | UnionVariant | ScalarConstructor;\n\nexport type Comment = LineComment | BlockComment;\n\nexport interface LineComment extends TextRange {\n readonly kind: SyntaxKind.LineComment;\n}\nexport interface BlockComment extends TextRange {\n readonly kind: SyntaxKind.BlockComment;\n /** If that comment was parsed as a doc comment. If parserOptions.docs=false this will always be false. */\n readonly parsedAsDocs?: boolean;\n}\n\nexport interface ParseOptions {\n /** When true, collect comment ranges in {@link TypeSpecScriptNode.comments}. */\n readonly comments?: boolean;\n /** When true, parse doc comments into {@link Node.docs}. */\n readonly docs?: boolean;\n}\n\nexport interface TypeSpecScriptNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.TypeSpecScript;\n readonly statements: readonly Statement[];\n readonly file: SourceFile;\n readonly inScopeNamespaces: readonly NamespaceStatementNode[]; // namespaces that declarations in this file belong to\n readonly namespaces: NamespaceStatementNode[]; // list of namespaces in this file (initialized during binding)\n readonly usings: readonly UsingStatementNode[];\n readonly comments: readonly Comment[];\n readonly parseDiagnostics: readonly Diagnostic[];\n readonly printable: boolean; // If this ast tree can safely be printed/formatted.\n readonly locals: SymbolTable;\n readonly parseOptions: ParseOptions; // Options used to parse this file\n}\n\nexport type Statement =\n | ImportStatementNode\n | ModelStatementNode\n | ScalarStatementNode\n | NamespaceStatementNode\n | InterfaceStatementNode\n | UnionStatementNode\n | UsingStatementNode\n | EnumStatementNode\n | AliasStatementNode\n | OperationStatementNode\n | DecoratorDeclarationStatementNode\n | FunctionDeclarationStatementNode\n | AugmentDecoratorStatementNode\n | ConstStatementNode\n | CallExpressionNode\n | EmptyStatementNode\n | InvalidStatementNode;\n\nexport interface DeclarationNode {\n readonly id: IdentifierNode;\n}\n\nexport type Declaration =\n | ModelStatementNode\n | ScalarStatementNode\n | InterfaceStatementNode\n | UnionStatementNode\n | NamespaceStatementNode\n | OperationStatementNode\n | TemplateParameterDeclarationNode\n | EnumStatementNode\n | AliasStatementNode\n | ConstStatementNode\n | DecoratorDeclarationStatementNode\n | FunctionDeclarationStatementNode;\n\nexport type ScopeNode =\n | NamespaceStatementNode\n | ModelStatementNode\n | InterfaceStatementNode\n | AliasStatementNode\n | TypeSpecScriptNode\n | JsSourceFileNode;\n\nexport interface ImportStatementNode extends BaseNode {\n readonly kind: SyntaxKind.ImportStatement;\n readonly path: StringLiteralNode;\n readonly parent?: TypeSpecScriptNode;\n}\n\nexport interface IdentifierNode extends BaseNode {\n readonly kind: SyntaxKind.Identifier;\n readonly sv: string;\n}\n\nexport interface DecoratorExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.DecoratorExpression;\n readonly target: IdentifierNode | MemberExpressionNode;\n readonly arguments: readonly Expression[];\n}\n\nexport interface AugmentDecoratorStatementNode extends BaseNode {\n readonly kind: SyntaxKind.AugmentDecoratorStatement;\n readonly target: IdentifierNode | MemberExpressionNode;\n readonly targetType: TypeReferenceNode;\n readonly arguments: readonly Expression[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface DirectiveExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.DirectiveExpression;\n readonly target: IdentifierNode;\n readonly arguments: readonly DirectiveArgument[];\n}\n\nexport type DirectiveArgument = StringLiteralNode | IdentifierNode;\n\nexport type Expression =\n | ArrayExpressionNode\n | MemberExpressionNode\n | ModelExpressionNode\n | ObjectLiteralNode\n | ArrayLiteralNode\n | TupleExpressionNode\n | UnionExpressionNode\n | IntersectionExpressionNode\n | TypeReferenceNode\n | ValueOfExpressionNode\n | TypeOfExpressionNode\n | CallExpressionNode\n | StringLiteralNode\n | NumericLiteralNode\n | BooleanLiteralNode\n | StringTemplateExpressionNode\n | VoidKeywordNode\n | NeverKeywordNode\n | AnyKeywordNode;\n\nexport type ReferenceExpression =\n | TypeReferenceNode\n | MemberExpressionNode\n | IdentifierNode\n | VoidKeywordNode\n | NeverKeywordNode;\n\nexport interface MemberExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.MemberExpression;\n readonly id: IdentifierNode;\n readonly base: MemberExpressionNode | IdentifierNode;\n readonly selector: \".\" | \"::\";\n}\n\nexport interface NamespaceStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.NamespaceStatement;\n readonly statements?: readonly Statement[] | NamespaceStatementNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly locals?: SymbolTable;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UsingStatementNode extends BaseNode {\n readonly kind: SyntaxKind.UsingStatement;\n readonly name: IdentifierNode | MemberExpressionNode;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface OperationSignatureDeclarationNode extends BaseNode {\n readonly kind: SyntaxKind.OperationSignatureDeclaration;\n readonly parameters: ModelExpressionNode;\n readonly returnType: Expression;\n}\n\nexport interface OperationSignatureReferenceNode extends BaseNode {\n readonly kind: SyntaxKind.OperationSignatureReference;\n readonly baseOperation: TypeReferenceNode;\n}\n\nexport type OperationSignature =\n | OperationSignatureDeclarationNode\n | OperationSignatureReferenceNode;\n\nexport interface OperationStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.OperationStatement;\n readonly signature: OperationSignature;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode | InterfaceStatementNode;\n}\n\nexport interface ModelStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.ModelStatement;\n readonly properties: readonly (ModelPropertyNode | ModelSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n readonly extends?: Expression;\n readonly is?: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ScalarStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.ScalarStatement;\n readonly extends?: TypeReferenceNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly members: readonly ScalarConstructorNode[];\n readonly bodyRange: TextRange;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ScalarConstructorNode extends BaseNode {\n readonly kind: SyntaxKind.ScalarConstructor;\n readonly id: IdentifierNode;\n readonly parameters: FunctionParameterNode[];\n readonly parent?: ScalarStatementNode;\n}\n\nexport interface InterfaceStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.InterfaceStatement;\n readonly operations: readonly OperationStatementNode[];\n readonly bodyRange: TextRange;\n readonly extends: readonly TypeReferenceNode[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UnionStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.UnionStatement;\n readonly options: readonly UnionVariantNode[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UnionVariantNode extends BaseNode {\n readonly kind: SyntaxKind.UnionVariant;\n readonly id?: IdentifierNode;\n readonly value: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: UnionStatementNode;\n}\n\nexport interface EnumStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.EnumStatement;\n readonly members: readonly (EnumMemberNode | EnumSpreadMemberNode)[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface EnumMemberNode extends BaseNode {\n readonly kind: SyntaxKind.EnumMember;\n readonly id: IdentifierNode;\n readonly value?: StringLiteralNode | NumericLiteralNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: EnumStatementNode;\n}\n\nexport interface EnumSpreadMemberNode extends BaseNode {\n readonly kind: SyntaxKind.EnumSpreadMember;\n readonly target: TypeReferenceNode;\n}\n\nexport interface AliasStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.AliasStatement;\n readonly value: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ConstStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.ConstStatement;\n readonly value: Expression;\n readonly type?: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\nexport interface CallExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.CallExpression;\n readonly target: MemberExpressionNode | IdentifierNode;\n readonly arguments: Expression[];\n}\n\nexport interface InvalidStatementNode extends BaseNode {\n readonly kind: SyntaxKind.InvalidStatement;\n readonly decorators: readonly DecoratorExpressionNode[];\n}\n\nexport interface EmptyStatementNode extends BaseNode {\n readonly kind: SyntaxKind.EmptyStatement;\n}\n\nexport interface ModelExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ModelExpression;\n readonly properties: (ModelPropertyNode | ModelSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n}\n\nexport interface ArrayExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ArrayExpression;\n readonly elementType: Expression;\n}\nexport interface TupleExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.TupleExpression;\n readonly values: readonly Expression[];\n}\n\nexport interface ModelPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ModelProperty;\n readonly id: IdentifierNode;\n readonly value: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly optional: boolean;\n readonly default?: Expression;\n readonly parent?: ModelStatementNode | ModelExpressionNode;\n}\n\nexport interface ModelSpreadPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ModelSpreadProperty;\n readonly target: TypeReferenceNode;\n readonly parent?: ModelStatementNode | ModelExpressionNode;\n}\n\nexport interface ObjectLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteral;\n readonly properties: (ObjectLiteralPropertyNode | ObjectLiteralSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n}\n\nexport interface ObjectLiteralPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteralProperty;\n readonly id: IdentifierNode;\n readonly value: Expression;\n readonly parent?: ObjectLiteralNode;\n}\n\nexport interface ObjectLiteralSpreadPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteralSpreadProperty;\n readonly target: TypeReferenceNode;\n readonly parent?: ObjectLiteralNode;\n}\n\nexport interface ArrayLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.ArrayLiteral;\n readonly values: readonly Expression[];\n}\n\nexport type LiteralNode =\n | StringLiteralNode\n | NumericLiteralNode\n | BooleanLiteralNode\n | StringTemplateHeadNode\n | StringTemplateMiddleNode\n | StringTemplateTailNode;\n\nexport interface StringLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.StringLiteral;\n readonly value: string;\n}\n\nexport interface NumericLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.NumericLiteral;\n readonly value: number;\n readonly valueAsString: string;\n}\n\nexport interface BooleanLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.BooleanLiteral;\n readonly value: boolean;\n}\n\nexport interface StringTemplateExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.StringTemplateExpression;\n readonly head: StringTemplateHeadNode;\n readonly spans: readonly StringTemplateSpanNode[];\n}\n\n// Each of these corresponds to a substitution expression and a template literal, in that order.\n// The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral.\nexport interface StringTemplateSpanNode extends BaseNode {\n readonly kind: SyntaxKind.StringTemplateSpan;\n readonly expression: Expression;\n readonly literal: StringTemplateMiddleNode | StringTemplateTailNode;\n}\n\nexport interface StringTemplateLiteralLikeNode extends BaseNode {\n readonly value: string;\n\n /** @internal */\n readonly tokenFlags: TokenFlags;\n}\n\nexport interface StringTemplateHeadNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateHead;\n}\n\nexport interface StringTemplateMiddleNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateMiddle;\n}\n\nexport interface StringTemplateTailNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateTail;\n}\n\nexport interface ExternKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.ExternKeyword;\n}\n\nexport interface VoidKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.VoidKeyword;\n}\n\nexport interface NeverKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.NeverKeyword;\n}\n\nexport interface AnyKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.UnknownKeyword;\n}\n\nexport interface UnionExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.UnionExpression;\n readonly options: readonly Expression[];\n}\n\nexport interface IntersectionExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.IntersectionExpression;\n readonly options: readonly Expression[];\n}\n\nexport interface ValueOfExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ValueOfExpression;\n readonly target: Expression;\n}\n\nexport interface TypeOfExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.TypeOfExpression;\n readonly target: Expression;\n}\n\nexport interface TypeReferenceNode extends BaseNode {\n readonly kind: SyntaxKind.TypeReference;\n readonly target: MemberExpressionNode | IdentifierNode;\n readonly arguments: readonly TemplateArgumentNode[];\n}\n\nexport interface TemplateArgumentNode extends BaseNode {\n readonly kind: SyntaxKind.TemplateArgument;\n readonly name?: IdentifierNode;\n readonly argument: Expression;\n}\n\nexport interface TemplateParameterDeclarationNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.TemplateParameterDeclaration;\n readonly constraint?: Expression;\n readonly default?: Expression;\n readonly parent?: TemplateableNode;\n}\n\nexport const enum ModifierFlags {\n None,\n Extern = 1 << 1,\n}\n\nexport type Modifier = ExternKeywordNode;\n\n/**\n * Represent a decorator declaration\n * @example\n * ```typespec\n * extern dec doc(target: Type, value: valueof string);\n * ```\n */\nexport interface DecoratorDeclarationStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.DecoratorDeclarationStatement;\n readonly modifiers: readonly Modifier[];\n readonly modifierFlags: ModifierFlags;\n /**\n * Decorator target. First parameter.\n */\n readonly target: FunctionParameterNode;\n\n /**\n * Additional parameters\n */\n readonly parameters: FunctionParameterNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface FunctionParameterNode extends BaseNode {\n readonly kind: SyntaxKind.FunctionParameter;\n readonly id: IdentifierNode;\n readonly type?: Expression;\n\n /**\n * Parameter defined with `?`\n */\n readonly optional: boolean;\n\n /**\n * Parameter defined with `...` notation.\n */\n readonly rest: boolean;\n}\n\n/**\n * Represent a function declaration\n * @example\n * ```typespec\n * extern fn camelCase(value: StringLiteral): StringLiteral;\n * ```\n */\nexport interface FunctionDeclarationStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.FunctionDeclarationStatement;\n readonly modifiers: readonly Modifier[];\n readonly modifierFlags: ModifierFlags;\n readonly parameters: FunctionParameterNode[];\n readonly returnType?: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface IdentifierContext {\n kind: IdentifierKind;\n node: Node;\n}\n\nexport enum IdentifierKind {\n TypeReference,\n TemplateArgument,\n Decorator,\n Function,\n Using,\n Declaration,\n ModelExpressionProperty,\n ModelStatementProperty,\n ObjectLiteralProperty,\n Other,\n}\n\n// Doc-comment related syntax\n\nexport interface DocNode extends BaseNode {\n readonly kind: SyntaxKind.Doc;\n readonly content: readonly DocContent[];\n readonly tags: readonly DocTag[];\n}\n\nexport interface DocTagBaseNode extends BaseNode {\n readonly tagName: IdentifierNode;\n readonly content: readonly DocContent[];\n}\n\nexport type DocTag =\n | DocReturnsTagNode\n | DocErrorsTagNode\n | DocParamTagNode\n | DocPropTagNode\n | DocTemplateTagNode\n | DocUnknownTagNode;\nexport type DocContent = DocTextNode;\n\nexport interface DocTextNode extends BaseNode {\n readonly kind: SyntaxKind.DocText;\n readonly text: string;\n}\n\nexport interface DocReturnsTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocReturnsTag;\n}\n\nexport interface DocErrorsTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocErrorsTag;\n}\n\nexport interface DocParamTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocParamTag;\n readonly paramName: IdentifierNode;\n}\n\nexport interface DocPropTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocPropTag;\n readonly propName: IdentifierNode;\n}\n\nexport interface DocTemplateTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocTemplateTag;\n readonly paramName: IdentifierNode;\n}\n\nexport interface DocUnknownTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocUnknownTag;\n}\n////\n\n/**\n * Identifies the position within a source file by line number and offset from\n * beginning of line.\n */\nexport interface LineAndCharacter {\n /** The line number. 0-based. */\n line: number;\n\n /**\n * The offset in UTF-16 code units to the character from the beginning of the\n * line. 0-based.\n *\n * NOTE: This is not necessarily the same as what a given text editor might\n * call the \"column\". Tabs, combining characters, surrogate pairs, and so on\n * can all cause an editor to report the column differently. Indeed, different\n * text editors report different column numbers for the same position in a\n * given document.\n */\n character: number;\n}\n\nexport interface JsSourceFileNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.JsSourceFile;\n\n /* A source file with empty contents to represent the file on disk. */\n readonly file: SourceFile;\n\n /* The exports object as comes from `import()` */\n readonly esmExports: any;\n\n /* Any namespaces declared by decorators. */\n /** @internal */\n readonly namespaceSymbols: Sym[];\n}\n\nexport interface JsNamespaceDeclarationNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.JsNamespaceDeclaration;\n}\n\nexport type EmitterFunc = (context: EmitContext) => Promise<void> | void;\n\nexport interface SourceFile {\n /** The source code text. */\n readonly text: string;\n\n /**\n * The source file path.\n *\n * This is used only for diagnostics. The command line compiler will populate\n * it with the actual path from which the file was read, but it can actually\n * be an arbitrary name for other scenarios.\n */\n readonly path: string;\n\n /**\n * Array of positions in the text where each line begins. There is one entry\n * per line, in order of lines, and each entry represents the offset in UTF-16\n * code units from the start of the document to the beginning of the line.\n */\n getLineStarts(): readonly number[];\n\n /**\n * Converts a one-dimensional position in the document (measured in UTF-16\n * code units) to line number and offset from line start.\n */\n getLineAndCharacterOfPosition(position: number): LineAndCharacter;\n}\n\n/**\n * Represent a location context in the mind of the compiler. This can be:\n * - the user project\n * - a library\n * - the compiler(standard library)\n * - virtual\n */\nexport type LocationContext =\n | ProjectLocationContext\n | CompilerLocationContext\n | SyntheticLocationContext\n | LibraryLocationContext;\n\n/** Defined in the user project. */\nexport interface ProjectLocationContext {\n readonly type: \"project\";\n readonly flags?: PackageFlags;\n}\n\n/** Built-in */\nexport interface CompilerLocationContext {\n readonly type: \"compiler\";\n}\n\n/** Refer to a type that was not declared in a file */\nexport interface SyntheticLocationContext {\n readonly type: \"synthetic\";\n}\n\n/** Defined in a library. */\nexport interface LibraryLocationContext {\n readonly type: \"library\";\n\n /** Library metadata */\n readonly metadata: ModuleLibraryMetadata;\n\n /** Module definition */\n readonly flags?: PackageFlags;\n}\n\nexport interface LibraryInstance {\n module: ModuleResolutionResult;\n entrypoint: JsSourceFileNode;\n metadata: LibraryMetadata;\n definition?: TypeSpecLibrary<any>;\n linter: LinterResolvedDefinition;\n}\n\nexport type LibraryMetadata = FileLibraryMetadata | ModuleLibraryMetadata;\n\ninterface LibraryMetadataBase {\n /** Library homepage. */\n homepage?: string;\n\n /** Library version */\n version?: string;\n\n bugs?: {\n /** Url where to file bugs for this library. */\n url?: string;\n };\n}\n\nexport interface FileLibraryMetadata extends LibraryMetadataBase {\n type: \"file\";\n\n /** Library name as specified in the package.json or in exported $lib. */\n name?: string;\n}\n\n/** Data for a library. Either loaded via a node_modules package or a standalone js file */\nexport interface ModuleLibraryMetadata extends LibraryMetadataBase {\n readonly type: \"module\";\n\n /** Library name as specified in the package.json or in exported $lib. */\n readonly name: string;\n}\n\nexport interface TextRange {\n /**\n * The starting position of the ranger measured in UTF-16 code units from the\n * start of the full string. Inclusive.\n */\n readonly pos: number;\n\n /**\n * The ending position measured in UTF-16 code units from the start of the\n * full string. Exclusive.\n */\n readonly end: number;\n}\n\nexport interface SourceLocation extends TextRange {\n file: SourceFile;\n isSynthetic?: boolean;\n}\n\n/** Used to explicitly specify that a diagnostic has no target. */\nexport const NoTarget = Symbol.for(\"NoTarget\");\n\n/** Diagnostic target that can be used when working with TypeSpec types. */\nexport type TypeSpecDiagnosticTarget = Node | Entity | Sym | TemplateInstanceTarget;\n\n/** Represent a diagnostic target that happens in a template instance context. */\nexport interface TemplateInstanceTarget {\n /** Node target */\n readonly node: Node;\n /** Template mapper used. */\n readonly templateMapper: TypeMapper;\n}\n\nexport type DiagnosticTarget = TypeSpecDiagnosticTarget | SourceLocation;\n\nexport type DiagnosticSeverity = \"error\" | \"warning\";\n\nexport interface Diagnostic {\n code: string;\n /** @internal Diagnostic documentation url */\n readonly url?: string;\n severity: DiagnosticSeverity;\n message: string;\n target: DiagnosticTarget | typeof NoTarget;\n readonly codefixes?: readonly CodeFix[];\n}\n\nexport interface CodeFix {\n readonly id: string;\n readonly label: string;\n readonly fix: (fixContext: CodeFixContext) => CodeFixEdit | CodeFixEdit[] | Promise<void> | void;\n}\n\nexport interface FilePos {\n readonly pos: number;\n readonly file: SourceFile;\n}\n\nexport interface CodeFixContext {\n /** Add the given text before the range or pos given. */\n readonly prependText: (location: SourceLocation | FilePos, text: string) => InsertTextCodeFixEdit;\n /** Add the given text after the range or pos given. */\n readonly appendText: (location: SourceLocation | FilePos, text: string) => InsertTextCodeFixEdit;\n /** Replace the text at the given range. */\n readonly replaceText: (location: SourceLocation, newText: string) => ReplaceTextCodeFixEdit;\n}\n\nexport type CodeFixEdit = InsertTextCodeFixEdit | ReplaceTextCodeFixEdit;\n\nexport interface InsertTextCodeFixEdit {\n readonly kind: \"insert-text\";\n readonly text: string;\n readonly pos: number;\n readonly file: SourceFile;\n}\n\nexport interface ReplaceTextCodeFixEdit extends TextRange {\n readonly kind: \"replace-text\";\n readonly text: string;\n readonly file: SourceFile;\n}\n\n/**\n * Return type of accessor functions in TypeSpec.\n * Tuple composed of:\n * - 0: Actual result of an accessor function\n * - 1: List of diagnostics that were emitted while retrieving the data.\n */\nexport type DiagnosticResult<T> = [T, readonly Diagnostic[]];\n\nexport interface DirectiveBase {\n node: DirectiveExpressionNode;\n}\n\nexport type Directive = SuppressDirective | DeprecatedDirective;\n\nexport interface SuppressDirective extends DirectiveBase {\n name: \"suppress\";\n code: string;\n message: string;\n}\n\nexport interface DeprecatedDirective extends DirectiveBase {\n name: \"deprecated\";\n message: string;\n}\n\nexport interface RmOptions {\n /**\n * If `true`, perform a recursive directory removal. In\n * recursive mode, errors are not reported if `path` does not exist, and\n * operations are retried on failure.\n * @default false\n */\n recursive?: boolean;\n}\n\nexport interface SystemHost {\n /** read a file at the given url. */\n readUrl(url: string): Promise<SourceFile>;\n\n /** read a utf-8 or utf-8 with bom encoded file */\n readFile(path: string): Promise<SourceFile>;\n\n /**\n * Write the file.\n * @param path Path to the file.\n * @param content Content of the file.\n */\n writeFile(path: string, content: string): Promise<void>;\n\n /**\n * Read directory.\n * @param path Path to the directory.\n * @returns list of file/directory in the given directory. Returns the name not the full path.\n */\n readDir(path: string): Promise<string[]>;\n\n /**\n * Deletes a directory or file.\n * @param path Path to the directory or file.\n */\n rm(path: string, options?: RmOptions): Promise<void>;\n\n /**\n * create directory recursively.\n * @param path Path to the directory.\n */\n mkdirp(path: string): Promise<string | undefined>;\n\n // get info about a path\n stat(path: string): Promise<{ isDirectory(): boolean; isFile(): boolean }>;\n\n // get the real path of a possibly symlinked path\n realpath(path: string): Promise<string>;\n}\n\nexport interface CompilerHost extends SystemHost {\n /**\n * Optional cache to reuse the results of parsing and binding across programs.\n */\n parseCache?: WeakMap<SourceFile, TypeSpecScriptNode>;\n\n // get the directory TypeSpec is executing from\n getExecutionRoot(): string;\n\n // get the directories we should load standard library files from\n getLibDirs(): string[];\n\n // get a promise for the ESM module shape of a JS module\n getJsImport(path: string): Promise<Record<string, any>>;\n\n getSourceFileKind(path: string): SourceFileKind | undefined;\n\n // convert a file URL to a path in a file system\n fileURLToPath(url: string): string;\n\n // convert a file system path to a URL\n pathToFileURL(path: string): string;\n\n logSink: LogSink;\n}\n\n/**\n * Type of the source file that can be loaded via typespec\n */\nexport type SourceFileKind = \"typespec\" | \"js\";\n\ntype UnionToIntersection<T> = (T extends any ? (k: T) => void : never) extends (k: infer I) => void\n ? I\n : never;\n\nexport enum ListenerFlow {\n /**\n * Do not navigate any containing or referenced type.\n */\n NoRecursion = 1,\n}\n\n/**\n * Listener function. Can return false to stop recursion.\n */\ntype TypeListener<T> = (context: T) => ListenerFlow | undefined | void;\ntype exitListener<T extends string | number | symbol> = T extends string ? `exit${T}` : T;\ntype ListenerForType<T extends Type> = T extends Type\n ? { [k in Uncapitalize<T[\"kind\"]> | exitListener<T[\"kind\"]>]?: TypeListener<T> }\n : never;\n\nexport type TypeListeners = UnionToIntersection<ListenerForType<Type>>;\n\nexport type SemanticNodeListener = {\n root?: (context: Program) => void | undefined;\n} & TypeListeners;\n\nexport type DiagnosticReportWithoutTarget<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> = {\n code: C;\n messageId?: M;\n readonly codefixes?: readonly CodeFix[];\n} & DiagnosticFormat<T, C, M>;\n\nexport type DiagnosticReport<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> = DiagnosticReportWithoutTarget<T, C, M> & { target: DiagnosticTarget | typeof NoTarget };\n\nexport type DiagnosticFormat<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> =\n T[C][M] extends CallableMessage<infer A>\n ? { format: Record<A[number], string> }\n : Record<string, unknown>;\n\n/**\n * Declare a diagnostic that can be reported by the library.\n *\n * @example\n *\n * ```ts\n * unterminated: {\n * severity: \"error\",\n * description: \"Unterminated token.\",\n * url: \"https://example.com/docs/diags/unterminated\",\n * messages: {\n * default: paramMessage`Unterminated ${\"token\"}.`,\n * },\n * },\n * ```\n */\nexport interface DiagnosticDefinition<M extends DiagnosticMessages> {\n /**\n * Diagnostic severity.\n * - `warning` - Suppressable, should be used to represent potential issues but not blocking.\n * - `error` - Non-suppressable, should be used to represent failure to move forward.\n */\n readonly severity: \"warning\" | \"error\";\n /** Messages that can be reported with the diagnostic. */\n readonly messages: M;\n /** Short description of the diagnostic */\n readonly description?: string;\n /** Specifies the URL at which the full documentation can be accessed. */\n readonly url?: string;\n}\n\nexport interface DiagnosticMessages {\n readonly [messageId: string]: string | CallableMessage<string[]>;\n}\n\nexport interface CallableMessage<T extends string[]> {\n keys: T;\n (dict: Record<T[number], string>): string;\n}\n\nexport type DiagnosticMap<T extends { [code: string]: DiagnosticMessages }> = {\n readonly [code in keyof T]: DiagnosticDefinition<T[code]>;\n};\n\nexport interface DiagnosticCreator<T extends { [code: string]: DiagnosticMessages }> {\n readonly type: T;\n readonly diagnostics: DiagnosticMap<T>;\n createDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n diag: DiagnosticReport<T, C, M>,\n ): Diagnostic;\n reportDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n program: Program,\n diag: DiagnosticReport<T, C, M>,\n ): void;\n}\n\nexport type TypeOfDiagnostics<T extends DiagnosticMap<any>> =\n T extends DiagnosticMap<infer D> ? D : never;\n\nexport type JSONSchemaType<T> = AjvJSONSchemaType<T>;\n\n/**\n * @internal\n */\nexport interface JSONSchemaValidator {\n /**\n * Validate the configuration against its JSON Schema.\n *\n * @param config Configuration to validate.\n * @param target Source file target to use for diagnostics.\n * @returns Diagnostics produced by schema validation of the configuration.\n */\n validate(\n config: unknown,\n target: YamlScript | YamlPathTarget | SourceFile | typeof NoTarget,\n ): Diagnostic[];\n}\n\nexport interface StateDef {\n /**\n * Description for this state.\n */\n readonly description?: string;\n}\n\nexport interface TypeSpecLibraryCapabilities {\n /** Only applicable for emitters. Specify that this emitter will respect the dryRun flag and run, report diagnostic but not write any output. */\n readonly dryRun?: boolean;\n}\n\nexport interface TypeSpecLibraryDef<\n T extends { [code: string]: DiagnosticMessages },\n E extends Record<string, any> = Record<string, never>,\n State extends string = never,\n> {\n /**\n * Library name. MUST match package.json name.\n */\n readonly name: string;\n\n /** Optional registration of capabilities the library/emitter provides */\n readonly capabilities?: TypeSpecLibraryCapabilities;\n\n /**\n * Map of potential diagnostics that can be emitted in this library where the key is the diagnostic code.\n */\n readonly diagnostics: DiagnosticMap<T>;\n\n /**\n * List of other library that should be imported when this is used as an emitter.\n * Compiler will emit an error if the libraries are not explicitly imported.\n */\n readonly requireImports?: readonly string[];\n\n /**\n * Emitter configuration if library is an emitter.\n */\n readonly emitter?: {\n options?: JSONSchemaType<E>;\n };\n\n readonly state?: Record<State, StateDef>;\n}\n\n/**\n * Type for the $decorators export from libraries.\n *\n * @example\n * ```\n * export const $decorators = {\n * \"Azure.Core\": {\n * flags: $flags,\n * \"foo-bar\": fooBarDecorator\n * }\n * }\n * ```\n */\nexport interface DecoratorImplementations {\n readonly [namespace: string]: {\n readonly [name: string]: DecoratorFunction;\n };\n}\n\nexport interface PackageFlags {}\n\nexport interface LinterDefinition {\n rules: LinterRuleDefinition<string, DiagnosticMessages>[];\n ruleSets?: Record<string, LinterRuleSet>;\n}\n\nexport interface LinterResolvedDefinition {\n readonly rules: LinterRule<string, DiagnosticMessages>[];\n readonly ruleSets: {\n [name: string]: LinterRuleSet;\n };\n}\n\ninterface LinterRuleDefinitionBase<N extends string, DM extends DiagnosticMessages> {\n /** Rule name (without the library name) */\n name: N;\n /** Rule default severity. */\n severity: \"warning\";\n /** Short description of the rule */\n description: string;\n /** Specifies the URL at which the full documentation can be accessed. */\n url?: string;\n /** Messages that can be reported with the diagnostic. */\n messages: DM;\n}\n\ninterface LinterRuleDefinitionSync<\n N extends string,\n DM extends DiagnosticMessages,\n> extends LinterRuleDefinitionBase<N, DM> {\n /** Whether this is an async rule. Default is false */\n async?: false;\n /** Creator */\n create(\n context: LinterRuleContext<DM>,\n ): SemanticNodeListener & { exit?: (context: Program) => void | undefined };\n}\n\ninterface LinterRuleDefinitionAsync<\n N extends string,\n DM extends DiagnosticMessages,\n> extends LinterRuleDefinitionBase<N, DM> {\n /** Whether this is an async rule. Default is false */\n async: true;\n /** Creator */\n create(\n context: LinterRuleContext<DM>,\n ): SemanticNodeListener & { exit?: (context: Program) => Promise<void | undefined> };\n}\n\nexport type LinterRuleDefinition<N extends string, DM extends DiagnosticMessages> =\n | LinterRuleDefinitionSync<N, DM>\n | LinterRuleDefinitionAsync<N, DM>;\n\n/** Resolved instance of a linter rule that will run. */\nexport type LinterRule<N extends string, DM extends DiagnosticMessages> = LinterRuleDefinition<\n N,\n DM\n> & {\n /** Expanded rule id in format `<library-name>:<rule-name>` */\n id: string;\n};\n\n/** Reference to a rule. In this format `<library name>:<rule/ruleset name>` */\nexport type RuleRef = `${string}/${string}`;\nexport interface LinterRuleSet {\n /** Other ruleset this ruleset extends */\n extends?: RuleRef[];\n\n /** Rules to enable/configure */\n enable?: Record<RuleRef, boolean>;\n\n /** Rules to disable. A rule CANNOT be in enable and disable map. */\n disable?: Record<RuleRef, string>;\n}\n\nexport interface LinterRuleContext<DM extends DiagnosticMessages> {\n readonly program: Program;\n reportDiagnostic<M extends keyof DM>(diag: LinterRuleDiagnosticReport<DM, M>): void;\n}\n\nexport type LinterRuleDiagnosticFormat<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> =\n T[M] extends CallableMessage<infer A>\n ? { format: Record<A[number], string> }\n : Record<string, unknown>;\n\nexport type LinterRuleDiagnosticReportWithoutTarget<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> = {\n messageId?: M;\n codefixes?: CodeFix[];\n} & LinterRuleDiagnosticFormat<T, M>;\n\nexport type LinterRuleDiagnosticReport<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> = LinterRuleDiagnosticReportWithoutTarget<T, M> & { target: DiagnosticTarget | typeof NoTarget };\n\nexport interface TypeSpecLibrary<\n T extends { [code: string]: DiagnosticMessages },\n E extends Record<string, any> = Record<string, never>,\n State extends string = never,\n> extends TypeSpecLibraryDef<T, E, State> {\n /** Library name */\n readonly name: string;\n\n /**\n * JSON Schema validator for emitter options\n * @internal\n */\n readonly emitterOptionValidator?: JSONSchemaValidator;\n\n reportDiagnostic<C extends keyof T, M extends keyof T[C]>(\n program: Program,\n diag: DiagnosticReport<T, C, M>,\n ): void;\n createDiagnostic<C extends keyof T, M extends keyof T[C]>(\n diag: DiagnosticReport<T, C, M>,\n ): Diagnostic;\n\n /**\n * Get or create a symbol with the given name unique for that library.\n * @param name Symbol name scoped with the library name.\n */\n createStateSymbol(name: string): symbol;\n\n /**\n * Returns a tracer scopped to the current library.\n * All trace area logged via this tracer will be prefixed with the library name.\n */\n getTracer(program: Program): Tracer;\n\n readonly stateKeys: Record<State, symbol>;\n}\n\n/**\n * Get the options for the onEmit of this library.\n */\nexport type EmitOptionsFor<C> = C extends TypeSpecLibrary<infer _T, infer E> ? E : never;\n\nexport interface DecoratorContext {\n program: Program;\n\n /**\n * Point to the decorator target\n */\n decoratorTarget: DiagnosticTarget;\n\n /**\n * Function that can be used to retrieve the target for a parameter at the given index.\n * @param paramIndex Parameter index in the typespec\n * @example @foo(\"bar\", 123) -> $foo(context, target, arg0: string, arg1: number);\n * getArgumentTarget(0) -> target for arg0\n * getArgumentTarget(1) -> target for arg1\n */\n getArgumentTarget(paramIndex: number): DiagnosticTarget | undefined;\n\n /**\n * Helper to call out to another decorator\n * @param decorator Other decorator function\n * @param args Args to pass to other decorator function\n */\n call<T extends Type, A extends any[], R>(\n decorator: (context: DecoratorContext, target: T, ...args: A) => R,\n target: T,\n ...args: A\n ): R;\n}\n\nexport interface EmitContext<TOptions extends object = Record<string, never>> {\n /**\n * TypeSpec Program.\n */\n program: Program;\n\n /**\n * Configured output dir for the emitter. Emitter should emit all output under that directory.\n */\n emitterOutputDir: string;\n\n /**\n * Emitter custom options defined in createTypeSpecLibrary\n */\n options: TOptions;\n}\n\nexport type LogLevel = \"trace\" | \"warning\" | \"error\";\n\nexport interface LogInfo {\n level: LogLevel;\n message: string;\n code?: string;\n target?: DiagnosticTarget | typeof NoTarget;\n}\n\nexport interface ProcessedLog {\n level: LogLevel;\n message: string;\n code?: string;\n /** Documentation for the error code. */\n url?: string;\n\n /** Log location */\n sourceLocation?: SourceLocation;\n\n /** @internal */\n related?: RelatedSourceLocation[];\n}\n\n/** @internal */\nexport interface RelatedSourceLocation {\n readonly message: string;\n readonly location: SourceLocation;\n}\n\n/** @internal */\nexport type TaskStatus = \"success\" | \"failure\" | \"skipped\" | \"warn\";\n\n/** @internal */\nexport interface TrackActionTask {\n message: string;\n readonly isStopped: boolean;\n succeed(message?: string): void;\n fail(message?: string): void;\n warn(message?: string): void;\n skip(message?: string): void;\n stop(status: TaskStatus, message?: string): void;\n}\n\nexport interface LogSink {\n log(log: ProcessedLog): void;\n\n /** @internal */\n getPath?(path: string): string;\n\n /**\n * @internal\n */\n trackAction?<T>(\n message: string,\n finalMessage: string,\n asyncAction: (task: TrackActionTask) => Promise<T>,\n ): Promise<T>;\n}\n\nexport interface Logger {\n trace(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n log(log: LogInfo): void;\n\n /** @internal */\n trackAction<T>(\n message: string,\n finalMessage: string,\n asyncAction: (task: TrackActionTask) => Promise<T>,\n ): Promise<T>;\n}\n\nexport interface TracerOptions {\n filter?: string[];\n}\nexport interface Tracer {\n /**\n * Trace\n * @param area\n * @param message\n */\n trace(area: string, message: string, target?: DiagnosticTarget): void;\n\n /**\n * @param subarea\n */\n sub(subarea: string): Tracer;\n}\n", "import type { Program } from \"./program.js\";\nimport { createSourceFile } from \"./source-file.js\";\nimport {\n CodeFix,\n Diagnostic,\n DiagnosticResult,\n DiagnosticTarget,\n LogSink,\n Node,\n NodeFlags,\n NoTarget,\n RelatedSourceLocation,\n SourceLocation,\n SymbolFlags,\n SyntaxKind,\n Type,\n TypeSpecDiagnosticTarget,\n} from \"./types.js\";\n\nexport type WriteLine = (text?: string) => void;\nexport type DiagnosticHandler = (diagnostic: Diagnostic) => void;\n\nexport function logDiagnostics(diagnostics: readonly Diagnostic[], logger: LogSink) {\n for (const diagnostic of diagnostics) {\n logger.log({\n level: diagnostic.severity,\n message: diagnostic.message,\n code: diagnostic.code,\n url: diagnostic.url,\n sourceLocation: getSourceLocation(diagnostic.target, { locateId: true }),\n related: getRelatedLocations(diagnostic),\n });\n }\n}\n\n/** @internal */\nexport function getRelatedLocations(diagnostic: Diagnostic): RelatedSourceLocation[] {\n return getDiagnosticTemplateInstantitationTrace(diagnostic.target).map((x) => {\n return {\n message: \"occurred while instantiating template\",\n location: getSourceLocation(x),\n };\n });\n}\n\n/**\n * Find the syntax node for a TypeSpec diagnostic target.\n *\n * This function extracts the AST node from various types of diagnostic targets:\n * - For template instance targets: returns the node of the template declaration\n * - For symbols: returns the first declaration node (or symbol source for using symbols)\n * - For AST nodes: returns the node itself\n * - For types: returns the node associated with the type\n *\n * @param target The diagnostic target to extract a node from. Can be a template instance,\n * symbol, AST node, or type.\n * @returns The AST node associated with the target, or undefined if the target is a type\n * or symbol that doesn't have an associated node.\n */\nexport function getNodeForTarget(target: TypeSpecDiagnosticTarget): Node | undefined {\n if (!(\"kind\" in target) && !(\"entityKind\" in target)) {\n // TemplateInstanceTarget\n if (!(\"declarations\" in target)) {\n return target.node;\n }\n\n // symbol\n if (target.flags & SymbolFlags.Using) {\n target = target.symbolSource!;\n }\n\n return target.declarations[0];\n } else if (\"kind\" in target && typeof target.kind === \"number\") {\n // node\n return target as Node;\n } else {\n // type\n return (target as Type).node;\n }\n}\n\nexport interface SourceLocationOptions {\n /**\n * If trying to resolve the location of a type with an ID, show the location of the ID node instead of the entire type.\n * This makes sure that the location range is not too large and hard to read.\n */\n locateId?: boolean;\n}\nexport function getSourceLocation(\n target: DiagnosticTarget,\n options?: SourceLocationOptions,\n): SourceLocation;\nexport function getSourceLocation(\n target: typeof NoTarget | undefined,\n options?: SourceLocationOptions,\n): undefined;\nexport function getSourceLocation(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n options?: SourceLocationOptions,\n): SourceLocation | undefined;\nexport function getSourceLocation(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n options: SourceLocationOptions = {},\n): SourceLocation | undefined {\n if (target === NoTarget || target === undefined) {\n return undefined;\n }\n\n if (\"file\" in target) {\n return target;\n }\n\n const node = getNodeForTarget(target);\n return node ? getSourceLocationOfNode(node, options) : createSyntheticSourceLocation();\n}\n\n/**\n * @internal\n */\nexport function getDiagnosticTemplateInstantitationTrace(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n): Node[] {\n if (typeof target !== \"object\" || !(\"templateMapper\" in target)) {\n return [];\n }\n\n const result = [];\n let current = target.templateMapper;\n while (current) {\n result.push(current.source.node);\n current = current.source.mapper;\n }\n return result;\n}\n\nfunction createSyntheticSourceLocation(loc = \"<unknown location>\") {\n return {\n file: createSourceFile(\"\", loc),\n pos: 0,\n end: 0,\n isSynthetic: true,\n };\n}\n\nfunction getSourceLocationOfNode(node: Node, options: SourceLocationOptions): SourceLocation {\n let root = node;\n\n while (root.parent !== undefined) {\n root = root.parent;\n }\n\n if (root.kind !== SyntaxKind.TypeSpecScript && root.kind !== SyntaxKind.JsSourceFile) {\n return createSyntheticSourceLocation(\n node.flags & NodeFlags.Synthetic\n ? undefined\n : \"<unknown location - cannot obtain source location of unbound node - file bug at https://github.com/microsoft/typespec>\",\n );\n }\n\n if (options.locateId && \"id\" in node && node.id !== undefined) {\n node = node.id;\n }\n\n return {\n file: root.file,\n pos: node.pos,\n end: node.end,\n };\n}\n\n/**\n * Verbose output is enabled by default for runs in mocha explorer in VS Code,\n * where the output is nicely associated with the individual test, and disabled\n * by default for command line runs where we don't want to spam the console.\n *\n * If the steps taken to produce the message are expensive, pass a callback\n * instead of producing the message then passing it here only to be dropped\n * when verbose output is disabled.\n */\nexport function logVerboseTestOutput(\n messageOrCallback: string | ((log: (message: string) => void) => void),\n) {\n if (process.env.TYPESPEC_VERBOSE_TEST_OUTPUT) {\n if (typeof messageOrCallback === \"string\") {\n // eslint-disable-next-line no-console\n console.log(messageOrCallback);\n } else {\n // eslint-disable-next-line no-console\n messageOrCallback(console.log);\n }\n }\n}\n\n/**\n * Use this to report bugs in the compiler, and not errors in the source code\n * being compiled.\n *\n * @param condition Throw if this is not true.\n *\n * @param message Error message.\n *\n * @param target Optional location in source code that might give a clue about\n * what got the compiler off track.\n */\nexport function compilerAssert(\n condition: any,\n message: string,\n target?: DiagnosticTarget,\n): asserts condition {\n if (condition) {\n return;\n }\n\n if (target) {\n let location: SourceLocation | undefined;\n try {\n location = getSourceLocation(target);\n } catch (err: any) {}\n\n if (location) {\n const pos = location.file.getLineAndCharacterOfPosition(location.pos);\n const file = location.file.path;\n const line = pos.line + 1;\n const col = pos.character + 1;\n message += `\\nOccurred while compiling code in ${file} near line ${line}, column ${col}`;\n }\n }\n\n throw new Error(message);\n}\n\n/**\n * Assert that the input type has one of the kinds provided\n */\nexport function assertType<TKind extends Type[\"kind\"][]>(\n typeDescription: string,\n t: Type,\n ...kinds: TKind\n): asserts t is Type & { kind: TKind[number] } {\n if (kinds.indexOf(t.kind) === -1) {\n throw new Error(`Expected ${typeDescription} to be type ${kinds.join(\", \")}`);\n }\n}\n\n/**\n * Report a deprecated diagnostic.\n * @param program TypeSpec Program.\n * @param message Message describing the deprecation.\n * @param target Target of the deprecation.\n */\nexport function reportDeprecated(\n program: Program,\n message: string,\n target: DiagnosticTarget | typeof NoTarget,\n): void {\n program.reportDiagnostic({\n severity: \"warning\",\n code: \"deprecated\",\n message: `Deprecated: ${message}`,\n target,\n });\n}\n\n/**\n * Helper object to collect diagnostics from function following the diagnostics accessor pattern(foo() => [T, Diagnostic[]])\n */\nexport interface DiagnosticCollector {\n readonly diagnostics: readonly Diagnostic[];\n\n /**\n * Add a diagnostic to the collection\n * @param diagnostic Diagnostic to add.\n */\n add(diagnostic: Diagnostic): void;\n\n /**\n * Unwrap the Diagnostic result, add all the diagnostics and return the data.\n * @param result Accessor diagnostic result\n */\n pipe<T>(result: DiagnosticResult<T>): T;\n\n /**\n * Wrap the given value in a tuple including the diagnostics following the TypeSpec accessor pattern.\n * @param value Accessor value to return\n * @example return diagnostics.wrap(routes);\n */\n wrap<T>(value: T): DiagnosticResult<T>;\n\n /**\n * Join the given result with the diagnostics in this collector.\n * @param result - result to join with the diagnostics\n * @returns - the result with the combined diagnostics\n */\n join<T>(result: DiagnosticResult<T>): DiagnosticResult<T>;\n}\n\n/**\n * Create a new instance of the @see DiagnosticCollector.\n */\nexport function createDiagnosticCollector(): DiagnosticCollector {\n const diagnostics: Diagnostic[] = [];\n\n return {\n diagnostics,\n add,\n pipe,\n wrap,\n join,\n };\n\n function add(diagnostic: Diagnostic) {\n diagnostics.push(diagnostic);\n }\n\n function pipe<T>(result: DiagnosticResult<T>): T {\n const [value, diags] = result;\n for (const diag of diags) {\n diagnostics.push(diag);\n }\n return value;\n }\n\n function wrap<T>(value: T): DiagnosticResult<T> {\n return [value, diagnostics];\n }\n\n function join<T>(result: DiagnosticResult<T>): DiagnosticResult<T> {\n const [value, diags] = result;\n for (const diag of diags) {\n diagnostics.push(diag);\n }\n return [value, diagnostics];\n }\n}\n\n/**\n * Ignore the diagnostics emitted by the diagnostic accessor pattern and just return the actual result.\n * @param result Accessor pattern tuple result including the actual result and the list of diagnostics.\n * @returns Actual result.\n */\nexport function ignoreDiagnostics<T>(result: DiagnosticResult<T>): T {\n return result[0];\n}\n\nexport function defineCodeFix(fix: CodeFix): CodeFix {\n return fix;\n}\n", "import { isPathAbsolute, isUrl, normalizePath, resolvePath } from \"../core/path-utils.js\";\nimport type {\n MutableSymbolTable,\n RekeyableMap,\n SourceFile,\n SymbolTable,\n SystemHost,\n} from \"../core/types.js\";\n\n/**\n * Recursively calls Object.freeze such that all objects and arrays\n * referenced are frozen.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepFreeze<T>(value: T): T {\n if (Array.isArray(value)) {\n value.forEach(deepFreeze);\n } else if (typeof value === \"object\") {\n for (const prop in value) {\n deepFreeze(value[prop]);\n }\n }\n\n return Object.freeze(value);\n}\n\n/**\n * Deeply clones an object.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepClone<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(deepClone) as any;\n }\n\n if (value === null) {\n return value;\n }\n\n if (typeof value === \"object\") {\n const obj: any = {};\n for (const prop in value) {\n obj[prop] = deepClone(value[prop]);\n }\n return obj;\n }\n\n return value;\n}\n\n/**\n * Checks if two objects are deeply equal.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepEquals(left: unknown, right: unknown): boolean {\n if (left === right) {\n return true;\n }\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\") {\n return false;\n }\n if (Array.isArray(left)) {\n return Array.isArray(right) ? arrayEquals(left, right, deepEquals) : false;\n }\n return mapEquals(new Map(Object.entries(left)), new Map(Object.entries(right)), deepEquals);\n}\n\nexport type EqualityComparer<T> = (x: T, y: T) => boolean;\n\n/**\n * Check if two arrays have the same elements.\n *\n * @param equals Optional callback for element equality comparison.\n * Default is to compare by identity using `===`.\n */\nexport function arrayEquals<T>(\n left: T[],\n right: T[],\n equals: EqualityComparer<T> = (x, y) => x === y,\n): boolean {\n if (left === right) {\n return true;\n }\n if (left.length !== right.length) {\n return false;\n }\n for (let i = 0; i < left.length; i++) {\n if (!equals(left[i], right[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Check if two maps have the same entries.\n *\n * @param equals Optional callback for value equality comparison.\n * Default is to compare by identity using `===`.\n */\nexport function mapEquals<K, V>(\n left: Map<K, V>,\n right: Map<K, V>,\n equals: EqualityComparer<V> = (x, y) => x === y,\n): boolean {\n if (left === right) {\n return true;\n }\n if (left.size !== right.size) {\n return false;\n }\n for (const [key, value] of left) {\n if (!right.has(key) || !equals(value, right.get(key)!)) {\n return false;\n }\n }\n return true;\n}\n\nexport async function getNormalizedRealPath(host: SystemHost, path: string) {\n try {\n return normalizePath(await host.realpath(path));\n } catch (error: any) {\n // This could mean the file got deleted but VSCode still has it in memory. So keep the original path.\n if (error.code === \"ENOENT\") {\n return normalizePath(path);\n }\n throw error;\n }\n}\n\nexport async function readUrlOrPath(host: SystemHost, pathOrUrl: string): Promise<SourceFile> {\n if (isUrl(pathOrUrl)) {\n return host.readUrl(pathOrUrl);\n }\n return host.readFile(pathOrUrl);\n}\n\nexport function resolveRelativeUrlOrPath(base: string, relativeOrAbsolute: string): string {\n if (isUrl(relativeOrAbsolute)) {\n return relativeOrAbsolute;\n } else if (isPathAbsolute(relativeOrAbsolute)) {\n return relativeOrAbsolute;\n } else if (isUrl(base)) {\n return new URL(relativeOrAbsolute, base).href;\n } else {\n return resolvePath(base, relativeOrAbsolute);\n }\n}\n\n/**\n * A specially typed version of `Array.isArray` to work around [this issue](https://github.com/microsoft/TypeScript/issues/17002).\n */\nexport function isArray<T>(\n arg: T | {},\n): arg is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[] {\n return Array.isArray(arg);\n}\n\n/**\n * Check if argument is not undefined.\n */\nexport function isDefined<T>(arg: T | undefined): arg is T {\n return arg !== undefined;\n}\n\nexport function isWhitespaceStringOrUndefined(str: string | undefined): boolean {\n return !str || /^\\s*$/.test(str);\n}\n\nexport function firstNonWhitespaceCharacterIndex(line: string): number {\n return line.search(/\\S/);\n}\n\nexport function distinctArray<T, P>(arr: T[], keySelector: (item: T) => P): T[] {\n const map = new Map<P, T>();\n for (const item of arr) {\n map.set(keySelector(item), item);\n }\n return Array.from(map.values());\n}\n\nexport function tryParseJson(content: string): any | undefined {\n try {\n return JSON.parse(content);\n } catch {\n return undefined;\n }\n}\n\nexport function debounce<T extends (...args: any[]) => any>(fn: T, delayInMs: number): T {\n let timer: NodeJS.Timeout | undefined;\n return function (this: any, ...args: Parameters<T>) {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n }, delayInMs);\n } as T;\n}\n\n/**\n * Remove undefined properties from object.\n */\nexport function omitUndefined<T extends Record<string, unknown>>(data: T): T {\n return Object.fromEntries(Object.entries(data).filter(([k, v]) => v !== undefined)) as any;\n}\n\n/**\n * Extract package.json's tspMain entry point in a given path.\n * @param path Path that contains package.json\n * @param reportDiagnostic optional diagnostic handler.\n */\nexport function resolveTspMain(packageJson: any): string | undefined {\n if (packageJson?.tspMain !== undefined) {\n return packageJson.tspMain;\n }\n return undefined;\n}\n\n/**\n * A map keyed by a set of objects.\n *\n * This is likely non-optimal.\n */\nexport class MultiKeyMap<K extends readonly object[], V> {\n #currentId = 0;\n #idMap = new WeakMap<object, number>();\n #items = new Map<string, V>();\n\n get(items: K): V | undefined {\n return this.#items.get(this.compositeKeyFor(items));\n }\n\n set(items: K, value: V): void {\n const key = this.compositeKeyFor(items);\n this.#items.set(key, value);\n }\n\n private compositeKeyFor(items: K) {\n return items.map((i) => this.keyFor(i)).join(\",\");\n }\n\n private keyFor(item: object) {\n if (this.#idMap.has(item)) {\n return this.#idMap.get(item);\n }\n\n const id = this.#currentId++;\n this.#idMap.set(item, id);\n return id;\n }\n}\n\n/**\n * A map with exactly two keys per value.\n *\n * Functionally the same as `MultiKeyMap<[K1, K2], V>`, but more efficient.\n * @hidden bug in typedoc\n */\nexport class TwoLevelMap<K1, K2, V> extends Map<K1, Map<K2, V>> {\n /**\n * Get an existing entry in the map or add a new one if not found.\n *\n * @param key1 The first key\n * @param key2 The second key\n * @param create A callback to create the new entry when not found.\n * @param sentinel An optional sentinel value to use to indicate that the\n * entry is being created.\n */\n getOrAdd(key1: K1, key2: K2, create: () => V, sentinel?: V): V {\n let map = this.get(key1);\n if (map === undefined) {\n map = new Map();\n this.set(key1, map);\n }\n let entry = map.get(key2);\n if (entry === undefined) {\n if (sentinel !== undefined) {\n map.set(key2, sentinel);\n }\n entry = create();\n map.set(key2, entry);\n }\n return entry;\n }\n}\n\n// Adapted from https://github.com/microsoft/TypeScript/blob/bc52ff6f4be9347981de415a35da90497eae84ac/src/compiler/core.ts#L1507\nexport class Queue<T> {\n #elements: T[];\n #headIndex = 0;\n\n constructor(elements?: T[]) {\n this.#elements = elements?.slice() ?? [];\n }\n\n isEmpty(): boolean {\n return this.#headIndex === this.#elements.length;\n }\n\n enqueue(...items: T[]): void {\n this.#elements.push(...items);\n }\n\n dequeue(): T {\n if (this.isEmpty()) {\n throw new Error(\"Queue is empty.\");\n }\n\n const result = this.#elements[this.#headIndex];\n this.#elements[this.#headIndex] = undefined!; // Don't keep referencing dequeued item\n this.#headIndex++;\n\n // If more than half of the queue is empty, copy the remaining elements to the\n // front and shrink the array (unless we'd be saving fewer than 100 slots)\n if (this.#headIndex > 100 && this.#headIndex > this.#elements.length >> 1) {\n const newLength = this.#elements.length - this.#headIndex;\n this.#elements.copyWithin(0, this.#headIndex);\n this.#elements.length = newLength;\n this.#headIndex = 0;\n }\n\n return result;\n }\n}\n\n/**\n * The mutable equivalent of a type.\n */\n//prettier-ignore\nexport type Mutable<T> =\n T extends SymbolTable ? T & MutableSymbolTable :\n T extends ReadonlyMap<infer K, infer V> ? Map<K, V> :\n T extends ReadonlySet<infer T> ? Set<T> :\n T extends readonly (infer V)[] ? V[] :\n // brand to force explicit conversion.\n { -readonly [P in keyof T]: T[P] };\n\n//prettier-ignore\ntype MutableExt<T> =\nT extends SymbolTable ? T & MutableSymbolTable :\nT extends ReadonlyMap<infer K, infer V> ? Map<K, V> :\nT extends ReadonlySet<infer T> ? Set<T> :\nT extends readonly (infer V)[] ? V[] :\n// brand to force explicit conversion.\n{ -readonly [P in keyof T]: T[P] } & { __writableBrand: never };\n\n/**\n * Casts away readonly typing.\n *\n * Use it like this when it is safe to override readonly typing:\n * mutate(item).prop = value;\n */\nexport function mutate<T>(value: T): MutableExt<T> {\n return value as MutableExt<T>;\n}\n\nexport function createStringMap<T>(caseInsensitive: boolean): Map<string, T> {\n return caseInsensitive ? new CaseInsensitiveMap<T>() : new Map<string, T>();\n}\n\nclass CaseInsensitiveMap<T> extends Map<string, T> {\n get(key: string) {\n return super.get(key.toUpperCase());\n }\n set(key: string, value: T) {\n return super.set(key.toUpperCase(), value);\n }\n has(key: string) {\n return super.has(key.toUpperCase());\n }\n delete(key: string) {\n return super.delete(key.toUpperCase());\n }\n}\n\nexport function createRekeyableMap<K, V>(entries?: Iterable<[K, V]>): RekeyableMap<K, V> {\n return new RekeyableMapImpl<K, V>(entries);\n}\n\ninterface RekeyableMapKey<K> {\n key: K;\n}\n\nclass RekeyableMapImpl<K, V> implements RekeyableMap<K, V> {\n #keys = new Map<K, RekeyableMapKey<K>>();\n #values = new Map<RekeyableMapKey<K>, V>();\n\n constructor(entries?: Iterable<[K, V]>) {\n if (entries) {\n for (const [key, value] of entries) {\n this.set(key, value);\n }\n }\n }\n\n clear(): void {\n this.#keys.clear();\n this.#values.clear();\n }\n\n delete(key: K): boolean {\n const keyItem = this.#keys.get(key);\n if (keyItem) {\n this.#keys.delete(key);\n return this.#values.delete(keyItem);\n }\n return false;\n }\n\n forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n this.#values.forEach((value, keyItem) => {\n callbackfn(value, keyItem.key, this);\n }, thisArg);\n }\n\n get(key: K): V | undefined {\n const keyItem = this.#keys.get(key);\n return keyItem ? this.#values.get(keyItem) : undefined;\n }\n\n has(key: K): boolean {\n return this.#keys.has(key);\n }\n\n set(key: K, value: V): this {\n let keyItem = this.#keys.get(key);\n if (!keyItem) {\n keyItem = { key };\n this.#keys.set(key, keyItem);\n }\n\n this.#values.set(keyItem, value);\n return this;\n }\n\n get size() {\n return this.#values.size;\n }\n\n *entries(): MapIterator<[K, V]> {\n for (const [k, v] of this.#values) {\n yield [k.key, v];\n }\n }\n\n *keys(): MapIterator<K> {\n for (const k of this.#values.keys()) {\n yield k.key;\n }\n }\n\n values(): MapIterator<V> {\n return this.#values.values();\n }\n\n [Symbol.iterator](): MapIterator<[K, V]> {\n return this.entries();\n }\n\n [Symbol.toStringTag] = \"RekeyableMap\";\n\n rekey(existingKey: K, newKey: K): boolean {\n const keyItem = this.#keys.get(existingKey);\n if (!keyItem) {\n return false;\n }\n this.#keys.delete(existingKey);\n const newKeyItem = this.#keys.get(newKey);\n if (newKeyItem) {\n this.#values.delete(newKeyItem);\n }\n keyItem.key = newKey;\n this.#keys.set(newKey, keyItem);\n return true;\n }\n}\n\nexport function isPromise(value: unknown): value is Promise<unknown> {\n return !!value && typeof (value as any).then === \"function\";\n}\n\nexport function getEnvironmentVariable(\n envVarName: string,\n defaultWhenNotAvailable?: string,\n): string | undefined {\n // make sure we are fine in both node and browser environments\n if (typeof process !== \"undefined\") {\n return process?.env?.[envVarName] ?? defaultWhenNotAvailable;\n }\n return defaultWhenNotAvailable;\n}\n", "//\n// Generated by scripts/regen-nonascii-map.js\n// on node v18.16.0 with unicode 15.0.\n//\n\n/**\n * @internal\n *\n * Map of non-ascii characters that are valid in an identifier. Each pair of\n * numbers represents an inclusive range of code points.\n */\n//prettier-ignore\nexport const nonAsciiIdentifierMap: readonly number[] = [\n 0xa0, 0x377,\n 0x37a, 0x37f,\n 0x384, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x52f,\n 0x531, 0x556,\n 0x559, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5c7,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f4,\n 0x600, 0x70d,\n 0x70f, 0x74a,\n 0x74d, 0x7b1,\n 0x7c0, 0x7fa,\n 0x7fd, 0x82d,\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c,\n 0xf71, 0xf97,\n 0xf99, 0xfbc,\n 0xfbe, 0xfcc,\n 0xfce, 0xfda,\n 0x1000, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x135d, 0x137c,\n 0x1380, 0x1399,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1400, 0x169c,\n 0x16a0, 0x16f8,\n 0x1700, 0x1715,\n 0x171f, 0x1736,\n 0x1740, 0x1753,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1772, 0x1773,\n 0x1780, 0x17dd,\n 0x17e0, 0x17e9,\n 0x17f0, 0x17f9,\n 0x1800, 0x1819,\n 0x1820, 0x1878,\n 0x1880, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1920, 0x192b,\n 0x1930, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x19d0, 0x19da,\n 0x19de, 0x1a1b,\n 0x1a1e, 0x1a5e,\n 0x1a60, 0x1a7c,\n 0x1a7f, 0x1a89,\n 0x1a90, 0x1a99,\n 0x1aa0, 0x1aad,\n 0x1ab0, 0x1ace,\n 0x1b00, 0x1b4c,\n 0x1b50, 0x1b7e,\n 0x1b80, 0x1bf3,\n 0x1bfc, 0x1c37,\n 0x1c3b, 0x1c49,\n 0x1c4d, 0x1c88,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cc7,\n 0x1cd0, 0x1cfa,\n 0x1d00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fc4,\n 0x1fc6, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fdd, 0x1fef,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2027,\n 0x202a, 0x2064,\n 0x2066, 0x2071,\n 0x2074, 0x208e,\n 0x2090, 0x209c,\n 0x20a0, 0x20c0,\n 0x20d0, 0x20f0,\n 0x2100, 0x218b,\n 0x2190, 0x2426,\n 0x2440, 0x244a,\n 0x2460, 0x2b73,\n 0x2b76, 0x2b95,\n 0x2b97, 0x2cf3,\n 0x2cf9, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d70,\n 0x2d7f, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x2ffb,\n 0x3000, 0x303f,\n 0x3041, 0x3096,\n 0x3099, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x3190, 0x31e3,\n 0x31f0, 0x321e,\n 0x3220, 0xa48c,\n 0xa490, 0xa4c6,\n 0xa4d0, 0xa62b,\n 0xa640, 0xa6f7,\n 0xa700, 0xa7ca,\n 0xa7d0, 0xa7d1,\n 0xa7d3, 0xa7d3,\n 0xa7d5, 0xa7d9,\n 0xa7f2, 0xa82c,\n 0xa830, 0xa839,\n 0xa840, 0xa877,\n 0xa880, 0xa8c5,\n 0xa8ce, 0xa8d9,\n 0xa8e0, 0xa953,\n 0xa95f, 0xa97c,\n 0xa980, 0xa9cd,\n 0xa9cf, 0xa9d9,\n 0xa9de, 0xa9fe,\n 0xaa00, 0xaa36,\n 0xaa40, 0xaa4d,\n 0xaa50, 0xaa59,\n 0xaa5c, 0xaac2,\n 0xaadb, 0xaaf6,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab6b,\n 0xab70, 0xabed,\n 0xabf0, 0xabf9,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbc2,\n 0xfbd3, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdcf, 0xfdcf,\n 0xfdf0, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xfeff, 0xfeff,\n 0xff01, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff9, 0xfffc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10100, 0x10102,\n 0x10107, 0x10133,\n 0x10137, 0x1018e,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101d0, 0x101fd,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x102e0, 0x102fb,\n 0x10300, 0x10323,\n 0x1032d, 0x1034a,\n 0x10350, 0x1037a,\n 0x10380, 0x1039d,\n 0x1039f, 0x103c3,\n 0x103c8, 0x103d5,\n 0x10400, 0x1049d,\n 0x104a0, 0x104a9,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x1056f, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10857, 0x1089e,\n 0x108a7, 0x108af,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x108fb, 0x1091b,\n 0x1091f, 0x10939,\n 0x1093f, 0x1093f,\n 0x10980, 0x109b7,\n 0x109bc, 0x109cf,\n 0x109d2, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a48,\n 0x10a50, 0x10a58,\n 0x10a60, 0x10a9f,\n 0x10ac0, 0x10ae6,\n 0x10aeb, 0x10af6,\n 0x10b00, 0x10b35,\n 0x10b39, 0x10b55,\n 0x10b58, 0x10b72,\n 0x10b78, 0x10b91,\n 0x10b99, 0x10b9c,\n 0x10ba9, 0x10baf,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10cfa, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10e60, 0x10e7e,\n 0x10e80, 0x10ea9,\n 0x10eab, 0x10ead,\n 0x10eb0, 0x10eb1,\n 0x10efd, 0x10f27,\n 0x10f30, 0x10f59,\n 0x10f70, 0x10f89,\n 0x10fb0, 0x10fcb,\n 0x10fe0, 0x10ff6,\n 0x11000, 0x1104d,\n 0x11052, 0x11075,\n 0x1107f, 0x110c2,\n 0x110cd, 0x110cd,\n 0x110d0, 0x110e8,\n 0x110f0, 0x110f9,\n 0x11100, 0x11134,\n 0x11136, 0x11147,\n 0x11150, 0x11176,\n 0x11180, 0x111df,\n 0x111e1, 0x111f4,\n 0x11200, 0x11211,\n 0x11213, 0x11241,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a9,\n 0x112b0, 0x112ea,\n 0x112f0, 0x112f9,\n 0x11300, 0x11303,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133b, 0x11344,\n 0x11347, 0x11348,\n 0x1134b, 0x1134d,\n 0x11350, 0x11350,\n 0x11357, 0x11357,\n 0x1135d, 0x11363,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x11400, 0x1145b,\n 0x1145d, 0x11461,\n 0x11480, 0x114c7,\n 0x114d0, 0x114d9,\n 0x11580, 0x115b5,\n 0x115b8, 0x115dd,\n 0x11600, 0x11644,\n 0x11650, 0x11659,\n 0x11660, 0x1166c,\n 0x11680, 0x116b9,\n 0x116c0, 0x116c9,\n 0x11700, 0x1171a,\n 0x1171d, 0x1172b,\n 0x11730, 0x11746,\n 0x11800, 0x1183b,\n 0x118a0, 0x118f2,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x11935,\n 0x11937, 0x11938,\n 0x1193b, 0x11946,\n 0x11950, 0x11959,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d7,\n 0x119da, 0x119e4,\n 0x11a00, 0x11a47,\n 0x11a50, 0x11aa2,\n 0x11ab0, 0x11af8,\n 0x11b00, 0x11b09,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c36,\n 0x11c38, 0x11c45,\n 0x11c50, 0x11c6c,\n 0x11c70, 0x11c8f,\n 0x11c92, 0x11ca7,\n 0x11ca9, 0x11cb6,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d47,\n 0x11d50, 0x11d59,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d8e,\n 0x11d90, 0x11d91,\n 0x11d93, 0x11d98,\n 0x11da0, 0x11da9,\n 0x11ee0, 0x11ef8,\n 0x11f00, 0x11f10,\n 0x11f12, 0x11f3a,\n 0x11f3e, 0x11f59,\n 0x11fb0, 0x11fb0,\n 0x11fc0, 0x11ff1,\n 0x11fff, 0x12399,\n 0x12400, 0x1246e,\n 0x12470, 0x12474,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff2,\n 0x13000, 0x13455,\n 0x14400, 0x14646,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a60, 0x16a69,\n 0x16a6e, 0x16abe,\n 0x16ac0, 0x16ac9,\n 0x16ad0, 0x16aed,\n 0x16af0, 0x16af5,\n 0x16b00, 0x16b45,\n 0x16b50, 0x16b59,\n 0x16b5b, 0x16b61,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16e40, 0x16e9a,\n 0x16f00, 0x16f4a,\n 0x16f4f, 0x16f87,\n 0x16f8f, 0x16f9f,\n 0x16fe0, 0x16fe4,\n 0x16ff0, 0x16ff1,\n 0x17000, 0x187f7,\n 0x18800, 0x18cd5,\n 0x18d00, 0x18d08,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc6a,\n 0x1bc70, 0x1bc7c,\n 0x1bc80, 0x1bc88,\n 0x1bc90, 0x1bc99,\n 0x1bc9c, 0x1bca3,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1cf50, 0x1cfc3,\n 0x1d000, 0x1d0f5,\n 0x1d100, 0x1d126,\n 0x1d129, 0x1d1ea,\n 0x1d200, 0x1d245,\n 0x1d2c0, 0x1d2d3,\n 0x1d2e0, 0x1d2f3,\n 0x1d300, 0x1d356,\n 0x1d360, 0x1d378,\n 0x1d400, 0x1d454,\n 0x1d456, 0x1d49c,\n 0x1d49e, 0x1d49f,\n 0x1d4a2, 0x1d4a2,\n 0x1d4a5, 0x1d4a6,\n 0x1d4a9, 0x1d4ac,\n 0x1d4ae, 0x1d4b9,\n 0x1d4bb, 0x1d4bb,\n 0x1d4bd, 0x1d4c3,\n 0x1d4c5, 0x1d505,\n 0x1d507, 0x1d50a,\n 0x1d50d, 0x1d514,\n 0x1d516, 0x1d51c,\n 0x1d51e, 0x1d539,\n 0x1d53b, 0x1d53e,\n 0x1d540, 0x1d544,\n 0x1d546, 0x1d546,\n 0x1d54a, 0x1d550,\n 0x1d552, 0x1d6a5,\n 0x1d6a8, 0x1d7cb,\n 0x1d7ce, 0x1da8b,\n 0x1da9b, 0x1da9f,\n 0x1daa1, 0x1daaf,\n 0x1df00, 0x1df1e,\n 0x1df25, 0x1df2a,\n 0x1e000, 0x1e006,\n 0x1e008, 0x1e018,\n 0x1e01b, 0x1e021,\n 0x1e023, 0x1e024,\n 0x1e026, 0x1e02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 0x1f000, 0x1f02b,\n 0x1f030, 0x1f093,\n 0x1f0a0, 0x1f0ae,\n 0x1f0b1, 0x1f0bf,\n 0x1f0c1, 0x1f0cf,\n 0x1f0d1, 0x1f0f5,\n 0x1f100, 0x1f1ad,\n 0x1f1e6, 0x1f202,\n 0x1f210, 0x1f23b,\n 0x1f240, 0x1f248,\n 0x1f250, 0x1f251,\n 0x1f260, 0x1f265,\n 0x1f300, 0x1f6d7,\n 0x1f6dc, 0x1f6ec,\n 0x1f6f0, 0x1f6fc,\n 0x1f700, 0x1f776,\n 0x1f77b, 0x1f7d9,\n 0x1f7e0, 0x1f7eb,\n 0x1f7f0, 0x1f7f0,\n 0x1f800, 0x1f80b,\n 0x1f810, 0x1f847,\n 0x1f850, 0x1f859,\n 0x1f860, 0x1f887,\n 0x1f890, 0x1f8ad,\n 0x1f8b0, 0x1f8b1,\n 0x1f900, 0x1fa53,\n 0x1fa60, 0x1fa6d,\n 0x1fa70, 0x1fa7c,\n 0x1fa80, 0x1fa88,\n 0x1fa90, 0x1fabd,\n 0x1fabf, 0x1fac5,\n 0x1face, 0x1fadb,\n 0x1fae0, 0x1fae8,\n 0x1faf0, 0x1faf8,\n 0x1fb00, 0x1fb92,\n 0x1fb94, 0x1fbca,\n 0x1fbf0, 0x1fbf9,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b739,\n 0x2b740, 0x2b81d,\n 0x2b820, 0x2cea1,\n 0x2ceb0, 0x2ebe0,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x323af,\n 0xe0001, 0xe0001,\n 0xe0020, 0xe007f,\n 0xe0100, 0xe01ef,\n];\n", "import { nonAsciiIdentifierMap } from \"./nonascii.js\";\n\nexport const enum CharCode {\n Null = 0x00,\n MaxAscii = 0x7f,\n ByteOrderMark = 0xfeff,\n\n // Line breaks\n LineFeed = 0x0a,\n CarriageReturn = 0x0d,\n\n // ASCII whitespace excluding line breaks\n Space = 0x20,\n Tab = 0x09,\n VerticalTab = 0x0b,\n FormFeed = 0x0c,\n\n // Non-ASCII whitespace excluding line breaks\n NextLine = 0x0085, // not considered a line break\n LeftToRightMark = 0x200e,\n RightToLeftMark = 0x200f,\n LineSeparator = 0x2028,\n ParagraphSeparator = 0x2029,\n\n // ASCII Digits\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n\n // ASCII lowercase letters\n a = 0x61,\n b = 0x62,\n c = 0x63,\n d = 0x64,\n e = 0x65,\n f = 0x66,\n g = 0x67,\n h = 0x68,\n i = 0x69,\n j = 0x6a,\n k = 0x6b,\n l = 0x6c,\n m = 0x6d,\n n = 0x6e,\n o = 0x6f,\n p = 0x70,\n q = 0x71,\n r = 0x72,\n s = 0x73,\n t = 0x74,\n u = 0x75,\n v = 0x76,\n w = 0x77,\n x = 0x78,\n y = 0x79,\n z = 0x7a,\n\n // ASCII uppercase letters\n A = 0x41,\n B = 0x42,\n C = 0x43,\n D = 0x44,\n E = 0x45,\n F = 0x46,\n G = 0x47,\n H = 0x48,\n I = 0x49,\n J = 0x4a,\n K = 0x4b,\n L = 0x4c,\n M = 0x4d,\n N = 0x4e,\n O = 0x4f,\n P = 0x50,\n Q = 0x51,\n R = 0x52,\n S = 0x53,\n T = 0x54,\n U = 0x55,\n V = 0x56,\n W = 0x57,\n X = 0x58,\n Y = 0x59,\n Z = 0x5a,\n\n // Non-letter, non-digit ASCII characters that are valid in identifiers\n _ = 0x5f,\n $ = 0x24,\n\n // ASCII punctuation\n Ampersand = 0x26,\n Asterisk = 0x2a,\n At = 0x40,\n Backslash = 0x5c,\n Backtick = 0x60,\n Bar = 0x7c,\n Caret = 0x5e,\n CloseBrace = 0x7d,\n CloseBracket = 0x5d,\n CloseParen = 0x29,\n Colon = 0x3a,\n Comma = 0x2c,\n Dot = 0x2e,\n DoubleQuote = 0x22,\n Equals = 0x3d,\n Exclamation = 0x21,\n GreaterThan = 0x3e,\n Hash = 0x23,\n LessThan = 0x3c,\n Minus = 0x2d,\n OpenBrace = 0x7b,\n OpenBracket = 0x5b,\n OpenParen = 0x28,\n Percent = 0x25,\n Plus = 0x2b,\n Question = 0x3f,\n Semicolon = 0x3b,\n SingleQuote = 0x27,\n Slash = 0x2f,\n Tilde = 0x7e,\n}\n\nexport function utf16CodeUnits(codePoint: number) {\n return codePoint >= 0x10000 ? 2 : 1;\n}\n\nexport function isHighSurrogate(ch: number) {\n return ch >= 0xd800 && ch <= 0xdbff;\n}\n\nexport function isLowSurrogate(ch: number) {\n return ch >= 0xdc00 && ch <= 0xdfff;\n}\n\nexport function isLineBreak(ch: number) {\n return ch === CharCode.LineFeed || ch === CharCode.CarriageReturn;\n}\n\nexport function isAsciiWhiteSpaceSingleLine(ch: number) {\n return (\n ch === CharCode.Space ||\n ch === CharCode.Tab ||\n ch === CharCode.VerticalTab ||\n ch === CharCode.FormFeed\n );\n}\n\nexport function isNonAsciiWhiteSpaceSingleLine(ch: number) {\n return (\n ch === CharCode.NextLine || // not considered a line break\n ch === CharCode.LeftToRightMark ||\n ch === CharCode.RightToLeftMark ||\n ch === CharCode.LineSeparator ||\n ch === CharCode.ParagraphSeparator\n );\n}\n\nexport function isWhiteSpace(ch: number) {\n return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);\n}\n\nexport function isWhiteSpaceSingleLine(ch: number) {\n return (\n isAsciiWhiteSpaceSingleLine(ch) ||\n (ch > CharCode.MaxAscii && isNonAsciiWhiteSpaceSingleLine(ch))\n );\n}\n\nexport function trim(str: string): string {\n let start = 0;\n let end = str.length - 1;\n\n if (!isWhiteSpace(str.charCodeAt(start)) && !isWhiteSpace(str.charCodeAt(end))) {\n return str;\n }\n\n while (isWhiteSpace(str.charCodeAt(start))) {\n start++;\n }\n\n while (isWhiteSpace(str.charCodeAt(end))) {\n end--;\n }\n\n return str.substring(start, end + 1);\n}\n\nexport function isDigit(ch: number) {\n return ch >= CharCode._0 && ch <= CharCode._9;\n}\n\nexport function isHexDigit(ch: number) {\n return (\n isDigit(ch) || (ch >= CharCode.A && ch <= CharCode.F) || (ch >= CharCode.a && ch <= CharCode.f)\n );\n}\n\nexport function isBinaryDigit(ch: number) {\n return ch === CharCode._0 || ch === CharCode._1;\n}\n\nexport function isLowercaseAsciiLetter(ch: number) {\n return ch >= CharCode.a && ch <= CharCode.z;\n}\n\nexport function isAsciiIdentifierStart(ch: number) {\n return (\n (ch >= CharCode.A && ch <= CharCode.Z) ||\n (ch >= CharCode.a && ch <= CharCode.z) ||\n ch === CharCode.$ ||\n ch === CharCode._\n );\n}\n\nexport function isAsciiIdentifierContinue(ch: number) {\n return (\n (ch >= CharCode.A && ch <= CharCode.Z) ||\n (ch >= CharCode.a && ch <= CharCode.z) ||\n (ch >= CharCode._0 && ch <= CharCode._9) ||\n ch === CharCode.$ ||\n ch === CharCode._\n );\n}\n\nexport function isIdentifierStart(codePoint: number) {\n return (\n isAsciiIdentifierStart(codePoint) ||\n (codePoint > CharCode.MaxAscii && isNonAsciiIdentifierCharacter(codePoint))\n );\n}\n\nexport function isIdentifierContinue(codePoint: number) {\n return (\n isAsciiIdentifierContinue(codePoint) ||\n (codePoint > CharCode.MaxAscii && isNonAsciiIdentifierCharacter(codePoint))\n );\n}\n\nexport function isNonAsciiIdentifierCharacter(codePoint: number) {\n return lookupInNonAsciiMap(codePoint, nonAsciiIdentifierMap);\n}\n\nexport function codePointBefore(\n text: string,\n pos: number,\n): { char: number | undefined; size: number } {\n if (pos <= 0 || pos > text.length) {\n return { char: undefined, size: 0 };\n }\n\n const ch = text.charCodeAt(pos - 1);\n if (!isLowSurrogate(ch) || !isHighSurrogate(text.charCodeAt(pos - 2))) {\n return { char: ch, size: 1 };\n }\n\n return { char: text.codePointAt(pos - 2), size: 2 };\n}\n\nfunction lookupInNonAsciiMap(codePoint: number, map: readonly number[]) {\n // Perform binary search in one of the Unicode range maps\n let lo = 0;\n let hi: number = map.length;\n let mid: number;\n\n while (lo + 1 < hi) {\n mid = lo + (hi - lo) / 2;\n // mid has to be even to catch a range's beginning\n mid -= mid % 2;\n if (map[mid] <= codePoint && codePoint <= map[mid + 1]) {\n return true;\n }\n\n if (codePoint < map[mid]) {\n hi = mid;\n } else {\n lo = mid + 2;\n }\n }\n\n return false;\n}\n", "import { mutate } from \"../utils/misc.js\";\nimport type { Program } from \"./program.js\";\nimport type {\n Diagnostic,\n DiagnosticCreator,\n DiagnosticMap,\n DiagnosticMessages,\n DiagnosticReport,\n} from \"./types.js\";\n\n/**\n * Create a new diagnostics creator.\n * @param diagnostics Map of the potential diagnostics.\n * @param libraryName Optional name of the library if in the scope of a library.\n * @returns @see DiagnosticCreator\n */\nexport function createDiagnosticCreator<T extends { [code: string]: DiagnosticMessages }>(\n diagnostics: DiagnosticMap<T>,\n libraryName?: string,\n): DiagnosticCreator<T> {\n const errorMessage = libraryName\n ? `It must match one of the code defined in the library '${libraryName}'`\n : \"It must match one of the code defined in the compiler.\";\n\n function createDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n diagnostic: DiagnosticReport<T, C, M>,\n ): Diagnostic {\n const diagnosticDef = diagnostics[diagnostic.code];\n\n if (!diagnosticDef) {\n const codeStr = Object.keys(diagnostics)\n .map((x) => ` - ${x}`)\n .join(\"\\n\");\n const code = String(diagnostic.code);\n throw new Error(\n `Unexpected diagnostic code '${code}'. ${errorMessage}. Defined codes:\\n${codeStr}`,\n );\n }\n\n const message = diagnosticDef.messages[diagnostic.messageId ?? \"default\"];\n if (!message) {\n const codeStr = Object.keys(diagnosticDef.messages)\n .map((x) => ` - ${x}`)\n .join(\"\\n\");\n const messageId = String(diagnostic.messageId);\n const code = String(diagnostic.code);\n throw new Error(\n `Unexpected message id '${messageId}'. ${errorMessage} for code '${code}'. Defined codes:\\n${codeStr}`,\n );\n }\n\n const messageStr = typeof message === \"string\" ? message : message((diagnostic as any).format);\n\n const result: Diagnostic = {\n code: libraryName ? `${libraryName}/${String(diagnostic.code)}` : diagnostic.code.toString(),\n severity: diagnosticDef.severity,\n message: messageStr,\n target: diagnostic.target,\n };\n if (diagnosticDef.url) {\n mutate(result).url = diagnosticDef.url;\n }\n if (diagnostic.codefixes) {\n mutate(result).codefixes = diagnostic.codefixes;\n }\n return result;\n }\n\n function reportDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n program: Program,\n diagnostic: DiagnosticReport<T, C, M>,\n ) {\n const diag = createDiagnostic(diagnostic);\n program.reportDiagnostic(diag);\n }\n\n return {\n diagnostics,\n createDiagnostic,\n reportDiagnostic,\n } as any;\n}\n", "import type { CallableMessage } from \"./types.js\";\n\nexport function paramMessage<const T extends string[]>(\n strings: readonly string[],\n ...keys: T\n): CallableMessage<T> {\n const template = (dict: Record<T[number], string>) => {\n const result = [strings[0]];\n keys.forEach((key, i) => {\n const value = (dict as any)[key];\n if (value !== undefined) {\n result.push(value);\n }\n result.push(strings[i + 1]);\n });\n return result.join(\"\");\n };\n template.keys = keys;\n return template;\n}\n", "// Static assert: this won't compile if one of the entries above is invalid.\nimport { createDiagnosticCreator } from \"./diagnostic-creator.js\";\nimport { paramMessage } from \"./param-message.js\";\nimport type { TypeOfDiagnostics } from \"./types.js\";\n\nconst diagnostics = {\n /**\n * Scanner errors.\n */\n \"digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Digit expected.\",\n },\n },\n\n \"hex-digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Hexadecimal digit expected.\",\n },\n },\n\n \"binary-digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Binary digit expected.\",\n },\n },\n\n unterminated: {\n severity: \"error\",\n messages: {\n default: paramMessage`Unterminated ${\"token\"}.`,\n },\n },\n \"creating-file\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Error creating single file: ${\"filename\"}, ${\"error\"}`,\n },\n },\n\n \"invalid-escape-sequence\": {\n severity: \"error\",\n messages: {\n default: \"Invalid escape sequence.\",\n },\n },\n\n \"no-new-line-start-triple-quote\": {\n severity: \"error\",\n messages: {\n default: \"String content in triple quotes must begin on a new line.\",\n },\n },\n\n \"no-new-line-end-triple-quote\": {\n severity: \"error\",\n messages: {\n default: \"Closing triple quotes must begin on a new line.\",\n },\n },\n\n \"triple-quote-indent\": {\n severity: \"error\",\n description:\n \"Report when a triple-quoted string has lines with less indentation as the closing triple quotes.\",\n url: \"https://typespec.io/docs/standard-library/diags/triple-quote-indent\",\n messages: {\n default:\n \"All lines in triple-quoted string lines must have the same indentation as closing triple quotes.\",\n },\n },\n\n \"invalid-character\": {\n severity: \"error\",\n messages: {\n default: \"Invalid character.\",\n },\n },\n\n /**\n * Utils\n */\n \"file-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`File ${\"path\"} not found.`,\n },\n },\n \"file-load\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"message\"}`,\n },\n },\n\n /**\n * Init templates\n */\n \"init-template-invalid-json\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Unable to parse ${\"url\"}: ${\"message\"}. Check that the template URL is correct.`,\n },\n },\n \"init-template-download-failed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Failed to download template from ${\"url\"}: ${\"message\"}. Check that the template URL is correct.`,\n },\n },\n\n /**\n * Parser errors.\n */\n \"multiple-blockless-namespace\": {\n severity: \"error\",\n messages: {\n default: \"Cannot use multiple blockless namespaces.\",\n },\n },\n \"blockless-namespace-first\": {\n severity: \"error\",\n messages: {\n default: \"Blockless namespaces can't follow other declarations.\",\n topLevel: \"Blockless namespace can only be top-level.\",\n },\n },\n \"import-first\": {\n severity: \"error\",\n messages: {\n default: \"Imports must come prior to namespaces or other declarations.\",\n topLevel: \"Imports must be top-level and come prior to namespaces or other declarations.\",\n },\n },\n \"token-expected\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"token\"} expected.`,\n unexpected: paramMessage`Unexpected token ${\"token\"}`,\n numericOrStringLiteral: \"Expected numeric or string literal.\",\n identifier: \"Identifier expected.\",\n expression: \"Expression expected.\",\n statement: \"Statement expected.\",\n property: \"Property expected.\",\n enumMember: \"Enum member expected.\",\n typeofTarget: \"Typeof expects a value literal or value reference.\",\n },\n },\n \"unknown-directive\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Unknown directive '#${\"id\"}'`,\n },\n },\n \"augment-decorator-target\": {\n severity: \"error\",\n messages: {\n default: `Augment decorator first argument must be a type reference.`,\n noInstance: `Cannot reference template instances.`,\n noModelExpression: `Cannot augment model expressions.`,\n noUnionExpression: `Cannot augment union expressions.`,\n },\n },\n \"duplicate-decorator\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} cannot be used twice on the same declaration.`,\n },\n },\n \"decorator-conflict\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} cannot be used with decorator ${\"otherDecoratorName\"} on the same declaration.`,\n },\n },\n \"reserved-identifier\": {\n severity: \"error\",\n messages: {\n default: \"Keyword cannot be used as identifier.\",\n future: paramMessage`${\"name\"} is a reserved keyword`,\n },\n },\n \"invalid-directive-location\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot place directive on ${\"nodeName\"}.`,\n },\n },\n \"invalid-decorator-location\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot decorate ${\"nodeName\"}.`,\n },\n },\n \"default-required\": {\n severity: \"error\",\n messages: {\n default: \"Required template parameters must not follow optional template parameters\",\n },\n },\n \"invalid-template-argument-name\": {\n severity: \"error\",\n messages: {\n default: \"Template parameter argument names must be valid, bare identifiers.\",\n },\n },\n \"invalid-template-default\": {\n severity: \"error\",\n messages: {\n default:\n \"Template parameter defaults can only reference previously declared type parameters.\",\n },\n },\n \"required-parameter-first\": {\n severity: \"error\",\n messages: {\n default: \"A required parameter cannot follow an optional parameter.\",\n },\n },\n \"rest-parameter-last\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter must be last in a parameter list.\",\n },\n },\n \"rest-parameter-required\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter cannot be optional.\",\n },\n },\n /**\n * Parser doc comment warnings.\n * Design goal: Malformed doc comments should only produce warnings, not errors.\n */\n \"doc-invalid-identifier\": {\n severity: \"warning\",\n messages: {\n default: \"Invalid identifier.\",\n tag: \"Invalid tag name. Use backticks around code if this was not meant to be a tag.\",\n param: \"Invalid parameter name.\",\n prop: \"Invalid property name.\",\n templateParam: \"Invalid template parameter name.\",\n },\n },\n /**\n * Checker\n */\n \"using-invalid-ref\": {\n severity: \"error\",\n messages: {\n default: \"Using must refer to a namespace\",\n },\n },\n \"invalid-type-ref\": {\n severity: \"error\",\n messages: {\n default: \"Invalid type reference\",\n decorator: \"Can't put a decorator in a type\",\n function: \"Can't use a function as a type\",\n },\n },\n \"invalid-template-args\": {\n severity: \"error\",\n messages: {\n default: \"Invalid template arguments.\",\n notTemplate: \"Can't pass template arguments to non-templated type\",\n tooMany: \"Too many template arguments provided.\",\n unknownName: paramMessage`No parameter named '${\"name\"}' exists in the target template.`,\n positionalAfterNamed:\n \"Positional template arguments cannot follow named arguments in the same argument list.\",\n missing: paramMessage`Template argument '${\"name\"}' is required and not specified.`,\n specifiedAgain: paramMessage`Cannot specify template argument '${\"name\"}' again.`,\n },\n },\n \"intersect-non-model\": {\n severity: \"error\",\n messages: {\n default: \"Cannot intersect non-model types (including union types).\",\n },\n },\n \"intersect-invalid-index\": {\n severity: \"error\",\n messages: {\n default: \"Cannot intersect incompatible models.\",\n never: \"Cannot intersect a model that cannot hold properties.\",\n array: \"Cannot intersect an array model.\",\n },\n },\n \"incompatible-indexer\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property is incompatible with indexer:\\n${\"message\"}`,\n },\n },\n \"no-array-properties\": {\n severity: \"error\",\n messages: {\n default: \"Array models cannot have any properties.\",\n },\n },\n \"intersect-duplicate-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Intersection contains duplicate property definitions for ${\"propName\"}`,\n },\n },\n \"invalid-decorator\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"id\"} is not a decorator`,\n },\n },\n \"invalid-ref\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot resolve ${\"id\"}`,\n identifier: paramMessage`Unknown identifier ${\"id\"}`,\n decorator: paramMessage`Unknown decorator @${\"id\"}`,\n inDecorator: paramMessage`Cannot resolve ${\"id\"} in decorator`,\n underNamespace: paramMessage`Namespace ${\"namespace\"} doesn't have member ${\"id\"}`,\n member: paramMessage`${\"kind\"} doesn't have member ${\"id\"}`,\n metaProperty: paramMessage`${\"kind\"} doesn't have meta property ${\"id\"}`,\n node: paramMessage`Cannot resolve '${\"id\"}' in node ${\"nodeName\"} since it has no members. Did you mean to use \"::\" instead of \".\"?`,\n },\n },\n \"duplicate-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Model already has a property named ${\"propName\"}`,\n },\n },\n \"override-property-mismatch\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Model has an inherited property named ${\"propName\"} of type ${\"propType\"} which cannot override type ${\"parentType\"}`,\n disallowedOptionalOverride: paramMessage`Model has a required inherited property named ${\"propName\"} which cannot be overridden as optional`,\n },\n },\n \"extend-scalar\": {\n severity: \"error\",\n messages: {\n default: \"Scalar must extend other scalars.\",\n },\n },\n \"extend-model\": {\n severity: \"error\",\n messages: {\n default: \"Models must extend other models.\",\n modelExpression: \"Models cannot extend model expressions.\",\n },\n },\n \"is-model\": {\n severity: \"error\",\n messages: {\n default: \"Model `is` must specify another model.\",\n modelExpression: \"Model `is` cannot specify a model expression.\",\n },\n },\n \"is-operation\": {\n severity: \"error\",\n messages: {\n default: \"Operation can only reuse the signature of another operation.\",\n },\n },\n \"spread-model\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread properties of non-model type.\",\n neverIndex: \"Cannot spread type because it cannot hold properties.\",\n selfSpread: \"Cannot spread type within its own declaration.\",\n },\n },\n\n \"unsupported-default\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Default must be have a value type but has type '${\"type\"}'.`,\n },\n },\n \"spread-object\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread properties of non-object type.\",\n },\n },\n \"expect-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"name\"} refers to a type, but is being used as a value here.`,\n model: paramMessage`${\"name\"} refers to a model type, but is being used as a value here. Use #{} to create an object value.`,\n modelExpression: `Is a model expression type, but is being used as a value here. Use #{} to create an object value.`,\n tuple: `Is a tuple type, but is being used as a value here. Use #[] to create an array value.`,\n templateConstraint: paramMessage`${\"name\"} template parameter can be a type but is being used as a value here.`,\n },\n },\n \"non-callable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type ${\"type\"} is not is not callable.`,\n },\n },\n \"named-init-required\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Only scalar deriving from 'string', 'numeric' or 'boolean' can be instantited without a named constructor.`,\n },\n },\n \"invalid-primitive-init\": {\n severity: \"error\",\n messages: {\n default: `Instantiating scalar deriving from 'string', 'numeric' or 'boolean' can only take a single argument.`,\n invalidArg: paramMessage`Expected a single argument of type ${\"expected\"} but got ${\"actual\"}.`,\n },\n },\n \"ambiguous-scalar-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Value ${\"value\"} type is ambiguous between ${\"types\"}. To resolve be explicit when instantiating this value(e.g. '${\"example\"}(${\"value\"})').`,\n },\n },\n unassignable: {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"sourceType\"}' is not assignable to type '${\"targetType\"}'`,\n },\n },\n \"property-unassignable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Types of property '${\"propName\"}' are incompatible`,\n },\n },\n \"property-required\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' is required in type '${\"targetType\"}' but here is optional.`,\n },\n },\n \"value-in-type\": {\n severity: \"error\",\n messages: {\n default: \"A value cannot be used as a type.\",\n referenceTemplate: \"Template parameter can be passed values but is used as a type.\",\n noTemplateConstraint:\n \"Template parameter has no constraint but a value is passed. Add `extends valueof unknown` to accept any value.\",\n },\n },\n \"no-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' cannot be defined because model cannot hold properties.`,\n },\n },\n \"missing-index\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Index signature for type '${\"indexType\"}' is missing in type '${\"sourceType\"}'.`,\n },\n },\n \"missing-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propertyName\"}' is missing on type '${\"sourceType\"}' but required in '${\"targetType\"}'`,\n },\n },\n \"unexpected-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Object value may only specify known properties, and '${\"propertyName\"}' does not exist in type '${\"type\"}'.`,\n },\n },\n \"extends-interface\": {\n severity: \"error\",\n messages: {\n default: \"Interfaces can only extend other interfaces\",\n },\n },\n \"extends-interface-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Interface extends cannot have duplicate members. The duplicate member is named ${\"name\"}`,\n },\n },\n \"interface-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Interface already has a member named ${\"name\"}`,\n },\n },\n \"union-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Union already has a variant named ${\"name\"}`,\n },\n },\n \"enum-member-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Enum already has a member named ${\"name\"}`,\n },\n },\n \"constructor-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`A constructor already exists with name ${\"name\"}`,\n },\n },\n \"spread-enum\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread members of non-enum type.\",\n },\n },\n \"decorator-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} failed!\\n\\n${\"error\"}`,\n },\n },\n \"rest-parameter-array\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter must be of an array type.\",\n },\n },\n \"decorator-extern\": {\n severity: \"error\",\n messages: {\n default: \"A decorator declaration must be prefixed with the 'extern' modifier.\",\n },\n },\n \"function-extern\": {\n severity: \"error\",\n messages: {\n default: \"A function declaration must be prefixed with the 'extern' modifier.\",\n },\n },\n \"function-unsupported\": {\n severity: \"error\",\n messages: {\n default: \"Function are currently not supported.\",\n },\n },\n \"missing-implementation\": {\n severity: \"error\",\n messages: {\n default: \"Extern declaration must have an implementation in JS file.\",\n },\n },\n \"overload-same-parent\": {\n severity: \"error\",\n messages: {\n default: `Overload must be in the same interface or namespace.`,\n },\n },\n shadow: {\n severity: \"warning\",\n messages: {\n default: paramMessage`Shadowing parent template parameter with the same name \"${\"name\"}\"`,\n },\n },\n \"invalid-deprecation-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`#deprecation directive is expecting a string literal as the message but got a \"${\"kind\"}\"`,\n missing: \"#deprecation directive is expecting a message argument but none was provided.\",\n },\n },\n \"duplicate-deprecation\": {\n severity: \"warning\",\n messages: {\n default: \"The #deprecated directive cannot be used more than once on the same declaration.\",\n },\n },\n\n /**\n * Configuration\n */\n \"config-invalid-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Argument \"${\"name\"}\" is not defined as a parameter in the config.`,\n },\n },\n \"config-circular-variable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`There is a circular reference to variable \"${\"name\"}\" in the cli configuration or arguments.`,\n },\n },\n \"config-path-absolute\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Path \"${\"path\"}\" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,\n },\n },\n \"config-invalid-name\": {\n severity: \"error\",\n messages: {\n default: paramMessage`The configuration name \"${\"name\"}\" is invalid because it contains a dot (\".\"). Using a dot will conflict with using nested configuration values.`,\n },\n },\n \"path-unix-style\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Path should use unix style separators. Use \"/\" instead of \"\\\\\".`,\n },\n },\n \"config-path-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`No configuration file found at config path \"${\"path\"}\".`,\n },\n },\n /**\n * Program\n */\n \"dynamic-import\": {\n severity: \"error\",\n messages: {\n default: \"Dynamically generated TypeSpec cannot have imports\",\n },\n },\n \"invalid-import\": {\n severity: \"error\",\n messages: {\n default: \"Import paths must reference either a directory, a .tsp file, or .js file\",\n },\n },\n \"invalid-main\": {\n severity: \"error\",\n messages: {\n default: \"Main file must either be a .tsp file or a .js file.\",\n },\n },\n \"import-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Couldn't resolve import \"${\"path\"}\"`,\n },\n },\n \"library-invalid\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Library \"${\"path\"}\" is invalid: ${\"message\"}`,\n },\n },\n \"incompatible-library\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Multiple versions of \"${\"name\"}\" library were loaded:\\n${\"versionMap\"}`,\n },\n },\n \"compiler-version-mismatch\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Current TypeSpec compiler conflicts with local version of @typespec/compiler referenced in ${\"basedir\"}. \\nIf this warning occurs on the command line, try running \\`typespec\\` with a working directory of ${\"basedir\"}. \\nIf this warning occurs in the IDE, try configuring the \\`tsp-server\\` path to ${\"betterTypeSpecServerPath\"}.\\n Expected: ${\"expected\"}\\n Resolved: ${\"actual\"}`,\n },\n },\n \"duplicate-symbol\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Duplicate name: \"${\"name\"}\"`,\n },\n },\n \"decorator-decl-target\": {\n severity: \"error\",\n messages: {\n default: \"dec must have at least one parameter.\",\n required: \"dec first parameter must be required.\",\n },\n },\n \"mixed-string-template\": {\n severity: \"error\",\n messages: {\n default:\n \"String template is interpolating values and types. It must be either all values to produce a string value or or all types for string template type.\",\n },\n },\n \"non-literal-string-template\": {\n severity: \"error\",\n messages: {\n default:\n \"Value interpolated in this string template cannot be converted to a string. Only literal types can be automatically interpolated.\",\n },\n },\n\n /**\n * Binder\n */\n \"ambiguous-symbol\": {\n severity: \"error\",\n messages: {\n default: paramMessage`\"${\"name\"}\" is an ambiguous name between ${\"duplicateNames\"}. Try using fully qualified name instead: ${\"duplicateNames\"}`,\n },\n },\n \"duplicate-using\": {\n severity: \"error\",\n messages: {\n default: paramMessage`duplicate using of \"${\"usingName\"}\" namespace`,\n },\n },\n\n /**\n * Library\n */\n \"on-validate-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`onValidate failed with errors. ${\"error\"}`,\n },\n },\n \"invalid-emitter\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Requested emitter package ${\"emitterPackage\"} does not provide an \"$onEmit\" function.`,\n },\n },\n \"js-error\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Failed to load ${\"specifier\"} due to the following JS error: ${\"error\"}`,\n },\n },\n \"missing-import\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Emitter '${\"emitterName\"}' requires '${\"requiredImport\"}' to be imported. Add 'import \"${\"requiredImport\"}\".`,\n },\n },\n\n /**\n * Linter\n */\n \"invalid-rule-ref\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Reference \"${\"ref\"}\" is not a valid reference to a rule or ruleset. It must be in the following format: \"<library-name>:<rule-name>\"`,\n },\n },\n \"unknown-rule\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule \"${\"ruleName\"}\" is not found in library \"${\"libraryName\"}\"`,\n },\n },\n \"unknown-rule-set\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule set \"${\"ruleSetName\"}\" is not found in library \"${\"libraryName\"}\"`,\n },\n },\n \"rule-enabled-disabled\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule \"${\"ruleName\"}\" has been enabled and disabled in the same ruleset.`,\n },\n },\n\n /**\n * Formatter\n */\n \"format-failed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`File '${\"file\"}' failed to format. ${\"details\"}`,\n },\n },\n\n /**\n * Decorator\n */\n \"invalid-pattern-regex\": {\n severity: \"warning\",\n messages: {\n default: \"@pattern decorator expects a valid regular expression pattern.\",\n },\n },\n\n \"decorator-wrong-target\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot apply ${\"decorator\"} decorator to ${\"to\"}`,\n withExpected: paramMessage`Cannot apply ${\"decorator\"} decorator to ${\"to\"} since it is not assignable to ${\"expected\"}`,\n },\n },\n \"invalid-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Argument of type '${\"value\"}' is not assignable to parameter of type '${\"expected\"}'`,\n },\n },\n \"invalid-argument-count\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Expected ${\"expected\"} arguments, but got ${\"actual\"}.`,\n atLeast: paramMessage`Expected at least ${\"expected\"} arguments, but got ${\"actual\"}.`,\n },\n },\n \"known-values-invalid-enum\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Enum cannot be used on this type. Member ${\"member\"} is not assignable to type ${\"type\"}.`,\n },\n },\n \"invalid-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"kind\"}' is not a value type.`,\n atPath: paramMessage`Type '${\"kind\"}' of '${\"path\"}' is not a value type.`,\n },\n },\n deprecated: {\n severity: \"warning\",\n messages: {\n default: paramMessage`Deprecated: ${\"message\"}`,\n },\n },\n \"no-optional-key\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propertyName\"}' marked as key cannot be optional.`,\n },\n },\n \"invalid-discriminated-union\": {\n severity: \"error\",\n messages: {\n default: \"\",\n noAnonVariants: \"Unions with anonymous variants cannot be discriminated\",\n },\n },\n \"invalid-discriminated-union-variant\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Union variant \"${\"name\"}\" must be a model type.`,\n noEnvelopeModel: paramMessage`Union variant \"${\"name\"}\" must be a model type when the union has envelope: none.`,\n discriminantMismatch: paramMessage`Variant \"${\"name\"}\" explicitly defines the discriminator property \"${\"discriminant\"}\" but the value \"${\"propertyValue\"}\" do not match the variant name \"${\"variantName\"}\".`,\n duplicateDefaultVariant: `Discriminated union only allow a single default variant(Without a variant name).`,\n noDiscriminant: paramMessage`Variant \"${\"name\"}\" type is missing the discriminant property \"${\"discriminant\"}\".`,\n wrongDiscriminantType: paramMessage`Variant \"${\"name\"}\" type's discriminant property \"${\"discriminant\"}\" must be a string literal or string enum member.`,\n },\n },\n \"missing-discriminator-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Each derived model of a discriminated model type should have set the discriminator property(\"${\"discriminator\"}\") or have a derived model which has. Add \\`${\"discriminator\"}: \"<discriminator-value>\"\\``,\n },\n },\n \"invalid-discriminator-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Discriminator value should be a string, union of string or string enum but was ${\"kind\"}.`,\n required: \"The discriminator property must be a required property.\",\n duplicate: paramMessage`Discriminator value \"${\"discriminator\"}\" is already used in another variant.`,\n },\n },\n\n \"invalid-encode\": {\n severity: \"error\",\n messages: {\n default: \"Invalid encoding\",\n wrongType: paramMessage`Encoding '${\"encoding\"}' cannot be used on type '${\"type\"}'. Expected: ${\"expected\"}.`,\n wrongEncodingType: paramMessage`Encoding '${\"encoding\"}' on type '${\"type\"}' is expected to be serialized as '${\"expected\"}' but got '${\"actual\"}'.`,\n wrongNumericEncodingType: paramMessage`Encoding '${\"encoding\"}' on type '${\"type\"}' is expected to be serialized as '${\"expected\"}' but got '${\"actual\"}'. Set '@encode' 2nd parameter to be of type ${\"expected\"}. e.g. '@encode(\"${\"encoding\"}\", int32)'`,\n firstArg: `First argument of \"@encode\" must be the encoding name or the string type when encoding numeric types.`,\n },\n },\n\n \"invalid-mime-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Invalid mime type '${\"mimeType\"}'`,\n },\n },\n \"no-mime-type-suffix\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot use mime type '${\"mimeType\"}' with suffix '${\"suffix\"}'. Use a simple mime \\`type/subtype\\` instead.`,\n },\n },\n \"encoded-name-conflict\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Encoded name '${\"name\"}' conflicts with existing member name for mime type '${\"mimeType\"}'`,\n duplicate: paramMessage`Same encoded name '${\"name\"}' is used for 2 members '${\"mimeType\"}'`,\n },\n },\n\n \"incompatible-paging-props\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paging property has multiple types: '${\"kinds\"}'`,\n },\n },\n \"invalid-paging-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paging property '${\"kind\"}' is not valid in this context.`,\n input: paramMessage`Paging property '${\"kind\"}' cannot be used in the parameters of an operation.`,\n output: paramMessage`Paging property '${\"kind\"}' cannot be used in the return type of an operation.`,\n },\n },\n \"duplicate-paging-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Duplicate property paging '${\"kind\"}' for operation ${\"operationName\"}.`,\n },\n },\n \"missing-paging-items\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paged operation '${\"operationName\"}' return type must have a property annotated with @pageItems.`,\n },\n },\n /**\n * Service\n */\n \"service-decorator-duplicate\": {\n severity: \"error\",\n messages: {\n default: `@service can only be set once per TypeSpec document.`,\n },\n },\n \"list-type-not-model\": {\n severity: \"error\",\n messages: {\n default: \"@list decorator's parameter must be a model type.\",\n },\n },\n \"invalid-range\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Range \"${\"start\"}..${\"end\"}\" is invalid.`,\n },\n },\n\n /**\n * Mutator\n */\n \"add-response\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a response to anything except an operation statement.\",\n },\n },\n \"add-parameter\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a parameter to anything except an operation statement.\",\n },\n },\n \"add-model-property\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a model property to anything except a model statement.\",\n },\n },\n \"add-model-property-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Could not add property/parameter \"${\"propertyName\"}\" of type \"${\"propertyTypeName\"}\"`,\n },\n },\n \"add-response-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Could not add response type \"${\"responseTypeName\"}\" to operation ${\"operationName\"}\"`,\n },\n },\n \"circular-base-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"typeName\"}' recursively references itself as a base type.`,\n },\n },\n \"circular-constraint\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type parameter '${\"typeName\"}' has a circular constraint.`,\n },\n },\n \"circular-op-signature\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Operation '${\"typeName\"}' recursively references itself.`,\n },\n },\n \"circular-alias-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Alias type '${\"typeName\"}' recursively references itself.`,\n },\n },\n \"circular-const\": {\n severity: \"error\",\n messages: {\n default: paramMessage`const '${\"name\"}' recursively references itself.`,\n },\n },\n \"circular-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' recursively references itself.`,\n },\n },\n \"conflict-marker\": {\n severity: \"error\",\n messages: {\n default: \"Conflict marker encountered.\",\n },\n },\n\n // #region Visibility\n \"visibility-sealed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Visibility of property '${\"propName\"}' is sealed and cannot be changed.`,\n },\n },\n \"default-visibility-not-member\": {\n severity: \"error\",\n messages: {\n default: \"The default visibility modifiers of a class must be members of the class enum.\",\n },\n },\n \"operation-visibility-constraint-empty\": {\n severity: \"error\",\n messages: {\n default: \"Operation visibility constraints with no arguments are not allowed.\",\n returnType: \"Return type visibility constraints with no arguments are not allowed.\",\n parameter:\n \"Parameter visibility constraints with no arguments are not allowed. To disable effective PATCH optionality, use @patch(#{ implicitOptionality: false }) instead.\",\n },\n },\n // #endregion\n\n // #region CLI\n \"no-compatible-vs-installed\": {\n severity: \"error\",\n messages: {\n default: \"No compatible version of Visual Studio found.\",\n },\n },\n \"vs-extension-windows-only\": {\n severity: \"error\",\n messages: {\n default: \"Visual Studio extension is not supported on non-Windows.\",\n },\n },\n \"vscode-in-path\": {\n severity: \"error\",\n messages: {\n default:\n \"Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.\",\n osx: \"Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.\\nSee instruction for Mac OS here https://code.visualstudio.com/docs/setup/mac\",\n },\n },\n \"invalid-option-flag\": {\n severity: \"error\",\n messages: {\n default: paramMessage`The --option parameter value \"${\"value\"}\" must be in the format: <emitterName>.some-options=value`,\n },\n },\n // #endregion CLI\n} as const;\n\nexport type CompilerDiagnostics = TypeOfDiagnostics<typeof diagnostics>;\nexport const { createDiagnostic, reportDiagnostic } = createDiagnosticCreator(diagnostics);\n", "import { CharCode, isIdentifierContinue, isIdentifierStart, utf16CodeUnits } from \"../charcode.js\";\nimport { Keywords, ReservedKeywords } from \"../scanner.js\";\nimport { IdentifierNode, MemberExpressionNode, SyntaxKind, TypeReferenceNode } from \"../types.js\";\n\n/**\n * Print a string as a TypeSpec identifier. If the string is a valid identifier, return it as is otherwise wrap it into backticks.\n * @param sv Identifier string value.\n * @returns Identifier string as it would be represented in a TypeSpec file.\n *\n * @example\n * ```ts\n * printIdentifier(\"foo\") // foo\n * printIdentifier(\"foo bar\") // `foo bar`\n * ```\n */\nexport function printIdentifier(\n sv: string,\n /** @internal */ context: \"allow-reserved\" | \"disallow-reserved\" = \"disallow-reserved\",\n) {\n if (needBacktick(sv, context)) {\n const escapedString = sv\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/`/g, \"\\\\`\");\n return `\\`${escapedString}\\``;\n } else {\n return sv;\n }\n}\n\nfunction needBacktick(sv: string, context: \"allow-reserved\" | \"disallow-reserved\"): boolean {\n if (sv.length === 0) {\n return false;\n }\n if (context === \"allow-reserved\" && ReservedKeywords.has(sv)) {\n return false;\n }\n if (Keywords.has(sv)) {\n return true;\n }\n let cp = sv.codePointAt(0)!;\n if (!isIdentifierStart(cp)) {\n return true;\n }\n let pos = 0;\n do {\n pos += utf16CodeUnits(cp);\n } while (pos < sv.length && isIdentifierContinue((cp = sv.codePointAt(pos)!)));\n return pos < sv.length;\n}\n\nexport function typeReferenceToString(\n node: TypeReferenceNode | MemberExpressionNode | IdentifierNode,\n): string {\n switch (node.kind) {\n case SyntaxKind.MemberExpression:\n return `${typeReferenceToString(node.base)}${node.selector}${typeReferenceToString(node.id)}`;\n case SyntaxKind.TypeReference:\n return typeReferenceToString(node.target);\n case SyntaxKind.Identifier:\n return node.sv;\n }\n}\n\nexport function splitLines(text: string): string[] {\n const lines = [];\n let start = 0;\n let pos = 0;\n\n while (pos < text.length) {\n const ch = text.charCodeAt(pos);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (text.charCodeAt(pos + 1) === CharCode.LineFeed) {\n lines.push(text.slice(start, pos));\n start = pos + 2;\n pos++;\n } else {\n lines.push(text.slice(start, pos));\n start = pos + 1;\n }\n break;\n case CharCode.LineFeed:\n lines.push(text.slice(start, pos));\n start = pos + 1;\n break;\n }\n pos++;\n }\n\n lines.push(text.slice(start));\n return lines;\n}\n", "import { isWhiteSpaceSingleLine } from \"../charcode.js\";\nimport { defineCodeFix } from \"../diagnostics.js\";\nimport { splitLines } from \"../helpers/syntax-utils.js\";\nimport type { SourceLocation } from \"../types.js\";\n\nexport function createTripleQuoteIndentCodeFix(location: SourceLocation) {\n return defineCodeFix({\n id: \"triple-quote-indent\",\n label: \"Format triple-quote-indent\",\n fix: (context) => {\n const splitStr = \"\\n\";\n const tripleQuote = '\"\"\"';\n const tripleQuoteLen = tripleQuote.length;\n const text = location.file.text.slice(\n location.pos + tripleQuoteLen,\n location.end - tripleQuoteLen,\n );\n\n const lines = splitLines(text);\n if (lines.length === 0) {\n return;\n }\n\n if (lines.length === 1) {\n const indentNumb = getIndentNumbInLine(lines[0]);\n const prefix = \" \".repeat(indentNumb);\n return context.replaceText(\n location,\n [tripleQuote, lines[0], `${prefix}${tripleQuote}`].join(splitStr),\n );\n }\n\n if (lines[0].trim() === \"\") {\n lines.shift();\n }\n\n const lastLine = lines[lines.length - 1];\n if (lastLine.trim() === \"\") {\n lines.pop();\n }\n\n let prefix = \"\";\n const minIndentNumb = Math.min(...lines.map((line) => getIndentNumbInLine(line)));\n const lastLineIndentNumb = getIndentNumbInLine(lastLine);\n if (minIndentNumb < lastLineIndentNumb) {\n const indentDiff = lastLineIndentNumb - minIndentNumb;\n prefix = \" \".repeat(indentDiff);\n }\n\n const middle = lines.map((line) => `${prefix}${line}`).join(splitStr);\n return context.replaceText(\n location,\n `${tripleQuote}${splitStr}${middle}${splitStr}${\" \".repeat(lastLineIndentNumb)}${tripleQuote}`,\n );\n\n function getIndentNumbInLine(lineText: string): number {\n let curStart = 0;\n while (\n curStart < lineText.length &&\n isWhiteSpaceSingleLine(lineText.charCodeAt(curStart))\n ) {\n curStart++;\n }\n return curStart;\n }\n },\n });\n}\n", "import {\n CharCode,\n codePointBefore,\n isAsciiIdentifierContinue,\n isAsciiIdentifierStart,\n isBinaryDigit,\n isDigit,\n isHexDigit,\n isIdentifierContinue,\n isIdentifierStart,\n isLineBreak,\n isLowercaseAsciiLetter,\n isNonAsciiIdentifierCharacter,\n isNonAsciiWhiteSpaceSingleLine,\n isWhiteSpace,\n isWhiteSpaceSingleLine,\n utf16CodeUnits,\n} from \"./charcode.js\";\nimport { createTripleQuoteIndentCodeFix } from \"./compiler-code-fixes/triple-quote-indent.codefix.js\";\nimport { DiagnosticHandler, compilerAssert } from \"./diagnostics.js\";\nimport { CompilerDiagnostics, createDiagnostic } from \"./messages.js\";\nimport { getCommentAtPosition } from \"./parser-utils.js\";\nimport { createSourceFile } from \"./source-file.js\";\nimport { DiagnosticReport, SourceFile, TextRange, TypeSpecScriptNode } from \"./types.js\";\n\n// All conflict markers consist of the same character repeated seven times. If it is\n// a <<<<<<< or >>>>>>> marker then it is also followed by a space.\nconst mergeConflictMarkerLength = 7;\n\nexport enum Token {\n None,\n Invalid,\n EndOfFile,\n Identifier,\n NumericLiteral,\n StringLiteral,\n StringTemplateHead,\n StringTemplateMiddle,\n StringTemplateTail,\n // Add new tokens above if they don't fit any of the categories below\n\n ///////////////////////////////////////////////////////////////\n // Trivia\n /** @internal */ __StartTrivia,\n\n SingleLineComment = __StartTrivia,\n MultiLineComment,\n NewLine,\n Whitespace,\n ConflictMarker,\n // Add new trivia above\n\n /** @internal */ __EndTrivia,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Doc comment content\n /** @internal */ __StartDocComment = __EndTrivia,\n DocText = __StartDocComment,\n DocCodeSpan,\n DocCodeFenceDelimiter,\n /** @internal */ __EndDocComment,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Punctuation\n /** @internal */ __StartPunctuation = __EndDocComment,\n\n OpenBrace = __StartPunctuation,\n CloseBrace,\n OpenParen,\n CloseParen,\n OpenBracket,\n CloseBracket,\n Dot,\n Ellipsis,\n Semicolon,\n Comma,\n LessThan,\n GreaterThan,\n Equals,\n Ampersand,\n Bar,\n Question,\n Colon,\n ColonColon,\n At,\n AtAt,\n Hash,\n HashBrace,\n HashBracket,\n Star,\n ForwardSlash,\n Plus,\n Hyphen,\n Exclamation,\n LessThanEquals,\n GreaterThanEquals,\n AmpsersandAmpersand,\n BarBar,\n EqualsEquals,\n ExclamationEquals,\n EqualsGreaterThan,\n // Add new punctuation above\n\n /** @internal */ __EndPunctuation,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Statement keywords\n /** @internal */ __StartKeyword = __EndPunctuation,\n /** @internal */ __StartStatementKeyword = __StartKeyword,\n\n ImportKeyword = __StartStatementKeyword,\n ModelKeyword,\n ScalarKeyword,\n NamespaceKeyword,\n UsingKeyword,\n OpKeyword,\n EnumKeyword,\n AliasKeyword,\n IsKeyword,\n InterfaceKeyword,\n UnionKeyword,\n ProjectionKeyword,\n ElseKeyword,\n IfKeyword,\n DecKeyword,\n FnKeyword,\n ConstKeyword,\n InitKeyword,\n // Add new statement keyword above\n\n /** @internal */ __EndStatementKeyword,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __StartModifierKeyword = __EndStatementKeyword,\n\n ExternKeyword = __StartModifierKeyword,\n\n /** @internal */ __EndModifierKeyword,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Other keywords\n\n ExtendsKeyword = __EndModifierKeyword,\n TrueKeyword,\n FalseKeyword,\n ReturnKeyword,\n VoidKeyword,\n NeverKeyword,\n UnknownKeyword,\n ValueOfKeyword,\n TypeOfKeyword,\n // Add new non-statement keyword above\n\n /** @internal */ __EndKeyword,\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __StartReservedKeyword = __EndKeyword,\n ///////////////////////////////////////////////////////////////\n // List of keywords that have special meaning in the language but are reserved for future use\n StatemachineKeyword = __StartReservedKeyword,\n MacroKeyword,\n PackageKeyword,\n MetadataKeyword,\n EnvKeyword,\n ArgKeyword,\n DeclareKeyword,\n ArrayKeyword,\n StructKeyword,\n RecordKeyword,\n ModuleKeyword,\n ModKeyword,\n SymKeyword,\n ContextKeyword,\n PropKeyword,\n PropertyKeyword,\n ScenarioKeyword,\n PubKeyword,\n SubKeyword,\n TypeRefKeyword,\n TraitKeyword,\n ThisKeyword,\n SelfKeyword,\n SuperKeyword,\n KeyofKeyword,\n WithKeyword,\n ImplementsKeyword,\n ImplKeyword,\n SatisfiesKeyword,\n FlagKeyword,\n AutoKeyword,\n PartialKeyword,\n PrivateKeyword,\n PublicKeyword,\n ProtectedKeyword,\n InternalKeyword,\n SealedKeyword,\n LocalKeyword,\n AsyncKeyword,\n\n /** @internal */ __EndReservedKeyword,\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __Count = __EndReservedKeyword,\n}\n\nexport type DocToken =\n | Token.NewLine\n | Token.Whitespace\n | Token.ConflictMarker\n | Token.Star\n | Token.At\n | Token.CloseBrace\n | Token.Identifier\n | Token.Hyphen\n | Token.DocText\n | Token.DocCodeSpan\n | Token.DocCodeFenceDelimiter\n | Token.EndOfFile;\n\nexport type StringTemplateToken =\n | Token.StringTemplateHead\n | Token.StringTemplateMiddle\n | Token.StringTemplateTail;\n\n/** @internal */\nexport const TokenDisplay = getTokenDisplayTable([\n [Token.None, \"none\"],\n [Token.Invalid, \"invalid\"],\n [Token.EndOfFile, \"end of file\"],\n [Token.SingleLineComment, \"single-line comment\"],\n [Token.MultiLineComment, \"multi-line comment\"],\n [Token.ConflictMarker, \"conflict marker\"],\n [Token.NumericLiteral, \"numeric literal\"],\n [Token.StringLiteral, \"string literal\"],\n [Token.StringTemplateHead, \"string template head\"],\n [Token.StringTemplateMiddle, \"string template middle\"],\n [Token.StringTemplateTail, \"string template tail\"],\n [Token.NewLine, \"newline\"],\n [Token.Whitespace, \"whitespace\"],\n [Token.DocCodeFenceDelimiter, \"doc code fence delimiter\"],\n [Token.DocCodeSpan, \"doc code span\"],\n [Token.DocText, \"doc text\"],\n [Token.OpenBrace, \"'{'\"],\n [Token.CloseBrace, \"'}'\"],\n [Token.OpenParen, \"'('\"],\n [Token.CloseParen, \"')'\"],\n [Token.OpenBracket, \"'['\"],\n [Token.CloseBracket, \"']'\"],\n [Token.Dot, \"'.'\"],\n [Token.Ellipsis, \"'...'\"],\n [Token.Semicolon, \"';'\"],\n [Token.Comma, \"','\"],\n [Token.LessThan, \"'<'\"],\n [Token.GreaterThan, \"'>'\"],\n [Token.Equals, \"'='\"],\n [Token.Ampersand, \"'&'\"],\n [Token.Bar, \"'|'\"],\n [Token.Question, \"'?'\"],\n [Token.Colon, \"':'\"],\n [Token.ColonColon, \"'::'\"],\n [Token.At, \"'@'\"],\n [Token.AtAt, \"'@@'\"],\n [Token.Hash, \"'#'\"],\n [Token.HashBrace, \"'#{'\"],\n [Token.HashBracket, \"'#['\"],\n [Token.Star, \"'*'\"],\n [Token.ForwardSlash, \"'/'\"],\n [Token.Plus, \"'+'\"],\n [Token.Hyphen, \"'-'\"],\n [Token.Exclamation, \"'!'\"],\n [Token.LessThanEquals, \"'<='\"],\n [Token.GreaterThanEquals, \"'>='\"],\n [Token.AmpsersandAmpersand, \"'&&'\"],\n [Token.BarBar, \"'||'\"],\n [Token.EqualsEquals, \"'=='\"],\n [Token.ExclamationEquals, \"'!='\"],\n [Token.EqualsGreaterThan, \"'=>'\"],\n [Token.Identifier, \"identifier\"],\n [Token.ImportKeyword, \"'import'\"],\n [Token.ModelKeyword, \"'model'\"],\n [Token.ScalarKeyword, \"'scalar'\"],\n [Token.NamespaceKeyword, \"'namespace'\"],\n [Token.UsingKeyword, \"'using'\"],\n [Token.OpKeyword, \"'op'\"],\n [Token.EnumKeyword, \"'enum'\"],\n [Token.AliasKeyword, \"'alias'\"],\n [Token.IsKeyword, \"'is'\"],\n [Token.InterfaceKeyword, \"'interface'\"],\n [Token.UnionKeyword, \"'union'\"],\n [Token.ProjectionKeyword, \"'projection'\"],\n [Token.ElseKeyword, \"'else'\"],\n [Token.IfKeyword, \"'if'\"],\n [Token.DecKeyword, \"'dec'\"],\n [Token.FnKeyword, \"'fn'\"],\n [Token.ValueOfKeyword, \"'valueof'\"],\n [Token.TypeOfKeyword, \"'typeof'\"],\n [Token.ConstKeyword, \"'const'\"],\n [Token.InitKeyword, \"'init'\"],\n [Token.ExtendsKeyword, \"'extends'\"],\n [Token.TrueKeyword, \"'true'\"],\n [Token.FalseKeyword, \"'false'\"],\n [Token.ReturnKeyword, \"'return'\"],\n [Token.VoidKeyword, \"'void'\"],\n [Token.NeverKeyword, \"'never'\"],\n [Token.UnknownKeyword, \"'unknown'\"],\n [Token.ExternKeyword, \"'extern'\"],\n\n // Reserved keywords\n [Token.StatemachineKeyword, \"'statemachine'\"],\n [Token.MacroKeyword, \"'macro'\"],\n [Token.PackageKeyword, \"'package'\"],\n [Token.MetadataKeyword, \"'metadata'\"],\n [Token.EnvKeyword, \"'env'\"],\n [Token.ArgKeyword, \"'arg'\"],\n [Token.DeclareKeyword, \"'declare'\"],\n [Token.ArrayKeyword, \"'array'\"],\n [Token.StructKeyword, \"'struct'\"],\n [Token.RecordKeyword, \"'record'\"],\n [Token.ModuleKeyword, \"'module'\"],\n [Token.ModKeyword, \"'mod'\"],\n [Token.SymKeyword, \"'sym'\"],\n [Token.ContextKeyword, \"'context'\"],\n [Token.PropKeyword, \"'prop'\"],\n [Token.PropertyKeyword, \"'property'\"],\n [Token.ScenarioKeyword, \"'scenario'\"],\n [Token.PubKeyword, \"'pub'\"],\n [Token.SubKeyword, \"'sub'\"],\n [Token.TypeRefKeyword, \"'typeref'\"],\n [Token.TraitKeyword, \"'trait'\"],\n [Token.ThisKeyword, \"'this'\"],\n [Token.SelfKeyword, \"'self'\"],\n [Token.SuperKeyword, \"'super'\"],\n [Token.KeyofKeyword, \"'keyof'\"],\n [Token.WithKeyword, \"'with'\"],\n [Token.ImplementsKeyword, \"'implements'\"],\n [Token.ImplKeyword, \"'impl'\"],\n [Token.SatisfiesKeyword, \"'satisfies'\"],\n [Token.FlagKeyword, \"'flag'\"],\n [Token.AutoKeyword, \"'auto'\"],\n [Token.PartialKeyword, \"'partial'\"],\n [Token.PrivateKeyword, \"'private'\"],\n [Token.PublicKeyword, \"'public'\"],\n [Token.ProtectedKeyword, \"'protected'\"],\n [Token.InternalKeyword, \"'internal'\"],\n [Token.SealedKeyword, \"'sealed'\"],\n [Token.LocalKeyword, \"'local'\"],\n [Token.AsyncKeyword, \"'async'\"],\n]);\n\n/** @internal */\nexport const Keywords: ReadonlyMap<string, Token> = new Map([\n [\"import\", Token.ImportKeyword],\n [\"model\", Token.ModelKeyword],\n [\"scalar\", Token.ScalarKeyword],\n [\"namespace\", Token.NamespaceKeyword],\n [\"interface\", Token.InterfaceKeyword],\n [\"union\", Token.UnionKeyword],\n [\"if\", Token.IfKeyword],\n [\"else\", Token.ElseKeyword],\n [\"projection\", Token.ProjectionKeyword],\n [\"using\", Token.UsingKeyword],\n [\"op\", Token.OpKeyword],\n [\"extends\", Token.ExtendsKeyword],\n [\"is\", Token.IsKeyword],\n [\"enum\", Token.EnumKeyword],\n [\"alias\", Token.AliasKeyword],\n [\"dec\", Token.DecKeyword],\n [\"fn\", Token.FnKeyword],\n [\"valueof\", Token.ValueOfKeyword],\n [\"typeof\", Token.TypeOfKeyword],\n [\"const\", Token.ConstKeyword],\n [\"init\", Token.InitKeyword],\n [\"true\", Token.TrueKeyword],\n [\"false\", Token.FalseKeyword],\n [\"return\", Token.ReturnKeyword],\n [\"void\", Token.VoidKeyword],\n [\"never\", Token.NeverKeyword],\n [\"unknown\", Token.UnknownKeyword],\n [\"extern\", Token.ExternKeyword],\n\n // Reserved keywords\n [\"statemachine\", Token.StatemachineKeyword],\n [\"macro\", Token.MacroKeyword],\n [\"package\", Token.PackageKeyword],\n [\"metadata\", Token.MetadataKeyword],\n [\"env\", Token.EnvKeyword],\n [\"arg\", Token.ArgKeyword],\n [\"declare\", Token.DeclareKeyword],\n [\"array\", Token.ArrayKeyword],\n [\"struct\", Token.StructKeyword],\n [\"record\", Token.RecordKeyword],\n [\"module\", Token.ModuleKeyword],\n [\"mod\", Token.ModKeyword],\n [\"sym\", Token.SymKeyword],\n [\"context\", Token.ContextKeyword],\n [\"prop\", Token.PropKeyword],\n [\"property\", Token.PropertyKeyword],\n [\"scenario\", Token.ScenarioKeyword],\n [\"pub\", Token.PubKeyword],\n [\"sub\", Token.SubKeyword],\n [\"typeref\", Token.TypeRefKeyword],\n [\"trait\", Token.TraitKeyword],\n [\"this\", Token.ThisKeyword],\n [\"self\", Token.SelfKeyword],\n [\"super\", Token.SuperKeyword],\n [\"keyof\", Token.KeyofKeyword],\n [\"with\", Token.WithKeyword],\n [\"implements\", Token.ImplementsKeyword],\n [\"impl\", Token.ImplKeyword],\n [\"satisfies\", Token.SatisfiesKeyword],\n [\"flag\", Token.FlagKeyword],\n [\"auto\", Token.AutoKeyword],\n [\"partial\", Token.PartialKeyword],\n [\"private\", Token.PrivateKeyword],\n [\"public\", Token.PublicKeyword],\n [\"protected\", Token.ProtectedKeyword],\n [\"internal\", Token.InternalKeyword],\n [\"sealed\", Token.SealedKeyword],\n [\"local\", Token.LocalKeyword],\n [\"async\", Token.AsyncKeyword],\n]);\n/** @internal */\nexport const ReservedKeywords: ReadonlyMap<string, Token> = new Map([\n // Reserved keywords\n [\"statemachine\", Token.StatemachineKeyword],\n [\"macro\", Token.MacroKeyword],\n [\"package\", Token.PackageKeyword],\n [\"metadata\", Token.MetadataKeyword],\n [\"env\", Token.EnvKeyword],\n [\"arg\", Token.ArgKeyword],\n [\"declare\", Token.DeclareKeyword],\n [\"array\", Token.ArrayKeyword],\n [\"struct\", Token.StructKeyword],\n [\"record\", Token.RecordKeyword],\n [\"module\", Token.ModuleKeyword],\n [\"mod\", Token.ModuleKeyword],\n [\"sym\", Token.SymKeyword],\n [\"context\", Token.ContextKeyword],\n [\"prop\", Token.PropKeyword],\n [\"property\", Token.PropertyKeyword],\n [\"scenario\", Token.ScenarioKeyword],\n [\"trait\", Token.TraitKeyword],\n [\"this\", Token.ThisKeyword],\n [\"self\", Token.SelfKeyword],\n [\"super\", Token.SuperKeyword],\n [\"keyof\", Token.KeyofKeyword],\n [\"with\", Token.WithKeyword],\n [\"implements\", Token.ImplementsKeyword],\n [\"impl\", Token.ImplKeyword],\n [\"satisfies\", Token.SatisfiesKeyword],\n [\"flag\", Token.FlagKeyword],\n [\"auto\", Token.AutoKeyword],\n [\"partial\", Token.PartialKeyword],\n [\"private\", Token.PrivateKeyword],\n [\"public\", Token.PublicKeyword],\n [\"protected\", Token.ProtectedKeyword],\n [\"internal\", Token.InternalKeyword],\n [\"sealed\", Token.SealedKeyword],\n [\"local\", Token.LocalKeyword],\n [\"async\", Token.AsyncKeyword],\n]);\n\n/** @internal */\nexport const enum KeywordLimit {\n MinLength = 2,\n MaxLength = 12,\n}\n\nexport interface Scanner {\n /** The source code being scanned. */\n readonly file: SourceFile;\n\n /** The offset in UTF-16 code units to the current position at the start of the next token. */\n readonly position: number;\n\n /** The current token */\n readonly token: Token;\n\n /** The offset in UTF-16 code units to the start of the current token. */\n readonly tokenPosition: number;\n\n /** The flags on the current token. */\n readonly tokenFlags: TokenFlags;\n\n /** Advance one token. */\n scan(): Token;\n\n /** Advance one token inside DocComment. Use inside {@link scanRange} callback over DocComment range. */\n scanDoc(): DocToken;\n\n /**\n * Unconditionally back up and scan a template expression portion.\n * @param tokenFlags Token Flags for head StringTemplateToken\n */\n reScanStringTemplate(tokenFlags: TokenFlags): StringTemplateToken;\n\n /**\n * Finds the indent for the given triple quoted string.\n * @param start\n * @param end\n */\n findTripleQuotedStringIndent(start: number, end: number): [number, number];\n\n /**\n * Unindent and unescape the triple quoted string rawText\n */\n unindentAndUnescapeTripleQuotedString(\n start: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string;\n\n /** Reset the scanner to the given start and end positions, invoke the callback, and then restore scanner state. */\n scanRange<T>(range: TextRange, callback: () => T): T;\n\n /** Determine if the scanner has reached the end of the input. */\n eof(): boolean;\n\n /** The exact spelling of the current token. */\n getTokenText(): string;\n\n /**\n * The value of the current token.\n *\n * String literals are escaped and unquoted, identifiers are normalized,\n * and all other tokens return their exact spelling sames as\n * getTokenText().\n */\n getTokenValue(): string;\n}\n\nexport enum TokenFlags {\n None = 0,\n Escaped = 1 << 0,\n TripleQuoted = 1 << 1,\n Unterminated = 1 << 2,\n NonAscii = 1 << 3,\n DocComment = 1 << 4,\n Backticked = 1 << 5,\n}\n\nexport function isTrivia(token: Token) {\n return token >= Token.__StartTrivia && token < Token.__EndTrivia;\n}\n\nexport function isComment(token: Token): boolean {\n return token === Token.SingleLineComment || token === Token.MultiLineComment;\n}\n\nexport function isKeyword(token: Token) {\n return token >= Token.__StartKeyword && token < Token.__EndKeyword;\n}\n\n/** If is a keyword with no actual use right now but will be in the future. */\nexport function isReservedKeyword(token: Token) {\n return token >= Token.__StartReservedKeyword && token < Token.__EndReservedKeyword;\n}\n\nexport function isPunctuation(token: Token) {\n return token >= Token.__StartPunctuation && token < Token.__EndPunctuation;\n}\n\nexport function isModifier(token: Token) {\n return token >= Token.__StartModifierKeyword && token < Token.__EndModifierKeyword;\n}\n\nexport function isStatementKeyword(token: Token) {\n return token >= Token.__StartStatementKeyword && token < Token.__EndStatementKeyword;\n}\n\nexport function createScanner(\n source: string | SourceFile,\n diagnosticHandler: DiagnosticHandler,\n): Scanner {\n const file = typeof source === \"string\" ? createSourceFile(source, \"<anonymous file>\") : source;\n const input = file.text;\n let position = 0;\n let endPosition = input.length;\n let token = Token.None;\n let tokenPosition = -1;\n let tokenFlags = TokenFlags.None;\n // Skip BOM\n if (position < endPosition && input.charCodeAt(position) === CharCode.ByteOrderMark) {\n position++;\n }\n\n return {\n get position() {\n return position;\n },\n get token() {\n return token;\n },\n get tokenPosition() {\n return tokenPosition;\n },\n get tokenFlags() {\n return tokenFlags;\n },\n file,\n scan,\n scanRange,\n scanDoc,\n reScanStringTemplate,\n findTripleQuotedStringIndent,\n unindentAndUnescapeTripleQuotedString,\n eof,\n getTokenText,\n getTokenValue,\n };\n\n function eof() {\n return position >= endPosition;\n }\n\n function getTokenText() {\n return input.substring(tokenPosition, position);\n }\n\n function getTokenValue() {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateHead:\n case Token.StringTemplateMiddle:\n case Token.StringTemplateTail:\n return getStringTokenValue(token, tokenFlags);\n case Token.Identifier:\n return getIdentifierTokenValue();\n case Token.DocText:\n return getDocTextValue();\n default:\n return getTokenText();\n }\n }\n\n function lookAhead(offset: number) {\n const p = position + offset;\n if (p >= endPosition) {\n return Number.NaN;\n }\n return input.charCodeAt(p);\n }\n\n function scan(): Token {\n tokenPosition = position;\n tokenFlags = TokenFlags.None;\n\n if (!eof()) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (lookAhead(1) === CharCode.LineFeed) {\n position++;\n }\n // fallthrough\n case CharCode.LineFeed:\n return next(Token.NewLine);\n\n case CharCode.Space:\n case CharCode.Tab:\n case CharCode.VerticalTab:\n case CharCode.FormFeed:\n return scanWhitespace();\n\n case CharCode.OpenParen:\n return next(Token.OpenParen);\n\n case CharCode.CloseParen:\n return next(Token.CloseParen);\n\n case CharCode.Comma:\n return next(Token.Comma);\n\n case CharCode.Colon:\n return lookAhead(1) === CharCode.Colon ? next(Token.ColonColon, 2) : next(Token.Colon);\n\n case CharCode.Semicolon:\n return next(Token.Semicolon);\n\n case CharCode.OpenBracket:\n return next(Token.OpenBracket);\n\n case CharCode.CloseBracket:\n return next(Token.CloseBracket);\n\n case CharCode.OpenBrace:\n return next(Token.OpenBrace);\n\n case CharCode.CloseBrace:\n return next(Token.CloseBrace);\n\n case CharCode.At:\n return lookAhead(1) === CharCode.At ? next(Token.AtAt, 2) : next(Token.At);\n\n case CharCode.Hash:\n const ahead = lookAhead(1);\n switch (ahead) {\n case CharCode.OpenBrace:\n return next(Token.HashBrace, 2);\n case CharCode.OpenBracket:\n return next(Token.HashBracket, 2);\n default:\n return next(Token.Hash);\n }\n\n case CharCode.Plus:\n return isDigit(lookAhead(1)) ? scanSignedNumber() : next(Token.Plus);\n\n case CharCode.Minus:\n return isDigit(lookAhead(1)) ? scanSignedNumber() : next(Token.Hyphen);\n\n case CharCode.Asterisk:\n return next(Token.Star);\n\n case CharCode.Question:\n return next(Token.Question);\n\n case CharCode.Ampersand:\n return lookAhead(1) === CharCode.Ampersand\n ? next(Token.AmpsersandAmpersand, 2)\n : next(Token.Ampersand);\n\n case CharCode.Dot:\n return lookAhead(1) === CharCode.Dot && lookAhead(2) === CharCode.Dot\n ? next(Token.Ellipsis, 3)\n : next(Token.Dot);\n\n case CharCode.Slash:\n switch (lookAhead(1)) {\n case CharCode.Slash:\n return scanSingleLineComment();\n case CharCode.Asterisk:\n return scanMultiLineComment();\n }\n\n return next(Token.ForwardSlash);\n\n case CharCode._0:\n switch (lookAhead(1)) {\n case CharCode.x:\n return scanHexNumber();\n case CharCode.b:\n return scanBinaryNumber();\n }\n // fallthrough\n case CharCode._1:\n case CharCode._2:\n case CharCode._3:\n case CharCode._4:\n case CharCode._5:\n case CharCode._6:\n case CharCode._7:\n case CharCode._8:\n case CharCode._9:\n return scanNumber();\n\n case CharCode.LessThan:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Equals\n ? next(Token.LessThanEquals, 2)\n : next(Token.LessThan);\n\n case CharCode.GreaterThan:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Equals\n ? next(Token.GreaterThanEquals, 2)\n : next(Token.GreaterThan);\n\n case CharCode.Equals:\n if (atConflictMarker()) return scanConflictMarker();\n switch (lookAhead(1)) {\n case CharCode.Equals:\n return next(Token.EqualsEquals, 2);\n case CharCode.GreaterThan:\n return next(Token.EqualsGreaterThan, 2);\n }\n return next(Token.Equals);\n\n case CharCode.Bar:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Bar ? next(Token.BarBar, 2) : next(Token.Bar);\n\n case CharCode.DoubleQuote:\n return lookAhead(1) === CharCode.DoubleQuote && lookAhead(2) === CharCode.DoubleQuote\n ? scanString(TokenFlags.TripleQuoted)\n : scanString(TokenFlags.None);\n\n case CharCode.Exclamation:\n return lookAhead(1) === CharCode.Equals\n ? next(Token.ExclamationEquals, 2)\n : next(Token.Exclamation);\n\n case CharCode.Backtick:\n return scanBacktickedIdentifier();\n\n default:\n if (isLowercaseAsciiLetter(ch)) {\n return scanIdentifierOrKeyword();\n }\n if (isAsciiIdentifierStart(ch)) {\n return scanIdentifier();\n }\n if (ch <= CharCode.MaxAscii) {\n return scanInvalidCharacter();\n }\n return scanNonAsciiToken();\n }\n }\n\n return (token = Token.EndOfFile);\n }\n\n function scanDoc(): DocToken {\n tokenPosition = position;\n tokenFlags = TokenFlags.None;\n\n if (!eof()) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (lookAhead(1) === CharCode.LineFeed) {\n position++;\n }\n // fallthrough\n case CharCode.LineFeed:\n return next(Token.NewLine);\n\n case CharCode.Backslash:\n if (lookAhead(1) === CharCode.At) {\n tokenFlags |= TokenFlags.Escaped;\n return next(Token.DocText, 2);\n }\n return next(Token.DocText);\n\n case CharCode.Space:\n case CharCode.Tab:\n case CharCode.VerticalTab:\n case CharCode.FormFeed:\n return scanWhitespace();\n\n case CharCode.CloseBrace:\n return next(Token.CloseBrace);\n\n case CharCode.At:\n return next(Token.At);\n\n case CharCode.Asterisk:\n return next(Token.Star);\n\n case CharCode.Backtick:\n return lookAhead(1) === CharCode.Backtick && lookAhead(2) === CharCode.Backtick\n ? next(Token.DocCodeFenceDelimiter, 3)\n : scanDocCodeSpan();\n\n case CharCode.LessThan:\n case CharCode.GreaterThan:\n case CharCode.Equals:\n case CharCode.Bar:\n if (atConflictMarker()) return scanConflictMarker();\n return next(Token.DocText);\n\n case CharCode.Minus:\n return next(Token.Hyphen);\n }\n\n if (isAsciiIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n if (ch <= CharCode.MaxAscii) {\n return next(Token.DocText);\n }\n\n const cp = input.codePointAt(position)!;\n if (isIdentifierStart(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n\n return scanUnknown(Token.DocText);\n }\n\n return (token = Token.EndOfFile);\n }\n\n function reScanStringTemplate(lastTokenFlags: TokenFlags): StringTemplateToken {\n position = tokenPosition;\n tokenFlags = TokenFlags.None;\n return scanStringTemplateSpan(lastTokenFlags);\n }\n\n function scanRange<T>(range: TextRange, callback: () => T): T {\n const savedPosition = position;\n const savedEndPosition = endPosition;\n const savedToken = token;\n const savedTokenPosition = tokenPosition;\n const savedTokenFlags = tokenFlags;\n\n position = range.pos;\n endPosition = range.end;\n token = Token.None;\n tokenPosition = -1;\n tokenFlags = TokenFlags.None;\n\n const result = callback();\n\n position = savedPosition;\n endPosition = savedEndPosition;\n token = savedToken;\n tokenPosition = savedTokenPosition;\n tokenFlags = savedTokenFlags;\n\n return result;\n }\n\n function next<T extends Token>(t: T, count = 1): T {\n position += count;\n return (token = t) as T;\n }\n\n function unterminated<T extends Token>(t: T): T {\n tokenFlags |= TokenFlags.Unterminated;\n error({ code: \"unterminated\", format: { token: TokenDisplay[t] } });\n return (token = t) as T;\n }\n\n function scanNonAsciiToken() {\n tokenFlags |= TokenFlags.NonAscii;\n const ch = input.charCodeAt(position);\n\n if (isNonAsciiWhiteSpaceSingleLine(ch)) {\n return scanWhitespace();\n }\n\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n\n return scanInvalidCharacter();\n }\n\n function scanInvalidCharacter(): Token.Invalid {\n token = scanUnknown(Token.Invalid);\n error({ code: \"invalid-character\" });\n return token;\n }\n\n function scanUnknown<T extends Token>(t: T): T {\n const codePoint = input.codePointAt(position)!;\n return (token = next(t, utf16CodeUnits(codePoint)));\n }\n\n function error<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: Omit<DiagnosticReport<CompilerDiagnostics, C, M>, \"target\">,\n pos?: number,\n end?: number,\n ) {\n const diagnostic = createDiagnostic({\n ...report,\n target: { file, pos: pos ?? tokenPosition, end: end ?? position },\n } as any);\n diagnosticHandler(diagnostic);\n }\n\n function scanWhitespace(): Token.Whitespace {\n do {\n position++;\n } while (!eof() && isWhiteSpaceSingleLine(input.charCodeAt(position)));\n\n return (token = Token.Whitespace);\n }\n\n function scanSignedNumber(): Token.NumericLiteral {\n position++; // consume '+/-'\n return scanNumber();\n }\n\n function scanNumber(): Token.NumericLiteral {\n scanKnownDigits();\n if (!eof() && input.charCodeAt(position) === CharCode.Dot) {\n position++;\n scanRequiredDigits();\n }\n if (!eof() && input.charCodeAt(position) === CharCode.e) {\n position++;\n const ch = input.charCodeAt(position);\n if (ch === CharCode.Plus || ch === CharCode.Minus) {\n position++;\n }\n scanRequiredDigits();\n }\n return (token = Token.NumericLiteral);\n }\n\n function scanKnownDigits(): void {\n do {\n position++;\n } while (!eof() && isDigit(input.charCodeAt(position)));\n }\n\n function scanRequiredDigits(): void {\n if (eof() || !isDigit(input.charCodeAt(position))) {\n error({ code: \"digit-expected\" });\n return;\n }\n scanKnownDigits();\n }\n\n function scanHexNumber(): Token.NumericLiteral {\n position += 2; // consume '0x'\n\n if (eof() || !isHexDigit(input.charCodeAt(position))) {\n error({ code: \"hex-digit-expected\" });\n return (token = Token.NumericLiteral);\n }\n do {\n position++;\n } while (!eof() && isHexDigit(input.charCodeAt(position)));\n\n return (token = Token.NumericLiteral);\n }\n\n function scanBinaryNumber(): Token.NumericLiteral {\n position += 2; // consume '0b'\n\n if (eof() || !isBinaryDigit(input.charCodeAt(position))) {\n error({ code: \"binary-digit-expected\" });\n return (token = Token.NumericLiteral);\n }\n do {\n position++;\n } while (!eof() && isBinaryDigit(input.charCodeAt(position)));\n\n return (token = Token.NumericLiteral);\n }\n\n function scanSingleLineComment(): Token.SingleLineComment {\n position = skipSingleLineComment(input, position, endPosition);\n return (token = Token.SingleLineComment);\n }\n\n function scanMultiLineComment(): Token.MultiLineComment {\n token = Token.MultiLineComment;\n if (lookAhead(2) === CharCode.Asterisk) {\n tokenFlags |= TokenFlags.DocComment;\n }\n const [newPosition, terminated] = skipMultiLineComment(input, position);\n position = newPosition;\n return terminated ? token : unterminated(token);\n }\n\n function scanDocCodeSpan(): Token.DocCodeSpan {\n position++; // consume '`'\n\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backtick:\n position++;\n return (token = Token.DocCodeSpan);\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n break loop;\n }\n }\n\n return unterminated(Token.DocCodeSpan);\n }\n\n function scanString(tokenFlags: TokenFlags): Token.StringLiteral | Token.StringTemplateHead {\n if (tokenFlags & TokenFlags.TripleQuoted) {\n position += 3; // consume '\"\"\"'\n } else {\n position++; // consume '\"'\n }\n\n return scanStringLiteralLike(tokenFlags, Token.StringTemplateHead, Token.StringLiteral);\n }\n\n function scanStringTemplateSpan(\n tokenFlags: TokenFlags,\n ): Token.StringTemplateMiddle | Token.StringTemplateTail {\n position++; // consume '{'\n\n return scanStringLiteralLike(tokenFlags, Token.StringTemplateMiddle, Token.StringTemplateTail);\n }\n\n function scanStringLiteralLike<M extends Token, T extends Token>(\n requestedTokenFlags: TokenFlags,\n template: M,\n tail: T,\n ): M | T {\n const multiLine = requestedTokenFlags & TokenFlags.TripleQuoted;\n tokenFlags = requestedTokenFlags;\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backslash:\n tokenFlags |= TokenFlags.Escaped;\n position++;\n if (eof()) {\n break loop;\n }\n continue;\n case CharCode.DoubleQuote:\n if (multiLine) {\n if (lookAhead(1) === CharCode.DoubleQuote && lookAhead(2) === CharCode.DoubleQuote) {\n position += 3;\n token = tail;\n return tail;\n } else {\n continue;\n }\n } else {\n position++;\n token = tail;\n return tail;\n }\n case CharCode.$:\n if (lookAhead(1) === CharCode.OpenBrace) {\n position += 2;\n token = template;\n return template;\n }\n continue;\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n if (multiLine) {\n continue;\n } else {\n break loop;\n }\n }\n }\n\n return unterminated(tail);\n }\n\n function getStringLiteralOffsetStart(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ) {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateHead:\n return tokenFlags & TokenFlags.TripleQuoted ? 3 : 1; // \"\"\" or \"\n default:\n return 1; // {\n }\n }\n\n function getStringLiteralOffsetEnd(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ) {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateTail:\n return tokenFlags & TokenFlags.TripleQuoted ? 3 : 1; // \"\"\" or \"\n default:\n return 2; // ${\n }\n }\n\n function getStringTokenValue(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string {\n if (tokenFlags & TokenFlags.TripleQuoted) {\n const start = tokenPosition;\n const end = position;\n const [indentationStart, indentationEnd] = findTripleQuotedStringIndent(start, end);\n return unindentAndUnescapeTripleQuotedString(\n start,\n end,\n indentationStart,\n indentationEnd,\n token,\n tokenFlags,\n );\n }\n\n const startOffset = getStringLiteralOffsetStart(token, tokenFlags);\n const endOffset = getStringLiteralOffsetEnd(token, tokenFlags);\n const start = tokenPosition + startOffset;\n const end = tokenFlags & TokenFlags.Unterminated ? position : position - endOffset;\n\n if (tokenFlags & TokenFlags.Escaped) {\n return unescapeString(start, end);\n }\n\n return input.substring(start, end);\n }\n\n function getIdentifierTokenValue(): string {\n const start = tokenFlags & TokenFlags.Backticked ? tokenPosition + 1 : tokenPosition;\n const end =\n tokenFlags & TokenFlags.Backticked && !(tokenFlags & TokenFlags.Unterminated)\n ? position - 1\n : position;\n\n const text =\n tokenFlags & TokenFlags.Escaped ? unescapeString(start, end) : input.substring(start, end);\n\n if (tokenFlags & TokenFlags.NonAscii) {\n return text.normalize(\"NFC\");\n }\n\n return text;\n }\n\n function getDocTextValue(): string {\n if (tokenFlags & TokenFlags.Escaped) {\n let start = tokenPosition;\n const end = position;\n\n let result = \"\";\n let pos = start;\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n\n if (pos === end - 1) {\n break;\n }\n\n result += input.substring(start, pos);\n switch (input.charCodeAt(pos + 1)) {\n case CharCode.At:\n result += \"@\";\n break;\n default:\n result += input.substring(pos, pos + 2);\n }\n pos += 2;\n start = pos;\n }\n\n result += input.substring(start, end);\n return result;\n } else {\n return input.substring(tokenPosition, position);\n }\n }\n\n function findTripleQuotedStringIndent(start: number, end: number): [number, number] {\n end = end - 3; // Remove the \"\"\"\n // remove whitespace before closing delimiter and record it as required\n // indentation for all lines\n const indentationEnd = end;\n while (end > start && isWhiteSpaceSingleLine(input.charCodeAt(end - 1))) {\n end--;\n }\n const indentationStart = end;\n\n // remove required final line break\n if (isLineBreak(input.charCodeAt(end - 1))) {\n if (isCrlf(end - 2, 0, end)) {\n end--;\n }\n end--;\n }\n\n return [indentationStart, indentationEnd];\n }\n\n function unindentAndUnescapeTripleQuotedString(\n start: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string {\n const startOffset = getStringLiteralOffsetStart(token, tokenFlags);\n const endOffset = getStringLiteralOffsetEnd(token, tokenFlags);\n start = start + startOffset;\n end = tokenFlags & TokenFlags.Unterminated ? end : end - endOffset;\n\n if (token === Token.StringLiteral || token === Token.StringTemplateHead) {\n // ignore leading whitespace before required initial line break\n while (start < end && isWhiteSpaceSingleLine(input.charCodeAt(start))) {\n start++;\n }\n // remove required initial line break\n if (isLineBreak(input.charCodeAt(start))) {\n if (isCrlf(start, start, end)) {\n start++;\n }\n start++;\n } else {\n error({\n code: \"no-new-line-start-triple-quote\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n }\n }\n\n if (token === Token.StringLiteral || token === Token.StringTemplateTail) {\n while (end > start && isWhiteSpaceSingleLine(input.charCodeAt(end - 1))) {\n end--;\n }\n\n // remove required final line break\n if (isLineBreak(input.charCodeAt(end - 1))) {\n if (isCrlf(end - 2, start, end)) {\n end--;\n }\n end--;\n } else {\n error({\n code: \"no-new-line-end-triple-quote\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n }\n }\n\n let skipUnindentOnce = false;\n // We are resuming from the middle of a line so we want to keep text as it is from there.\n if (token === Token.StringTemplateMiddle || token === Token.StringTemplateTail) {\n skipUnindentOnce = true;\n }\n // remove required matching indentation from each line and unescape in the\n // process of doing so\n let result = \"\";\n let pos = start;\n while (pos < end) {\n if (skipUnindentOnce) {\n skipUnindentOnce = false;\n } else {\n // skip indentation at start of line\n start = skipMatchingIndentation(pos, end, indentationStart, indentationEnd);\n }\n let ch;\n\n while (pos < end && !isLineBreak((ch = input.charCodeAt(pos)))) {\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n result += input.substring(start, pos);\n if (pos === end - 1) {\n error({ code: \"invalid-escape-sequence\" }, pos, pos);\n pos++;\n } else {\n result += unescapeOne(pos);\n pos += 2;\n }\n start = pos;\n }\n if (pos < end) {\n if (isCrlf(pos, start, end)) {\n // CRLF in multi-line string is normalized to LF in string value.\n // This keeps program behavior unchanged by line-ending conversion.\n result += input.substring(start, pos);\n result += \"\\n\";\n pos += 2;\n } else {\n pos++; // include non-CRLF newline\n result += input.substring(start, pos);\n }\n start = pos;\n }\n }\n result += input.substring(start, pos);\n return result;\n }\n\n function isCrlf(pos: number, start: number, end: number) {\n return (\n pos >= start &&\n pos < end - 1 &&\n input.charCodeAt(pos) === CharCode.CarriageReturn &&\n input.charCodeAt(pos + 1) === CharCode.LineFeed\n );\n }\n\n function skipMatchingIndentation(\n pos: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n ): number {\n let indentationPos = indentationStart;\n end = Math.min(end, pos + (indentationEnd - indentationStart));\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (isLineBreak(ch)) {\n // allow subset of indentation if line has only whitespace\n break;\n }\n if (ch !== input.charCodeAt(indentationPos)) {\n error({\n code: \"triple-quote-indent\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n break;\n }\n indentationPos++;\n pos++;\n }\n\n return pos;\n }\n\n function unescapeString(start: number, end: number): string {\n let result = \"\";\n let pos = start;\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n\n if (pos === end - 1) {\n error({ code: \"invalid-escape-sequence\" }, pos, pos);\n break;\n }\n\n result += input.substring(start, pos);\n result += unescapeOne(pos);\n pos += 2;\n start = pos;\n }\n\n result += input.substring(start, pos);\n return result;\n }\n\n function unescapeOne(pos: number): string {\n const ch = input.charCodeAt(pos + 1);\n switch (ch) {\n case CharCode.r:\n return \"\\r\";\n case CharCode.n:\n return \"\\n\";\n case CharCode.t:\n return \"\\t\";\n case CharCode.DoubleQuote:\n return '\"';\n case CharCode.Backslash:\n return \"\\\\\";\n case CharCode.$:\n return \"$\";\n case CharCode.At:\n return \"@\";\n case CharCode.Backtick:\n return \"`\";\n default:\n error({ code: \"invalid-escape-sequence\" }, pos, pos + 2);\n return String.fromCharCode(ch);\n }\n }\n\n function scanIdentifierOrKeyword(): Token {\n let count = 0;\n let ch = input.charCodeAt(position);\n\n while (true) {\n position++;\n count++;\n\n if (eof()) {\n break;\n }\n\n ch = input.charCodeAt(position);\n if (count < KeywordLimit.MaxLength && isLowercaseAsciiLetter(ch)) {\n continue;\n }\n\n if (isAsciiIdentifierContinue(ch)) {\n return scanIdentifier();\n }\n\n if (ch > CharCode.MaxAscii) {\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n }\n\n break;\n }\n\n if (count >= KeywordLimit.MinLength && count <= KeywordLimit.MaxLength) {\n const keyword = Keywords.get(getTokenText());\n if (keyword) {\n return (token = keyword);\n }\n }\n\n return (token = Token.Identifier);\n }\n\n function scanIdentifier(): Token.Identifier {\n let ch: number;\n\n do {\n position++;\n if (eof()) {\n return (token = Token.Identifier);\n }\n } while (isAsciiIdentifierContinue((ch = input.charCodeAt(position))));\n\n if (ch > CharCode.MaxAscii) {\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n }\n\n return (token = Token.Identifier);\n }\n\n function scanBacktickedIdentifier(): Token.Identifier {\n position++; // consume '`'\n\n tokenFlags |= TokenFlags.Backticked;\n\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backslash:\n position++;\n tokenFlags |= TokenFlags.Escaped;\n continue;\n case CharCode.Backtick:\n position++;\n return (token = Token.Identifier);\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n break loop;\n default:\n if (ch > CharCode.MaxAscii) {\n tokenFlags |= TokenFlags.NonAscii;\n }\n }\n }\n\n return unterminated(Token.Identifier);\n }\n\n function scanNonAsciiIdentifier(startCodePoint: number): Token.Identifier {\n tokenFlags |= TokenFlags.NonAscii;\n let cp = startCodePoint;\n do {\n position += utf16CodeUnits(cp);\n } while (!eof() && isIdentifierContinue((cp = input.codePointAt(position)!)));\n\n return (token = Token.Identifier);\n }\n\n function atConflictMarker(): boolean {\n return isConflictMarker(input, position, endPosition);\n }\n\n function scanConflictMarker(): Token.ConflictMarker {\n const marker = input.charCodeAt(position);\n position += mergeConflictMarkerLength;\n error({ code: \"conflict-marker\" });\n\n if (marker === CharCode.LessThan || marker === CharCode.GreaterThan) {\n // Consume everything from >>>>>>> or <<<<<<< to the end of the line.\n while (position < endPosition && !isLineBreak(input.charCodeAt(position))) {\n position++;\n }\n } else {\n // Consume everything from the start of a ||||||| or =======\n // marker to the start of the next ======= or >>>>>>> marker.\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n if (\n (ch === CharCode.Equals || ch === CharCode.GreaterThan) &&\n ch !== marker &&\n isConflictMarker(input, position, endPosition)\n ) {\n break;\n }\n position++;\n }\n }\n\n return (token = Token.ConflictMarker);\n }\n}\n\n/**\n *\n * @param script\n * @param position\n * @param endPosition exclude\n * @returns return === endPosition (or -1) means not found non-trivia until endPosition + 1\n */\nexport function skipTriviaBackward(\n script: TypeSpecScriptNode,\n position: number,\n endPosition = -1,\n): number {\n endPosition = endPosition < -1 ? -1 : endPosition;\n const input = script.file.text;\n if (position === input.length) {\n // it's possible if the pos is at the end of the file, just treat it as trivia\n position--;\n } else if (position > input.length) {\n compilerAssert(false, `position out of range: ${position}, text length: ${input.length}`);\n }\n\n while (position > endPosition) {\n const ch = input.charCodeAt(position);\n\n if (isWhiteSpace(ch)) {\n position--;\n } else {\n const comment = getCommentAtPosition(script, position);\n if (comment) {\n position = comment.pos - 1;\n } else {\n break;\n }\n }\n }\n\n return position;\n}\n\n/**\n *\n * @param input\n * @param position\n * @param endPosition exclude\n * @returns return === endPosition (or input.length) means not found non-trivia until endPosition - 1\n */\nexport function skipTrivia(input: string, position: number, endPosition = input.length): number {\n endPosition = endPosition > input.length ? input.length : endPosition;\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n\n if (isWhiteSpace(ch)) {\n position++;\n continue;\n }\n\n if (ch === CharCode.Slash) {\n switch (input.charCodeAt(position + 1)) {\n case CharCode.Slash:\n position = skipSingleLineComment(input, position, endPosition);\n continue;\n case CharCode.Asterisk:\n position = skipMultiLineComment(input, position, endPosition)[0];\n continue;\n }\n }\n\n break;\n }\n\n return position;\n}\n\nexport function skipWhiteSpace(\n input: string,\n position: number,\n endPosition = input.length,\n): number {\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n\n if (!isWhiteSpace(ch)) {\n break;\n }\n position++;\n }\n\n return position;\n}\n\nfunction skipSingleLineComment(\n input: string,\n position: number,\n endPosition = input.length,\n): number {\n position += 2; // consume '//'\n\n for (; position < endPosition; position++) {\n if (isLineBreak(input.charCodeAt(position))) {\n break;\n }\n }\n\n return position;\n}\n\nfunction skipMultiLineComment(\n input: string,\n position: number,\n endPosition = input.length,\n): [position: number, terminated: boolean] {\n position += 2; // consume '/*'\n\n for (; position < endPosition; position++) {\n if (\n input.charCodeAt(position) === CharCode.Asterisk &&\n input.charCodeAt(position + 1) === CharCode.Slash\n ) {\n return [position + 2, true];\n }\n }\n\n return [position, false];\n}\n\nexport function skipContinuousIdentifier(input: string, position: number, isBackward = false) {\n let cur = position;\n const direction = isBackward ? -1 : 1;\n const bar = isBackward ? (p: number) => p >= 0 : (p: number) => p < input.length;\n while (bar(cur)) {\n const { char: cp, size } = codePointBefore(input, cur);\n cur += direction * size;\n if (!cp || !isIdentifierContinue(cp)) {\n break;\n }\n }\n return cur;\n}\n\nfunction isConflictMarker(input: string, position: number, endPosition = input.length): boolean {\n // Conflict markers must be at the start of a line.\n const ch = input.charCodeAt(position);\n if (position === 0 || isLineBreak(input.charCodeAt(position - 1))) {\n if (position + mergeConflictMarkerLength < endPosition) {\n for (let i = 0; i < mergeConflictMarkerLength; i++) {\n if (input.charCodeAt(position + i) !== ch) {\n return false;\n }\n }\n return (\n ch === CharCode.Equals ||\n input.charCodeAt(position + mergeConflictMarkerLength) === CharCode.Space\n );\n }\n }\n\n return false;\n}\n\nfunction getTokenDisplayTable(entries: [Token, string][]): readonly string[] {\n const table = new Array<string>(entries.length);\n\n for (const [token, display] of entries) {\n compilerAssert(\n token >= 0 && token < Token.__Count,\n `Invalid entry in token display table, ${token}, ${Token[token]}, ${display}`,\n );\n compilerAssert(\n !table[token],\n `Duplicate entry in token display table for: ${token}, ${Token[token]}, ${display}`,\n );\n table[token] = display;\n }\n\n for (let token = 0; token < Token.__Count; token++) {\n compilerAssert(table[token], `Missing entry in token display table: ${token}, ${Token[token]}`);\n }\n\n return table;\n}\n", "import { isArray, mutate } from \"../utils/misc.js\";\nimport { codePointBefore, isIdentifierContinue, trim } from \"./charcode.js\";\nimport { compilerAssert } from \"./diagnostics.js\";\nimport { CompilerDiagnostics, createDiagnostic } from \"./messages.js\";\nimport {\n createScanner,\n isComment,\n isKeyword,\n isPunctuation,\n isReservedKeyword,\n isStatementKeyword,\n isTrivia,\n skipContinuousIdentifier,\n skipTrivia,\n skipTriviaBackward,\n Token,\n TokenDisplay,\n TokenFlags,\n} from \"./scanner.js\";\nimport {\n AliasStatementNode,\n AnyKeywordNode,\n ArrayLiteralNode,\n AugmentDecoratorStatementNode,\n BlockComment,\n BooleanLiteralNode,\n CallExpressionNode,\n Comment,\n ConstStatementNode,\n DeclarationNode,\n DecoratorDeclarationStatementNode,\n DecoratorExpressionNode,\n Diagnostic,\n DiagnosticReportWithoutTarget,\n DirectiveArgument,\n DirectiveExpressionNode,\n DocContent,\n DocErrorsTagNode,\n DocNode,\n DocParamTagNode,\n DocPropTagNode,\n DocReturnsTagNode,\n DocTag,\n DocTemplateTagNode,\n DocTextNode,\n DocUnknownTagNode,\n EmptyStatementNode,\n EnumMemberNode,\n EnumSpreadMemberNode,\n EnumStatementNode,\n Expression,\n ExternKeywordNode,\n FunctionDeclarationStatementNode,\n FunctionParameterNode,\n IdentifierContext,\n IdentifierKind,\n IdentifierNode,\n ImportStatementNode,\n InterfaceStatementNode,\n InvalidStatementNode,\n LineComment,\n MemberExpressionNode,\n ModelExpressionNode,\n ModelPropertyNode,\n ModelSpreadPropertyNode,\n ModelStatementNode,\n Modifier,\n ModifierFlags,\n NamespaceStatementNode,\n NeverKeywordNode,\n Node,\n NodeFlags,\n NumericLiteralNode,\n ObjectLiteralNode,\n ObjectLiteralPropertyNode,\n ObjectLiteralSpreadPropertyNode,\n OperationSignature,\n OperationStatementNode,\n ParseOptions,\n PositionDetail,\n ScalarConstructorNode,\n ScalarStatementNode,\n SourceFile,\n Statement,\n StringLiteralNode,\n StringTemplateExpressionNode,\n StringTemplateHeadNode,\n StringTemplateMiddleNode,\n StringTemplateSpanNode,\n StringTemplateTailNode,\n Sym,\n SyntaxKind,\n TemplateArgumentNode,\n TemplateParameterDeclarationNode,\n TextRange,\n TupleExpressionNode,\n TypeOfExpressionNode,\n TypeReferenceNode,\n TypeSpecScriptNode,\n UnionStatementNode,\n UnionVariantNode,\n UsingStatementNode,\n ValueOfExpressionNode,\n VoidKeywordNode,\n} from \"./types.js\";\n\n/**\n * Callback to parse each element in a delimited list\n *\n * @param pos The position of the start of the list element before any\n * decorators were parsed.\n *\n * @param decorators The decorators that were applied to the list element and\n * parsed before entering the callback.\n */\ntype ParseListItem<K, T> = K extends UnannotatedListKind\n ? () => T\n : (pos: number, decorators: DecoratorExpressionNode[]) => T;\n\ntype ListDetail<T> = {\n items: T[];\n /**\n * The range of the list items as below as an example\n * model Foo <pos>{ a: string; b: string; }<end>\n *\n * remark: if the start/end token (i.e. { } ) not found, pos/end will be -1\n */\n range: TextRange;\n};\n\ntype OpenToken =\n | Token.OpenBrace\n | Token.OpenParen\n | Token.OpenBracket\n | Token.LessThan\n | Token.HashBrace\n | Token.HashBracket;\ntype CloseToken = Token.CloseBrace | Token.CloseParen | Token.CloseBracket | Token.GreaterThan;\ntype DelimiterToken = Token.Comma | Token.Semicolon;\n\n/**\n * In order to share sensitive error recovery code, all parsing of delimited\n * lists is done using a shared driver routine parameterized by these options.\n */\ninterface ListKind {\n readonly allowEmpty: boolean;\n readonly open: OpenToken | Token.None;\n readonly close: CloseToken | Token.None;\n readonly delimiter: DelimiterToken;\n readonly toleratedDelimiter: DelimiterToken;\n readonly toleratedDelimiterIsValid: boolean;\n readonly invalidAnnotationTarget?: string;\n readonly allowedStatementKeyword: Token;\n}\n\ninterface SurroundedListKind extends ListKind {\n readonly open: OpenToken;\n readonly close: CloseToken;\n}\n\ninterface UnannotatedListKind extends ListKind {\n invalidAnnotationTarget: string;\n}\n\n/**\n * The fixed set of options for each of the kinds of delimited lists in TypeSpec.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nnamespace ListKind {\n const PropertiesBase = {\n allowEmpty: true,\n toleratedDelimiterIsValid: true,\n allowedStatementKeyword: Token.None,\n } as const;\n\n export const OperationParameters = {\n ...PropertiesBase,\n open: Token.OpenParen,\n close: Token.CloseParen,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Semicolon,\n } as const;\n\n export const DecoratorArguments = {\n ...OperationParameters,\n invalidAnnotationTarget: \"expression\",\n } as const;\n\n export const FunctionArguments = {\n ...OperationParameters,\n invalidAnnotationTarget: \"expression\",\n } as const;\n\n export const ModelProperties = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n } as const;\n\n export const ObjectLiteralProperties = {\n ...PropertiesBase,\n open: Token.HashBrace,\n close: Token.CloseBrace,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Comma,\n } as const;\n\n export const InterfaceMembers = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: false,\n allowedStatementKeyword: Token.OpKeyword,\n } as const;\n\n export const ScalarMembers = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: false,\n allowedStatementKeyword: Token.InitKeyword,\n } as const;\n\n export const UnionVariants = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: true,\n } as const;\n\n export const EnumMembers = {\n ...ModelProperties,\n } as const;\n\n const ExpresionsBase = {\n allowEmpty: true,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Semicolon,\n toleratedDelimiterIsValid: false,\n invalidAnnotationTarget: \"expression\",\n allowedStatementKeyword: Token.None,\n } as const;\n\n export const TemplateParameters = {\n ...ExpresionsBase,\n allowEmpty: false,\n open: Token.LessThan,\n close: Token.GreaterThan,\n invalidAnnotationTarget: \"template parameter\",\n } as const;\n\n export const TemplateArguments = {\n ...TemplateParameters,\n } as const;\n\n export const CallArguments = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenParen,\n close: Token.CloseParen,\n } as const;\n\n export const Heritage = {\n ...ExpresionsBase,\n allowEmpty: false,\n open: Token.None,\n close: Token.None,\n } as const;\n\n export const Tuple = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenBracket,\n close: Token.CloseBracket,\n } as const;\n\n export const ArrayLiteral = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.HashBracket,\n close: Token.CloseBracket,\n } as const;\n\n export const FunctionParameters = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenParen,\n close: Token.CloseParen,\n invalidAnnotationTarget: \"expression\",\n } as const;\n}\n\nconst enum ParseMode {\n Syntax,\n Doc,\n}\n\nexport function parse(code: string | SourceFile, options: ParseOptions = {}): TypeSpecScriptNode {\n const parser = createParser(code, options);\n return parser.parseTypeSpecScript();\n}\n\nexport function parseStandaloneTypeReference(\n code: string | SourceFile,\n): [TypeReferenceNode, readonly Diagnostic[]] {\n const parser = createParser(code);\n const node = parser.parseStandaloneReferenceExpression();\n return [node, parser.parseDiagnostics];\n}\n\ninterface Parser {\n parseDiagnostics: Diagnostic[];\n parseTypeSpecScript(): TypeSpecScriptNode;\n parseStandaloneReferenceExpression(): TypeReferenceNode;\n}\n\ninterface DocRange extends TextRange {\n /** Parsed comment. */\n comment?: BlockComment;\n}\n\nfunction createParser(code: string | SourceFile, options: ParseOptions = {}): Parser {\n let parseErrorInNextFinishedNode = false;\n let previousTokenEnd = -1;\n let realPositionOfLastError = -1;\n let missingIdentifierCounter = 0;\n let treePrintable = true;\n let newLineIsTrivia = true;\n let currentMode = ParseMode.Syntax;\n const parseDiagnostics: Diagnostic[] = [];\n const scanner = createScanner(code, reportDiagnostic);\n const comments: Comment[] = [];\n let docRanges: DocRange[] = [];\n\n nextToken();\n return {\n parseDiagnostics,\n parseTypeSpecScript,\n parseStandaloneReferenceExpression,\n };\n\n function parseTypeSpecScript(): TypeSpecScriptNode {\n const statements = parseTypeSpecScriptItemList();\n return {\n kind: SyntaxKind.TypeSpecScript,\n statements,\n file: scanner.file,\n id: {\n kind: SyntaxKind.Identifier,\n sv: scanner.file.path,\n pos: 0,\n end: 0,\n flags: NodeFlags.Synthetic,\n } as any,\n namespaces: [],\n usings: [],\n locals: undefined!,\n inScopeNamespaces: [],\n parseDiagnostics,\n comments,\n printable: treePrintable,\n parseOptions: options,\n ...finishNode(0),\n };\n }\n\n interface ParseAnnotationsOptions {\n /** If we shouldn't try to parse doc nodes when parsing annotations. */\n skipParsingDocNodes?: boolean;\n }\n\n interface Annotations {\n pos: number;\n docs: DocNode[];\n directives: DirectiveExpressionNode[];\n decorators: DecoratorExpressionNode[];\n }\n\n /** Try to parse doc comments, directives and decorators in any order. */\n function parseAnnotations({ skipParsingDocNodes }: ParseAnnotationsOptions = {}): Annotations {\n const directives: DirectiveExpressionNode[] = [];\n const decorators: DecoratorExpressionNode[] = [];\n const docs: DocNode[] = [];\n let pos = tokenPos();\n if (!skipParsingDocNodes) {\n const [firstPos, addedDocs] = parseDocList();\n pos = firstPos;\n for (const doc of addedDocs) {\n docs.push(doc);\n }\n }\n\n while (token() === Token.Hash || token() === Token.At) {\n if (token() === Token.Hash) {\n directives.push(parseDirectiveExpression());\n } else if (token() === Token.At) {\n decorators.push(parseDecoratorExpression());\n }\n\n if (!skipParsingDocNodes) {\n const [_, addedDocs] = parseDocList();\n\n for (const doc of addedDocs) {\n docs.push(doc);\n }\n }\n }\n\n return { pos, docs, directives, decorators };\n }\n\n function parseTypeSpecScriptItemList(): Statement[] {\n const stmts: Statement[] = [];\n let seenBlocklessNs = false;\n let seenDecl = false;\n let seenUsing = false;\n while (token() !== Token.EndOfFile) {\n const { pos, docs, directives, decorators } = parseAnnotations();\n const tok = token();\n let item: Statement;\n switch (tok) {\n case Token.AtAt:\n reportInvalidDecorators(decorators, \"augment decorator statement\");\n item = parseAugmentDecorator();\n break;\n case Token.ImportKeyword:\n reportInvalidDecorators(decorators, \"import statement\");\n item = parseImportStatement();\n break;\n case Token.ModelKeyword:\n item = parseModelStatement(pos, decorators);\n break;\n case Token.ScalarKeyword:\n item = parseScalarStatement(pos, decorators);\n break;\n case Token.NamespaceKeyword:\n item = parseNamespaceStatement(pos, decorators, docs, directives);\n break;\n case Token.InterfaceKeyword:\n item = parseInterfaceStatement(pos, decorators);\n break;\n case Token.UnionKeyword:\n item = parseUnionStatement(pos, decorators);\n break;\n case Token.OpKeyword:\n item = parseOperationStatement(pos, decorators);\n break;\n case Token.EnumKeyword:\n item = parseEnumStatement(pos, decorators);\n break;\n case Token.AliasKeyword:\n reportInvalidDecorators(decorators, \"alias statement\");\n item = parseAliasStatement(pos);\n break;\n case Token.ConstKeyword:\n reportInvalidDecorators(decorators, \"const statement\");\n item = parseConstStatement(pos);\n break;\n case Token.UsingKeyword:\n reportInvalidDecorators(decorators, \"using statement\");\n item = parseUsingStatement(pos);\n break;\n case Token.Semicolon:\n reportInvalidDecorators(decorators, \"empty statement\");\n item = parseEmptyStatement(pos);\n break;\n // Start of declaration with modifiers\n case Token.ExternKeyword:\n case Token.FnKeyword:\n case Token.DecKeyword:\n item = parseDeclaration(pos);\n break;\n default:\n item = parseInvalidStatement(pos, decorators);\n break;\n }\n\n if (tok !== Token.NamespaceKeyword) {\n mutate(item).directives = directives;\n mutate(item).docs = docs;\n }\n\n if (isBlocklessNamespace(item)) {\n if (seenBlocklessNs) {\n error({ code: \"multiple-blockless-namespace\", target: item });\n }\n if (seenDecl) {\n error({ code: \"blockless-namespace-first\", target: item });\n }\n seenBlocklessNs = true;\n } else if (item.kind === SyntaxKind.ImportStatement) {\n if (seenDecl || seenBlocklessNs || seenUsing) {\n error({ code: \"import-first\", target: item });\n }\n } else if (item.kind === SyntaxKind.UsingStatement) {\n seenUsing = true;\n } else {\n seenDecl = true;\n }\n\n stmts.push(item);\n }\n\n return stmts;\n }\n\n function parseStatementList(): Statement[] {\n const stmts: Statement[] = [];\n\n while (token() !== Token.CloseBrace) {\n const { pos, docs, directives, decorators } = parseAnnotations();\n const tok = token();\n\n let item: Statement;\n switch (tok) {\n case Token.AtAt:\n reportInvalidDecorators(decorators, \"augment decorator statement\");\n item = parseAugmentDecorator();\n break;\n case Token.ImportKeyword:\n reportInvalidDecorators(decorators, \"import statement\");\n item = parseImportStatement();\n error({ code: \"import-first\", messageId: \"topLevel\", target: item });\n break;\n case Token.ModelKeyword:\n item = parseModelStatement(pos, decorators);\n break;\n case Token.ScalarKeyword:\n item = parseScalarStatement(pos, decorators);\n break;\n case Token.NamespaceKeyword:\n const ns = parseNamespaceStatement(pos, decorators, docs, directives);\n\n if (isBlocklessNamespace(ns)) {\n error({ code: \"blockless-namespace-first\", messageId: \"topLevel\", target: ns });\n }\n item = ns;\n break;\n case Token.InterfaceKeyword:\n item = parseInterfaceStatement(pos, decorators);\n break;\n case Token.UnionKeyword:\n item = parseUnionStatement(pos, decorators);\n break;\n case Token.OpKeyword:\n item = parseOperationStatement(pos, decorators);\n break;\n case Token.EnumKeyword:\n item = parseEnumStatement(pos, decorators);\n break;\n case Token.AliasKeyword:\n reportInvalidDecorators(decorators, \"alias statement\");\n item = parseAliasStatement(pos);\n break;\n case Token.ConstKeyword:\n reportInvalidDecorators(decorators, \"const statement\");\n item = parseConstStatement(pos);\n break;\n case Token.UsingKeyword:\n reportInvalidDecorators(decorators, \"using statement\");\n item = parseUsingStatement(pos);\n break;\n case Token.ExternKeyword:\n case Token.FnKeyword:\n case Token.DecKeyword:\n item = parseDeclaration(pos);\n break;\n case Token.EndOfFile:\n parseExpected(Token.CloseBrace);\n return stmts;\n case Token.Semicolon:\n reportInvalidDecorators(decorators, \"empty statement\");\n item = parseEmptyStatement(pos);\n break;\n default:\n item = parseInvalidStatement(pos, decorators);\n break;\n }\n mutate(item).directives = directives;\n if (tok !== Token.NamespaceKeyword) {\n mutate(item).docs = docs;\n }\n stmts.push(item);\n }\n\n return stmts;\n }\n\n function parseDecoratorList() {\n const decorators: DecoratorExpressionNode[] = [];\n\n while (token() === Token.At) {\n decorators.push(parseDecoratorExpression());\n }\n\n return decorators;\n }\n\n function parseDirectiveList(): DirectiveExpressionNode[] {\n const directives: DirectiveExpressionNode[] = [];\n\n while (token() === Token.Hash) {\n directives.push(parseDirectiveExpression());\n }\n\n return directives;\n }\n\n function parseNamespaceStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n docs: DocNode[],\n directives: DirectiveExpressionNode[],\n ): NamespaceStatementNode {\n parseExpected(Token.NamespaceKeyword);\n let currentName = parseIdentifierOrMemberExpression();\n const nsSegments: IdentifierNode[] = [];\n while (currentName.kind !== SyntaxKind.Identifier) {\n nsSegments.push(currentName.id);\n currentName = currentName.base;\n }\n nsSegments.push(currentName);\n\n const nextTok = parseExpectedOneOf(Token.Semicolon, Token.OpenBrace);\n\n let statements: Statement[] | undefined;\n if (nextTok === Token.OpenBrace) {\n statements = parseStatementList();\n parseExpected(Token.CloseBrace);\n }\n\n let outerNs: NamespaceStatementNode = {\n kind: SyntaxKind.NamespaceStatement,\n decorators,\n docs: docs,\n id: nsSegments[0],\n locals: undefined!,\n statements,\n directives: directives,\n ...finishNode(pos),\n };\n\n for (let i = 1; i < nsSegments.length; i++) {\n outerNs = {\n kind: SyntaxKind.NamespaceStatement,\n decorators: [],\n directives: [],\n id: nsSegments[i],\n statements: outerNs,\n locals: undefined!,\n ...finishNode(pos),\n };\n }\n\n return outerNs;\n }\n\n function parseInterfaceStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): InterfaceStatementNode {\n parseExpected(Token.InterfaceKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n let extendList: ListDetail<TypeReferenceNode> = createEmptyList<TypeReferenceNode>();\n if (token() === Token.ExtendsKeyword) {\n nextToken();\n extendList = parseList(ListKind.Heritage, parseReferenceExpression);\n } else if (token() === Token.Identifier) {\n error({ code: \"token-expected\", format: { token: \"'extends' or '{'\" } });\n nextToken();\n }\n\n const { items: operations, range: bodyRange } = parseList(\n ListKind.InterfaceMembers,\n (pos, decorators) => parseOperationStatement(pos, decorators, true),\n );\n\n return {\n kind: SyntaxKind.InterfaceStatement,\n id,\n templateParameters,\n templateParametersRange,\n operations,\n bodyRange,\n extends: extendList.items,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseTemplateParameterList(): ListDetail<TemplateParameterDeclarationNode> {\n const detail = parseOptionalList(ListKind.TemplateParameters, parseTemplateParameter);\n let setDefault = false;\n for (const item of detail.items) {\n if (!item.default && setDefault) {\n error({ code: \"default-required\", target: item });\n continue;\n }\n\n if (item.default) {\n setDefault = true;\n }\n }\n\n return detail;\n }\n\n function parseUnionStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): UnionStatementNode {\n parseExpected(Token.UnionKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n const { items: options } = parseList(ListKind.UnionVariants, parseUnionVariant);\n\n return {\n kind: SyntaxKind.UnionStatement,\n id,\n templateParameters,\n templateParametersRange,\n decorators,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseIdOrValueForVariant(): Expression {\n const nextToken = token();\n\n let id: IdentifierNode | undefined;\n if (isReservedKeyword(nextToken)) {\n id = parseIdentifier({ allowReservedIdentifier: true });\n // If the next token is not a colon this means we tried to use the reserved keyword as a type reference\n if (token() !== Token.Colon) {\n error({ code: \"reserved-identifier\", messageId: \"future\", format: { name: id.sv } });\n }\n return {\n kind: SyntaxKind.TypeReference,\n target: id,\n arguments: [],\n ...finishNode(id.pos),\n };\n } else {\n return parseExpression();\n }\n }\n\n function parseUnionVariant(pos: number, decorators: DecoratorExpressionNode[]): UnionVariantNode {\n const idOrExpr = parseIdOrValueForVariant();\n if (parseOptional(Token.Colon)) {\n let id: IdentifierNode | undefined = undefined;\n\n if (\n idOrExpr.kind !== SyntaxKind.TypeReference &&\n idOrExpr.kind !== SyntaxKind.StringLiteral\n ) {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n } else if (idOrExpr.kind === SyntaxKind.StringLiteral) {\n // convert string literal node to identifier node (back compat for string literal quoted properties)\n id = {\n kind: SyntaxKind.Identifier,\n sv: idOrExpr.value,\n ...finishNode(idOrExpr.pos),\n };\n } else {\n const target = idOrExpr.target;\n if (target.kind === SyntaxKind.Identifier) {\n id = target;\n } else {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n }\n }\n\n const value = parseExpression();\n\n return {\n kind: SyntaxKind.UnionVariant,\n id,\n value,\n decorators,\n ...finishNode(pos),\n };\n }\n\n return {\n kind: SyntaxKind.UnionVariant,\n id: undefined,\n value: idOrExpr,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseUsingStatement(pos: number): UsingStatementNode {\n parseExpected(Token.UsingKeyword);\n const name = parseIdentifierOrMemberExpression();\n parseExpected(Token.Semicolon);\n\n return {\n kind: SyntaxKind.UsingStatement,\n name,\n ...finishNode(pos),\n };\n }\n\n function parseOperationStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n inInterface?: boolean,\n ): OperationStatementNode {\n if (inInterface) {\n parseOptional(Token.OpKeyword);\n } else {\n parseExpected(Token.OpKeyword);\n }\n\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n // Make sure the next token is one that is expected\n const token = expectTokenIsOneOf(Token.OpenParen, Token.IsKeyword);\n\n // Check if we're parsing a declaration or reuse of another operation\n let signature: OperationSignature;\n const signaturePos = tokenPos();\n if (token === Token.OpenParen) {\n const parameters = parseOperationParameters();\n parseExpected(Token.Colon);\n const returnType = parseExpression();\n\n signature = {\n kind: SyntaxKind.OperationSignatureDeclaration,\n parameters,\n returnType,\n ...finishNode(signaturePos),\n };\n } else {\n parseExpected(Token.IsKeyword);\n const opReference = parseReferenceExpression();\n\n signature = {\n kind: SyntaxKind.OperationSignatureReference,\n baseOperation: opReference,\n ...finishNode(signaturePos),\n };\n }\n\n // The interface parser handles semicolon parsing between statements\n if (!inInterface) {\n parseExpected(Token.Semicolon);\n }\n\n return {\n kind: SyntaxKind.OperationStatement,\n id,\n templateParameters,\n templateParametersRange,\n signature,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseOperationParameters(): ModelExpressionNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.OperationParameters,\n parseModelPropertyOrSpread,\n );\n const parameters: ModelExpressionNode = {\n kind: SyntaxKind.ModelExpression,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n return parameters;\n }\n\n function parseModelStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelStatementNode {\n parseExpected(Token.ModelKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n expectTokenIsOneOf(Token.OpenBrace, Token.Equals, Token.ExtendsKeyword, Token.IsKeyword);\n\n const optionalExtends = parseOptionalModelExtends();\n const optionalIs = optionalExtends ? undefined : parseOptionalModelIs();\n\n let propDetail: ListDetail<ModelPropertyNode | ModelSpreadPropertyNode> = createEmptyList<\n ModelPropertyNode | ModelSpreadPropertyNode\n >();\n if (optionalIs) {\n const tok = expectTokenIsOneOf(Token.Semicolon, Token.OpenBrace);\n if (tok === Token.Semicolon) {\n nextToken();\n } else {\n propDetail = parseList(ListKind.ModelProperties, parseModelPropertyOrSpread);\n }\n } else {\n propDetail = parseList(ListKind.ModelProperties, parseModelPropertyOrSpread);\n }\n\n return {\n kind: SyntaxKind.ModelStatement,\n id,\n extends: optionalExtends,\n is: optionalIs,\n templateParameters,\n templateParametersRange,\n decorators,\n properties: propDetail.items,\n bodyRange: propDetail.range,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalModelExtends() {\n if (parseOptional(Token.ExtendsKeyword)) {\n return parseExpression();\n }\n return undefined;\n }\n\n function parseOptionalModelIs() {\n if (parseOptional(Token.IsKeyword)) {\n return parseExpression();\n }\n return;\n }\n\n function parseTemplateParameter(): TemplateParameterDeclarationNode {\n const pos = tokenPos();\n const id = parseIdentifier();\n let constraint: Expression | ValueOfExpressionNode | undefined;\n if (parseOptional(Token.ExtendsKeyword)) {\n constraint = parseMixedParameterConstraint();\n }\n let def: Expression | undefined;\n if (parseOptional(Token.Equals)) {\n def = parseExpression();\n }\n return {\n kind: SyntaxKind.TemplateParameterDeclaration,\n id,\n constraint,\n default: def,\n ...finishNode(pos),\n };\n }\n\n function parseValueOfExpressionOrIntersectionOrHigher() {\n if (token() === Token.ValueOfKeyword) {\n return parseValueOfExpression();\n } else if (parseOptional(Token.OpenParen)) {\n const expr = parseMixedParameterConstraint();\n parseExpected(Token.CloseParen);\n return expr;\n }\n\n return parseIntersectionExpressionOrHigher();\n }\n\n function parseMixedParameterConstraint(): Expression | ValueOfExpressionNode {\n const pos = tokenPos();\n parseOptional(Token.Bar);\n const node: Expression = parseValueOfExpressionOrIntersectionOrHigher();\n\n if (token() !== Token.Bar) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Bar)) {\n const expr = parseValueOfExpressionOrIntersectionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.UnionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseModelPropertyOrSpread(pos: number, decorators: DecoratorExpressionNode[]) {\n return token() === Token.Ellipsis\n ? parseModelSpreadProperty(pos, decorators)\n : parseModelProperty(pos, decorators);\n }\n\n function parseModelSpreadProperty(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelSpreadPropertyNode {\n parseExpected(Token.Ellipsis);\n\n reportInvalidDecorators(decorators, \"spread property\");\n\n // This could be broadened to allow any type expression\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.ModelSpreadProperty,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseModelProperty(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelPropertyNode {\n const id = parseIdentifier({\n message: \"property\",\n allowStringLiteral: true,\n allowReservedIdentifier: true,\n });\n\n const optional = parseOptional(Token.Question);\n parseExpected(Token.Colon);\n const value = parseExpression();\n\n const hasDefault = parseOptional(Token.Equals);\n const defaultValue = hasDefault ? parseExpression() : undefined;\n return {\n kind: SyntaxKind.ModelProperty,\n id,\n decorators,\n value,\n optional,\n default: defaultValue,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteralPropertyOrSpread(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ObjectLiteralPropertyNode | ObjectLiteralSpreadPropertyNode {\n reportInvalidDecorators(decorators, \"object literal property\");\n\n return token() === Token.Ellipsis\n ? parseObjectLiteralSpreadProperty(pos)\n : parseObjectLiteralProperty(pos);\n }\n\n function parseObjectLiteralSpreadProperty(pos: number): ObjectLiteralSpreadPropertyNode {\n parseExpected(Token.Ellipsis);\n\n // This could be broadened to allow any type expression\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.ObjectLiteralSpreadProperty,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteralProperty(pos: number): ObjectLiteralPropertyNode {\n const id = parseIdentifier({\n message: \"property\",\n allowReservedIdentifier: true,\n });\n\n parseExpected(Token.Colon);\n const value = parseExpression();\n\n return {\n kind: SyntaxKind.ObjectLiteralProperty,\n id,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseScalarStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ScalarStatementNode {\n parseExpected(Token.ScalarKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n const optionalExtends = parseOptionalScalarExtends();\n const { items: members, range: bodyRange } = parseScalarMembers();\n\n return {\n kind: SyntaxKind.ScalarStatement,\n id,\n templateParameters,\n templateParametersRange,\n extends: optionalExtends,\n members,\n bodyRange,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalScalarExtends() {\n if (parseOptional(Token.ExtendsKeyword)) {\n return parseReferenceExpression();\n }\n return undefined;\n }\n\n function parseScalarMembers(): ListDetail<ScalarConstructorNode> {\n if (token() === Token.Semicolon) {\n nextToken();\n return createEmptyList<ScalarConstructorNode>();\n } else {\n return parseList(ListKind.ScalarMembers, parseScalarMember);\n }\n }\n\n function parseScalarMember(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ScalarConstructorNode {\n reportInvalidDecorators(decorators, \"scalar member\");\n\n parseExpected(Token.InitKeyword);\n const id = parseIdentifier();\n const { items: parameters } = parseFunctionParameters();\n return {\n kind: SyntaxKind.ScalarConstructor,\n id,\n parameters,\n ...finishNode(pos),\n };\n }\n\n function parseEnumStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): EnumStatementNode {\n parseExpected(Token.EnumKeyword);\n const id = parseIdentifier();\n const { items: members } = parseList(ListKind.EnumMembers, parseEnumMemberOrSpread);\n return {\n kind: SyntaxKind.EnumStatement,\n id,\n decorators,\n members,\n ...finishNode(pos),\n };\n }\n\n function parseEnumMemberOrSpread(pos: number, decorators: DecoratorExpressionNode[]) {\n return token() === Token.Ellipsis\n ? parseEnumSpreadMember(pos, decorators)\n : parseEnumMember(pos, decorators);\n }\n\n function parseEnumSpreadMember(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): EnumSpreadMemberNode {\n parseExpected(Token.Ellipsis);\n\n reportInvalidDecorators(decorators, \"spread enum\");\n\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.EnumSpreadMember,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseEnumMember(pos: number, decorators: DecoratorExpressionNode[]): EnumMemberNode {\n const id = parseIdentifier({\n message: \"enumMember\",\n allowStringLiteral: true,\n allowReservedIdentifier: true,\n });\n\n let value: StringLiteralNode | NumericLiteralNode | undefined;\n if (parseOptional(Token.Colon)) {\n const expr = parseExpression();\n\n if (expr.kind === SyntaxKind.StringLiteral || expr.kind === SyntaxKind.NumericLiteral) {\n value = expr;\n } else if (\n expr.kind === SyntaxKind.TypeReference &&\n expr.target.flags & NodeFlags.ThisNodeHasError\n ) {\n parseErrorInNextFinishedNode = true;\n } else {\n error({ code: \"token-expected\", messageId: \"numericOrStringLiteral\", target: expr });\n }\n }\n\n return {\n kind: SyntaxKind.EnumMember,\n id,\n value,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseAliasStatement(pos: number): AliasStatementNode {\n parseExpected(Token.AliasKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n parseExpected(Token.Equals);\n const value = parseExpression();\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.AliasStatement,\n id,\n templateParameters,\n templateParametersRange,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseConstStatement(pos: number): ConstStatementNode {\n parseExpected(Token.ConstKeyword);\n const id = parseIdentifier();\n const type = parseOptionalTypeAnnotation();\n parseExpected(Token.Equals);\n const value = parseExpression();\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.ConstStatement,\n id,\n value,\n type,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalTypeAnnotation(): Expression | undefined {\n if (parseOptional(Token.Colon)) {\n return parseExpression();\n }\n return undefined;\n }\n\n function parseExpression(): Expression {\n return parseUnionExpressionOrHigher();\n }\n\n function parseUnionExpressionOrHigher(): Expression {\n const pos = tokenPos();\n parseOptional(Token.Bar);\n const node: Expression = parseIntersectionExpressionOrHigher();\n\n if (token() !== Token.Bar) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Bar)) {\n const expr = parseIntersectionExpressionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.UnionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseIntersectionExpressionOrHigher(): Expression {\n const pos = tokenPos();\n parseOptional(Token.Ampersand);\n const node: Expression = parseArrayExpressionOrHigher();\n\n if (token() !== Token.Ampersand) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Ampersand)) {\n const expr = parseArrayExpressionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.IntersectionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseArrayExpressionOrHigher(): Expression {\n const pos = tokenPos();\n let expr = parsePrimaryExpression();\n\n while (parseOptional(Token.OpenBracket)) {\n parseExpected(Token.CloseBracket);\n\n expr = {\n kind: SyntaxKind.ArrayExpression,\n elementType: expr,\n ...finishNode(pos),\n };\n }\n\n return expr;\n }\n\n function parseStandaloneReferenceExpression() {\n const expr = parseReferenceExpression();\n if (parseDiagnostics.length === 0 && token() !== Token.EndOfFile) {\n error({ code: \"token-expected\", messageId: \"unexpected\", format: { token: Token[token()] } });\n }\n return expr;\n }\n\n function parseValueOfExpression(): ValueOfExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.ValueOfKeyword);\n const target = parseExpression();\n\n return {\n kind: SyntaxKind.ValueOfExpression,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseTypeOfExpression(): TypeOfExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.TypeOfKeyword);\n const target = parseTypeOfTarget();\n\n return {\n kind: SyntaxKind.TypeOfExpression,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseTypeOfTarget(): Expression {\n while (true) {\n switch (token()) {\n case Token.TypeOfKeyword:\n return parseTypeOfExpression();\n case Token.Identifier:\n return parseCallOrReferenceExpression();\n case Token.StringLiteral:\n return parseStringLiteral();\n case Token.StringTemplateHead:\n return parseStringTemplateExpression();\n case Token.TrueKeyword:\n case Token.FalseKeyword:\n return parseBooleanLiteral();\n case Token.NumericLiteral:\n return parseNumericLiteral();\n case Token.OpenParen:\n parseExpected(Token.OpenParen);\n const target = parseTypeOfTarget();\n parseExpected(Token.CloseParen);\n return target;\n default:\n return parseReferenceExpression(\"typeofTarget\");\n }\n }\n }\n\n function parseReferenceExpression(\n message?: keyof CompilerDiagnostics[\"token-expected\"],\n ): TypeReferenceNode {\n const pos = tokenPos();\n const target = parseIdentifierOrMemberExpression({\n message,\n allowReservedIdentifierInMember: true,\n });\n return parseReferenceExpressionInternal(target, pos);\n }\n\n function parseCallOrReferenceExpression(\n message?: keyof CompilerDiagnostics[\"token-expected\"],\n ): TypeReferenceNode | CallExpressionNode {\n const pos = tokenPos();\n const target = parseIdentifierOrMemberExpression({\n message,\n allowReservedIdentifierInMember: true,\n });\n if (token() === Token.OpenParen) {\n const { items: args } = parseList(ListKind.FunctionArguments, parseExpression);\n return {\n kind: SyntaxKind.CallExpression,\n target,\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n return parseReferenceExpressionInternal(target, pos);\n }\n\n function parseReferenceExpressionInternal(\n target: IdentifierNode | MemberExpressionNode,\n pos: number,\n ): TypeReferenceNode {\n const { items: args } = parseOptionalList(ListKind.TemplateArguments, parseTemplateArgument);\n\n return {\n kind: SyntaxKind.TypeReference,\n target,\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n function parseTemplateArgument(): TemplateArgumentNode {\n const pos = tokenPos();\n\n // Early error recovery for missing identifier followed by eq\n if (token() === Token.Equals) {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n nextToken();\n return {\n kind: SyntaxKind.TemplateArgument,\n name: createMissingIdentifier(),\n argument: parseExpression(),\n ...finishNode(pos),\n };\n }\n\n const expr: Expression = parseExpression();\n\n const eq = parseOptional(Token.Equals);\n\n if (eq) {\n const isBareIdentifier = exprIsBareIdentifier(expr);\n\n if (!isBareIdentifier) {\n error({ code: \"invalid-template-argument-name\", target: expr });\n }\n\n return {\n kind: SyntaxKind.TemplateArgument,\n name: isBareIdentifier ? expr.target : createMissingIdentifier(),\n argument: parseExpression(),\n ...finishNode(pos),\n };\n } else {\n return {\n kind: SyntaxKind.TemplateArgument,\n argument: expr,\n ...finishNode(pos),\n };\n }\n }\n\n function parseAugmentDecorator(): AugmentDecoratorStatementNode {\n const pos = tokenPos();\n parseExpected(Token.AtAt);\n\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier. We want to parse `@ model Foo` as invalid decorator\n // `@<missing identifier>` applied to `model Foo`, and not as `@model`\n // applied to invalid statement `Foo`.\n const target = parseIdentifierOrMemberExpression({\n allowReservedIdentifier: true,\n allowReservedIdentifierInMember: true,\n });\n const { items: args } = parseOptionalList(ListKind.DecoratorArguments, parseExpression);\n if (args.length === 0) {\n error({ code: \"augment-decorator-target\" });\n const emptyList = createEmptyList<TemplateArgumentNode>();\n return {\n kind: SyntaxKind.AugmentDecoratorStatement,\n target,\n targetType: {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: emptyList.items,\n ...finishNode(pos),\n },\n arguments: args,\n ...finishNode(pos),\n };\n }\n let [targetEntity, ...decoratorArgs] = args;\n if (targetEntity.kind !== SyntaxKind.TypeReference) {\n error({ code: \"augment-decorator-target\", target: targetEntity });\n const emptyList = createEmptyList<TemplateArgumentNode>();\n targetEntity = {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: emptyList.items,\n ...finishNode(pos),\n };\n }\n\n parseExpected(Token.Semicolon);\n\n return {\n kind: SyntaxKind.AugmentDecoratorStatement,\n target,\n targetType: targetEntity,\n arguments: decoratorArgs,\n ...finishNode(pos),\n };\n }\n function parseImportStatement(): ImportStatementNode {\n const pos = tokenPos();\n\n parseExpected(Token.ImportKeyword);\n const path = parseStringLiteral();\n\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.ImportStatement,\n path,\n ...finishNode(pos),\n };\n }\n\n function parseDecoratorExpression(): DecoratorExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.At);\n\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier. We want to parse `@ model Foo` as invalid decorator\n // `@<missing identifier>` applied to `model Foo`, and not as `@model`\n // applied to invalid statement `Foo`.\n const target = parseIdentifierOrMemberExpression({\n allowReservedIdentifier: true,\n allowReservedIdentifierInMember: true,\n });\n const { items: args } = parseOptionalList(ListKind.DecoratorArguments, parseExpression);\n return {\n kind: SyntaxKind.DecoratorExpression,\n arguments: args,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseDirectiveExpression(): DirectiveExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.Hash);\n\n const target = parseIdentifier();\n if (target.sv !== \"suppress\" && target.sv !== \"deprecated\") {\n error({\n code: \"unknown-directive\",\n format: { id: target.sv },\n target: { pos, end: pos + target.sv.length },\n printable: true,\n });\n }\n // The newline will mark the end of the directive.\n newLineIsTrivia = false;\n const args = [];\n while (token() !== Token.NewLine && token() !== Token.EndOfFile) {\n const param = parseDirectiveParameter();\n if (param) {\n args.push(param);\n }\n }\n\n newLineIsTrivia = true;\n nextToken();\n return {\n kind: SyntaxKind.DirectiveExpression,\n arguments: args,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseDirectiveParameter(): DirectiveArgument | undefined {\n switch (token()) {\n case Token.Identifier:\n return parseIdentifier();\n case Token.StringLiteral:\n return parseStringLiteral();\n default:\n error({\n code: \"token-expected\",\n messageId: \"unexpected\",\n format: { token: Token[token()] },\n });\n do {\n nextToken();\n } while (\n !isStatementKeyword(token()) &&\n token() !== Token.NewLine &&\n token() !== Token.At &&\n token() !== Token.Semicolon &&\n token() !== Token.EndOfFile\n );\n return undefined;\n }\n }\n\n function parseIdentifierOrMemberExpression(options?: {\n message?: keyof CompilerDiagnostics[\"token-expected\"];\n // Temporary solution see doc on parseIdentifier\n allowReservedIdentifier?: boolean;\n allowReservedIdentifierInMember?: boolean;\n }): IdentifierNode | MemberExpressionNode {\n const pos = tokenPos();\n let base: IdentifierNode | MemberExpressionNode = parseIdentifier({\n message: options?.message,\n allowReservedIdentifier: options?.allowReservedIdentifier,\n });\n while (token() !== Token.EndOfFile) {\n if (parseOptional(Token.Dot)) {\n base = {\n kind: SyntaxKind.MemberExpression,\n base,\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier after `.` in member expression. Otherwise we will\n // parse `@Outer.<missing identifier> model M{}` as having decorator\n // `@Outer.model` applied to invalid statement `M {}` instead of\n // having incomplete decorator `@Outer.` applied to `model M {}`.\n id: parseIdentifier({\n allowReservedIdentifier: options?.allowReservedIdentifierInMember,\n }),\n selector: \".\",\n ...finishNode(pos),\n };\n } else if (parseOptional(Token.ColonColon)) {\n base = {\n kind: SyntaxKind.MemberExpression,\n base,\n id: parseIdentifier(),\n selector: \"::\",\n ...finishNode(pos),\n };\n } else {\n break;\n }\n }\n\n return base;\n }\n\n function parsePrimaryExpression(): Expression {\n while (true) {\n switch (token()) {\n case Token.TypeOfKeyword:\n return parseTypeOfExpression();\n case Token.Identifier:\n return parseCallOrReferenceExpression();\n case Token.StringLiteral:\n return parseStringLiteral();\n case Token.StringTemplateHead:\n return parseStringTemplateExpression();\n case Token.TrueKeyword:\n case Token.FalseKeyword:\n return parseBooleanLiteral();\n case Token.NumericLiteral:\n return parseNumericLiteral();\n case Token.OpenBrace:\n return parseModelExpression();\n case Token.OpenBracket:\n return parseTupleExpression();\n case Token.OpenParen:\n return parseParenthesizedExpression();\n case Token.At:\n const decorators = parseDecoratorList();\n reportInvalidDecorators(decorators, \"expression\");\n continue;\n case Token.Hash:\n const directives = parseDirectiveList();\n reportInvalidDirective(directives, \"expression\");\n continue;\n case Token.HashBrace:\n return parseObjectLiteral();\n case Token.HashBracket:\n return parseArrayLiteral();\n case Token.VoidKeyword:\n return parseVoidKeyword();\n case Token.NeverKeyword:\n return parseNeverKeyword();\n case Token.UnknownKeyword:\n return parseUnknownKeyword();\n default:\n return parseReferenceExpression(\"expression\");\n }\n }\n }\n\n function parseExternKeyword(): ExternKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.ExternKeyword);\n return {\n kind: SyntaxKind.ExternKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseVoidKeyword(): VoidKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.VoidKeyword);\n return {\n kind: SyntaxKind.VoidKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseNeverKeyword(): NeverKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.NeverKeyword);\n return {\n kind: SyntaxKind.NeverKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseUnknownKeyword(): AnyKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.UnknownKeyword);\n return {\n kind: SyntaxKind.UnknownKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseParenthesizedExpression(): Expression {\n const pos = tokenPos();\n parseExpected(Token.OpenParen);\n const expr = parseExpression();\n parseExpected(Token.CloseParen);\n return { ...expr, ...finishNode(pos) };\n }\n\n function parseTupleExpression(): TupleExpressionNode {\n const pos = tokenPos();\n const { items: values } = parseList(ListKind.Tuple, parseExpression);\n return {\n kind: SyntaxKind.TupleExpression,\n values,\n ...finishNode(pos),\n };\n }\n\n function parseModelExpression(): ModelExpressionNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.ModelProperties,\n parseModelPropertyOrSpread,\n );\n return {\n kind: SyntaxKind.ModelExpression,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteral(): ObjectLiteralNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.ObjectLiteralProperties,\n parseObjectLiteralPropertyOrSpread,\n );\n return {\n kind: SyntaxKind.ObjectLiteral,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n }\n\n function parseArrayLiteral(): ArrayLiteralNode {\n const pos = tokenPos();\n const { items: values } = parseList(ListKind.ArrayLiteral, parseExpression);\n return {\n kind: SyntaxKind.ArrayLiteral,\n values,\n ...finishNode(pos),\n };\n }\n\n function parseStringLiteral(): StringLiteralNode {\n const pos = tokenPos();\n const value = tokenValue();\n parseExpected(Token.StringLiteral);\n return {\n kind: SyntaxKind.StringLiteral,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateExpression(): StringTemplateExpressionNode {\n const pos = tokenPos();\n const head = parseStringTemplateHead();\n const spans = parseStringTemplateSpans(head.tokenFlags);\n const last = spans[spans.length - 1];\n\n if (head.tokenFlags & TokenFlags.TripleQuoted) {\n const [indentationsStart, indentationEnd] = scanner.findTripleQuotedStringIndent(\n last.literal.pos,\n last.literal.end,\n );\n mutate(head).value = scanner.unindentAndUnescapeTripleQuotedString(\n head.pos,\n head.end,\n indentationsStart,\n indentationEnd,\n Token.StringTemplateHead,\n head.tokenFlags,\n );\n for (const span of spans) {\n mutate(span.literal).value = scanner.unindentAndUnescapeTripleQuotedString(\n span.literal.pos,\n span.literal.end,\n indentationsStart,\n indentationEnd,\n span === last ? Token.StringTemplateTail : Token.StringTemplateMiddle,\n head.tokenFlags,\n );\n }\n }\n return {\n kind: SyntaxKind.StringTemplateExpression,\n head,\n spans,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateHead(): StringTemplateHeadNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n\n parseExpected(Token.StringTemplateHead);\n\n return {\n kind: SyntaxKind.StringTemplateHead,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateSpans(tokenFlags: TokenFlags): readonly StringTemplateSpanNode[] {\n const list: StringTemplateSpanNode[] = [];\n let node: StringTemplateSpanNode;\n do {\n node = parseTemplateTypeSpan(tokenFlags);\n list.push(node);\n } while (node.literal.kind === SyntaxKind.StringTemplateMiddle);\n return list;\n }\n\n function parseTemplateTypeSpan(tokenFlags: TokenFlags): StringTemplateSpanNode {\n const pos = tokenPos();\n const expression = parseExpression();\n const literal = parseLiteralOfTemplateSpan(tokenFlags);\n return {\n kind: SyntaxKind.StringTemplateSpan,\n literal,\n expression,\n ...finishNode(pos),\n };\n }\n function parseLiteralOfTemplateSpan(\n headTokenFlags: TokenFlags,\n ): StringTemplateMiddleNode | StringTemplateTailNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n\n if (token() === Token.CloseBrace) {\n nextStringTemplateToken(headTokenFlags);\n return parseTemplateMiddleOrTemplateTail();\n } else {\n parseExpected(Token.StringTemplateTail);\n return {\n kind: SyntaxKind.StringTemplateTail,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n }\n\n function parseTemplateMiddleOrTemplateTail(): StringTemplateMiddleNode | StringTemplateTailNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n const kind =\n token() === Token.StringTemplateMiddle\n ? SyntaxKind.StringTemplateMiddle\n : SyntaxKind.StringTemplateTail;\n\n nextToken();\n return {\n kind,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n\n function parseNumericLiteral(): NumericLiteralNode {\n const pos = tokenPos();\n const valueAsString = tokenValue();\n const value = Number(valueAsString);\n\n parseExpected(Token.NumericLiteral);\n return {\n kind: SyntaxKind.NumericLiteral,\n value,\n valueAsString,\n ...finishNode(pos),\n };\n }\n\n function parseBooleanLiteral(): BooleanLiteralNode {\n const pos = tokenPos();\n const token = parseExpectedOneOf(Token.TrueKeyword, Token.FalseKeyword);\n const value = token === Token.TrueKeyword;\n return {\n kind: SyntaxKind.BooleanLiteral,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseIdentifier(options?: {\n message?: keyof CompilerDiagnostics[\"token-expected\"];\n allowStringLiteral?: boolean; // Allow string literals to be used as identifiers for backward-compatibility, but convert to an identifier node.\n\n // Temporary solution to allow reserved keywords as identifiers in certain contexts. This should get expanded to a more general solution per keyword category.\n allowReservedIdentifier?: boolean;\n }): IdentifierNode {\n if (isKeyword(token())) {\n error({ code: \"reserved-identifier\" });\n return createMissingIdentifier();\n } else if (isReservedKeyword(token())) {\n if (!options?.allowReservedIdentifier) {\n error({ code: \"reserved-identifier\", messageId: \"future\", format: { name: tokenValue() } });\n }\n } else if (\n token() !== Token.Identifier &&\n (!options?.allowStringLiteral || token() !== Token.StringLiteral)\n ) {\n // Error recovery: when we fail to parse an identifier or expression,\n // we insert a synthesized identifier with a unique name.\n error({ code: \"token-expected\", messageId: options?.message ?? \"identifier\" });\n return createMissingIdentifier();\n }\n\n const pos = tokenPos();\n const sv = tokenValue();\n nextToken();\n\n return {\n kind: SyntaxKind.Identifier,\n sv,\n ...finishNode(pos),\n };\n }\n\n function parseDeclaration(\n pos: number,\n ): DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode | InvalidStatementNode {\n const modifiers = parseModifiers();\n switch (token()) {\n case Token.DecKeyword:\n return parseDecoratorDeclarationStatement(pos, modifiers);\n case Token.FnKeyword:\n return parseFunctionDeclarationStatement(pos, modifiers);\n }\n return parseInvalidStatement(pos, []);\n }\n\n function parseModifiers(): Modifier[] {\n const modifiers: Modifier[] = [];\n let modifier;\n while ((modifier = parseModifier())) {\n modifiers.push(modifier);\n }\n return modifiers;\n }\n\n function parseModifier(): Modifier | undefined {\n switch (token()) {\n case Token.ExternKeyword:\n return parseExternKeyword();\n default:\n return undefined;\n }\n }\n\n function parseDecoratorDeclarationStatement(\n pos: number,\n modifiers: Modifier[],\n ): DecoratorDeclarationStatementNode {\n const modifierFlags = modifiersToFlags(modifiers);\n parseExpected(Token.DecKeyword);\n const id = parseIdentifier();\n const allParamListDetail = parseFunctionParameters();\n let [target, ...parameters] = allParamListDetail.items;\n if (target === undefined) {\n error({ code: \"decorator-decl-target\", target: { pos, end: previousTokenEnd } });\n target = {\n kind: SyntaxKind.FunctionParameter,\n id: createMissingIdentifier(),\n type: createMissingTypeReference(),\n optional: false,\n rest: false,\n ...finishNode(pos),\n };\n }\n if (target.optional) {\n error({ code: \"decorator-decl-target\", messageId: \"required\" });\n }\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.DecoratorDeclarationStatement,\n modifiers,\n modifierFlags,\n id,\n target,\n parameters,\n ...finishNode(pos),\n };\n }\n\n function parseFunctionDeclarationStatement(\n pos: number,\n modifiers: Modifier[],\n ): FunctionDeclarationStatementNode {\n const modifierFlags = modifiersToFlags(modifiers);\n parseExpected(Token.FnKeyword);\n const id = parseIdentifier();\n const { items: parameters } = parseFunctionParameters();\n let returnType;\n if (parseOptional(Token.Colon)) {\n returnType = parseExpression();\n }\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.FunctionDeclarationStatement,\n modifiers,\n modifierFlags,\n id,\n parameters,\n returnType,\n ...finishNode(pos),\n };\n }\n\n function parseFunctionParameters(): ListDetail<FunctionParameterNode> {\n const parameters = parseList<typeof ListKind.FunctionParameters, FunctionParameterNode>(\n ListKind.FunctionParameters,\n parseFunctionParameter,\n );\n\n let foundOptional = false;\n for (const [index, item] of parameters.items.entries()) {\n if (!item.optional && foundOptional) {\n error({ code: \"required-parameter-first\", target: item });\n continue;\n }\n\n if (item.optional) {\n foundOptional = true;\n }\n\n if (item.rest && item.optional) {\n error({ code: \"rest-parameter-required\", target: item });\n }\n if (item.rest && index !== parameters.items.length - 1) {\n error({ code: \"rest-parameter-last\", target: item });\n }\n }\n return parameters;\n }\n\n function parseFunctionParameter(): FunctionParameterNode {\n const pos = tokenPos();\n const rest = parseOptional(Token.Ellipsis);\n const id = parseIdentifier({ message: \"property\", allowReservedIdentifier: true });\n\n const optional = parseOptional(Token.Question);\n let type;\n if (parseOptional(Token.Colon)) {\n type = parseMixedParameterConstraint();\n }\n return {\n kind: SyntaxKind.FunctionParameter,\n id,\n type,\n optional,\n rest,\n ...finishNode(pos),\n };\n }\n\n function modifiersToFlags(modifiers: Modifier[]): ModifierFlags {\n let flags = ModifierFlags.None;\n for (const modifier of modifiers) {\n switch (modifier.kind) {\n case SyntaxKind.ExternKeyword:\n flags |= ModifierFlags.Extern;\n break;\n }\n }\n return flags;\n }\n\n function parseRange<T>(mode: ParseMode, range: TextRange, callback: () => T): T {\n const savedMode = currentMode;\n const result = scanner.scanRange(range, () => {\n currentMode = mode;\n nextToken();\n return callback();\n });\n currentMode = savedMode;\n return result;\n }\n\n /** Remove leading slash-star-star and trailing star-slash (if terminated) from doc comment range. */\n function innerDocRange(range: TextRange): TextRange {\n return {\n pos: range.pos + 3,\n end: tokenFlags() & TokenFlags.Unterminated ? range.end : range.end - 2,\n };\n }\n\n function parseDocList(): [pos: number, nodes: DocNode[]] {\n if (docRanges.length === 0 || options.docs === false) {\n return [tokenPos(), []];\n }\n const docs: DocNode[] = [];\n for (const range of docRanges) {\n const doc = parseRange(ParseMode.Doc, innerDocRange(range), () => parseDoc(range));\n docs.push(doc);\n if (range.comment) {\n mutate(range.comment).parsedAsDocs = true;\n }\n }\n\n return [docRanges[0].pos, docs];\n }\n\n function parseDoc(range: TextRange): DocNode {\n const content: DocContent[] = [];\n const tags: DocTag[] = [];\n\n loop: while (true) {\n switch (token()) {\n case Token.EndOfFile:\n break loop;\n case Token.At:\n const tag = parseDocTag();\n tags.push(tag);\n break;\n default:\n content.push(...parseDocContent());\n break;\n }\n }\n\n return {\n kind: SyntaxKind.Doc,\n content,\n tags,\n ...finishNode(range.pos),\n end: range.end,\n };\n }\n\n function parseDocContent(): DocContent[] {\n const parts: string[] = [];\n const source = scanner.file.text;\n const pos = tokenPos();\n\n let start = pos;\n let inCodeFence = false;\n\n loop: while (true) {\n switch (token()) {\n case Token.DocCodeFenceDelimiter:\n inCodeFence = !inCodeFence;\n nextToken();\n break;\n case Token.NewLine:\n parts.push(source.substring(start, tokenPos()));\n parts.push(\"\\n\"); // normalize line endings\n nextToken();\n start = tokenPos();\n while (parseOptional(Token.Whitespace));\n if (!parseOptional(Token.Star)) {\n break;\n }\n if (!inCodeFence) {\n parseOptional(Token.Whitespace);\n start = tokenPos();\n break;\n }\n // If we are in a code fence we want to preserve the leading whitespace\n // except for the first space after the star which is used as indentation.\n const whitespaceStart = tokenPos();\n parseOptional(Token.Whitespace);\n\n // This `min` handles the case when there is no whitespace after the\n // star e.g. a case like this:\n //\n // /**\n // *```\n // *foo-bar\n // *```\n // */\n //\n // Not having space after the star isn't idiomatic, but we support this.\n // `whitespaceStart + 1` strips the first space before `foo-bar` if there\n // is a space after the star (the idiomatic case).\n start = Math.min(whitespaceStart + 1, tokenPos());\n break;\n case Token.EndOfFile:\n break loop;\n case Token.At:\n if (!inCodeFence) {\n break loop;\n }\n nextToken();\n break;\n case Token.DocText:\n parts.push(source.substring(start, tokenPos()));\n parts.push(tokenValue());\n nextToken();\n start = tokenPos();\n break;\n default:\n nextToken();\n break;\n }\n }\n\n parts.push(source.substring(start, tokenPos()));\n const text = trim(parts.join(\"\"));\n\n return [\n {\n kind: SyntaxKind.DocText,\n text,\n ...finishNode(pos),\n },\n ];\n }\n\n type ParamLikeTag = DocTemplateTagNode | DocParamTagNode;\n type SimpleTag = DocReturnsTagNode | DocErrorsTagNode | DocUnknownTagNode;\n\n /**\n * Parses a documentation tag.\n *\n * @see <a href=\"https://typespec.io/docs/language-basics/documentation#doc-comments\">TypeSpec documentation docs</a>\n */\n function parseDocTag(): DocTag {\n const pos = tokenPos();\n parseExpected(Token.At);\n const tagName = parseDocIdentifier(\"tag\");\n switch (tagName.sv) {\n case \"param\":\n return parseDocParamLikeTag(pos, tagName, SyntaxKind.DocParamTag, \"param\");\n case \"template\":\n return parseDocParamLikeTag(pos, tagName, SyntaxKind.DocTemplateTag, \"templateParam\");\n case \"prop\":\n return parseDocPropTag(pos, tagName);\n case \"return\":\n case \"returns\":\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocReturnsTag);\n case \"errors\":\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocErrorsTag);\n default:\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocUnknownTag);\n }\n }\n\n /**\n * Handles param-like documentation comment tags.\n * For example, `@param` and `@template`.\n */\n function parseDocParamLikeTag(\n pos: number,\n tagName: IdentifierNode,\n kind: ParamLikeTag[\"kind\"],\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): ParamLikeTag {\n const { name, content } = parseDocParamLikeTagInternal(messageId);\n\n return {\n kind,\n tagName,\n paramName: name,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocPropTag(pos: number, tagName: IdentifierNode): DocPropTagNode {\n const { name, content } = parseDocParamLikeTagInternal(\"prop\");\n\n return {\n kind: SyntaxKind.DocPropTag,\n tagName,\n propName: name,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocParamLikeTagInternal(\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): { name: IdentifierNode; content: DocTextNode[] } {\n const name = parseDocIdentifier(messageId);\n parseOptionalHyphenDocParamLikeTag();\n const content = parseDocContent();\n return { name, content };\n }\n\n /**\n * Handles the optional hyphen in param-like documentation comment tags.\n *\n * TypeSpec recommends no hyphen, but supports a hyphen to match TSDoc.\n * (Original design discussion recorded in [2390].)\n *\n * [2390]: https://github.com/microsoft/typespec/issues/2390\n */\n function parseOptionalHyphenDocParamLikeTag() {\n while (parseOptional(Token.Whitespace)); // Skip whitespace\n if (parseOptional(Token.Hyphen)) {\n // The doc content started with a hyphen, so skip subsequent whitespace\n // (The if statement already advanced past the hyphen itself.)\n while (parseOptional(Token.Whitespace));\n }\n }\n\n function parseDocSimpleTag(\n pos: number,\n tagName: IdentifierNode,\n kind: SimpleTag[\"kind\"],\n ): SimpleTag {\n const content = parseDocContent();\n return {\n kind,\n tagName,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocIdentifier(\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): IdentifierNode {\n // We don't allow whitespace between @ and tag name, but allow\n // whitespace before all other identifiers.\n if (messageId !== \"tag\") {\n while (parseOptional(Token.Whitespace));\n }\n\n const pos = tokenPos();\n let sv: string;\n\n if (token() === Token.Identifier) {\n sv = tokenValue();\n nextToken();\n } else if (token() === Token.DocCodeSpan) {\n // Support DocCodeSpan as identifier\n sv = tokenValue();\n nextToken();\n } else {\n sv = \"\";\n warning({ code: \"doc-invalid-identifier\", messageId });\n }\n\n return {\n kind: SyntaxKind.Identifier,\n sv,\n ...finishNode(pos),\n };\n }\n\n // utility functions\n function token() {\n return scanner.token;\n }\n\n function tokenFlags() {\n return scanner.tokenFlags;\n }\n\n function tokenValue() {\n return scanner.getTokenValue();\n }\n\n function tokenPos() {\n return scanner.tokenPosition;\n }\n\n function tokenEnd() {\n return scanner.position;\n }\n\n function nextToken() {\n // keep track of the previous token end separately from the current scanner\n // position as these will differ when the previous token had trailing\n // trivia, and we don't want to squiggle the trivia.\n previousTokenEnd = scanner.position;\n return currentMode === ParseMode.Syntax ? nextSyntaxToken() : nextDocToken();\n }\n\n function nextSyntaxToken() {\n docRanges = [];\n\n for (;;) {\n scanner.scan();\n if (isTrivia(token())) {\n if (!newLineIsTrivia && token() === Token.NewLine) {\n break;\n }\n let comment: LineComment | BlockComment | undefined = undefined;\n if (options.comments && isComment(token())) {\n comment = {\n kind:\n token() === Token.SingleLineComment\n ? SyntaxKind.LineComment\n : SyntaxKind.BlockComment,\n pos: tokenPos(),\n end: tokenEnd(),\n };\n comments.push(comment!);\n }\n if (tokenFlags() & TokenFlags.DocComment) {\n docRanges.push({\n pos: tokenPos(),\n end: tokenEnd(),\n comment: comment as BlockComment,\n });\n }\n } else {\n break;\n }\n }\n }\n\n function nextDocToken() {\n // NOTE: trivia tokens are always significant in doc comments.\n scanner.scanDoc();\n }\n\n function nextStringTemplateToken(tokenFlags: TokenFlags) {\n scanner.reScanStringTemplate(tokenFlags);\n }\n\n function createMissingIdentifier(): IdentifierNode {\n const pos = tokenPos();\n previousTokenEnd = pos;\n missingIdentifierCounter++;\n\n return {\n kind: SyntaxKind.Identifier,\n sv: \"<missing identifier>\" + missingIdentifierCounter,\n ...finishNode(pos),\n };\n }\n\n function createMissingTypeReference(): TypeReferenceNode {\n const pos = tokenPos();\n const { items: args } = createEmptyList<TemplateArgumentNode>();\n\n return {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n function finishNode(pos: number): TextRange & { flags: NodeFlags; symbol: Sym } {\n const flags = parseErrorInNextFinishedNode ? NodeFlags.ThisNodeHasError : NodeFlags.None;\n parseErrorInNextFinishedNode = false;\n return withSymbol({ pos, end: previousTokenEnd, flags });\n }\n\n // pretend to add as symbol property, likely to a node that is being created.\n function withSymbol<T extends { symbol: Sym }>(obj: Omit<T, \"symbol\">): T {\n return obj as any;\n }\n\n function createEmptyList<T extends Node>(range: TextRange = { pos: -1, end: -1 }): ListDetail<T> {\n return {\n items: [],\n range,\n };\n }\n\n /**\n * Parse a delimited list of elements, including the surrounding open and\n * close punctuation\n *\n * This shared driver function is used to share sensitive error recovery code.\n * In particular, error recovery by inserting tokens deemed missing is\n * susceptible to getting stalled in a loop iteration without making any\n * progress, and we guard against this in a shared place here.\n *\n * Note that statement and decorator lists do not have this issue. We always\n * consume at least a real '@' for a decorator and if the leading token of a\n * statement is not one of our statement keywords, ';', or '@', it is consumed\n * as part of a bad statement. As such, parsing of decorators and statements\n * do not go through here.\n */\n function parseList<K extends ListKind, T extends Node>(\n kind: K,\n parseItem: ParseListItem<K, T>,\n ): ListDetail<T> {\n const r: ListDetail<T> = createEmptyList<T>();\n if (kind.open !== Token.None) {\n const t = tokenPos();\n if (parseExpected(kind.open)) {\n mutate(r.range).pos = t;\n }\n }\n\n if (kind.allowEmpty && parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n return r;\n }\n\n while (true) {\n const startingPos = tokenPos();\n const { pos, docs, directives, decorators } = parseAnnotations({\n skipParsingDocNodes: Boolean(kind.invalidAnnotationTarget),\n });\n if (kind.invalidAnnotationTarget) {\n reportInvalidDecorators(decorators, kind.invalidAnnotationTarget);\n reportInvalidDirective(directives, kind.invalidAnnotationTarget);\n }\n\n if (directives.length === 0 && decorators.length === 0 && atEndOfListWithError(kind)) {\n // Error recovery: end surrounded list at statement keyword or end\n // of file. Note, however, that we must parse a missing element if\n // there were directives or decorators as we cannot drop those from\n // the tree.\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n break;\n }\n\n let item: T;\n if (kind.invalidAnnotationTarget) {\n item = (parseItem as ParseListItem<UnannotatedListKind, T>)();\n } else {\n item = parseItem(pos, decorators);\n mutate(item).docs = docs;\n mutate(item).directives = directives;\n }\n\n r.items.push(item);\n\n if (parseOptionalDelimiter(kind)) {\n // Delimiter found: check if it's trailing.\n if (parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n // It was trailing and we've consumed the close token.\n break;\n }\n // Not trailing. We can safely skip the progress check below here\n // because we know that we consumed a real delimiter.\n continue;\n } else if (kind.close === Token.None) {\n // If a list is *not* surrounded by punctuation, then the list ends when\n // there's no delimiter after an item.\n break;\n } else if (parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n // If a list *is* surrounded by punctuation, then the list ends when we\n // reach the close token.\n break;\n } else if (atEndOfListWithError(kind)) {\n // Error recovery: If a list *is* surrounded by punctuation, then\n // the list ends at statement keyword or end-of-file under the\n // assumption that the closing delimiter is missing. This check is\n // duplicated from above to preempt the parseExpected(delimeter)\n // below.\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n break;\n } else {\n // Error recovery: if a list kind *is* surrounded by punctuation and we\n // find neither a delimiter nor a close token after an item, then we\n // assume there is a missing delimiter between items.\n //\n // Example: `model M { a: B <missing semicolon> c: D }\n parseExpected(kind.delimiter);\n }\n\n if (startingPos === tokenPos()) {\n // Error recovery: we've inserted everything during this loop iteration\n // and haven't made any progress. Assume that the current token is a bad\n // representation of the end of the the list that we're trying to get\n // through.\n //\n // Simple repro: `model M { ]` would loop forever without this check.\n //\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n nextToken();\n\n // remove the item that was entirely inserted by error recovery.\n r.items.pop();\n break;\n }\n }\n return r;\n }\n\n /**\n * Parse a delimited list with surrounding open and close punctuation if the\n * open token is present. Otherwise, return an empty list.\n */\n function parseOptionalList<K extends SurroundedListKind, T extends Node>(\n kind: K,\n parseItem: ParseListItem<K, T>,\n ): ListDetail<T> {\n return token() === kind.open ? parseList(kind, parseItem) : createEmptyList<T>();\n }\n\n function parseOptionalDelimiter(kind: ListKind) {\n if (parseOptional(kind.delimiter)) {\n return true;\n }\n\n if (token() === kind.toleratedDelimiter) {\n if (!kind.toleratedDelimiterIsValid) {\n parseExpected(kind.delimiter);\n }\n nextToken();\n return true;\n }\n\n return false;\n }\n\n function atEndOfListWithError(kind: ListKind) {\n return (\n kind.close !== Token.None &&\n (isStatementKeyword(token()) || token() === Token.EndOfFile) &&\n token() !== kind.allowedStatementKeyword\n );\n }\n\n function parseEmptyStatement(pos: number): EmptyStatementNode {\n parseExpected(Token.Semicolon);\n return { kind: SyntaxKind.EmptyStatement, ...finishNode(pos) };\n }\n\n function parseInvalidStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): InvalidStatementNode {\n // Error recovery: avoid an avalanche of errors when we get cornered into\n // parsing statements where none exist. Skip until we find a statement\n // keyword or decorator and only report one error for a contiguous range of\n // neither.\n do {\n nextToken();\n } while (\n !isStatementKeyword(token()) &&\n token() !== Token.At &&\n token() !== Token.Semicolon &&\n token() !== Token.EndOfFile\n );\n\n error({\n code: \"token-expected\",\n messageId: \"statement\",\n target: { pos, end: previousTokenEnd },\n });\n return { kind: SyntaxKind.InvalidStatement, decorators, ...finishNode(pos) };\n }\n\n function error<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: DiagnosticReportWithoutTarget<CompilerDiagnostics, C, M> & {\n target?: Partial<TextRange> & { realPos?: number };\n printable?: boolean;\n },\n ) {\n parseErrorInNextFinishedNode = true;\n\n const location = {\n file: scanner.file,\n pos: report.target?.pos ?? tokenPos(),\n end: report.target?.end ?? tokenEnd(),\n };\n\n if (!report.printable) {\n treePrintable = false;\n }\n\n // Error recovery: don't report more than 1 consecutive error at the same\n // position. The code path taken by error recovery after logging an error\n // can otherwise produce redundant and less decipherable errors, which this\n // suppresses.\n const realPos = report.target?.realPos ?? location.pos;\n if (realPositionOfLastError === realPos) {\n return;\n }\n realPositionOfLastError = realPos;\n\n const diagnostic = createDiagnostic({\n ...report,\n target: location,\n } as any);\n\n assert(\n diagnostic.severity === \"error\",\n \"This function is for reporting errors. Use warning() for warnings.\",\n );\n\n parseDiagnostics.push(diagnostic);\n }\n\n function warning<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: DiagnosticReportWithoutTarget<CompilerDiagnostics, C, M> & {\n target?: Partial<TextRange>;\n },\n ) {\n const location = {\n file: scanner.file,\n pos: report.target?.pos ?? tokenPos(),\n end: report.target?.end ?? tokenEnd(),\n };\n\n const diagnostic = createDiagnostic({\n ...report,\n target: location,\n } as any);\n\n assert(\n diagnostic.severity === \"warning\",\n \"This function is for reporting warnings only. Use error() for errors.\",\n );\n\n parseDiagnostics.push(diagnostic);\n }\n\n function reportDiagnostic(diagnostic: Diagnostic) {\n if (diagnostic.severity === \"error\") {\n parseErrorInNextFinishedNode = true;\n treePrintable = false;\n }\n\n parseDiagnostics.push(diagnostic);\n }\n\n function assert(condition: boolean, message: string): asserts condition {\n const location = {\n file: scanner.file,\n pos: tokenPos(),\n end: tokenEnd(),\n };\n compilerAssert(condition, message, location);\n }\n\n function reportInvalidDecorators(decorators: DecoratorExpressionNode[], nodeName: string) {\n for (const decorator of decorators) {\n error({ code: \"invalid-decorator-location\", format: { nodeName }, target: decorator });\n }\n }\n function reportInvalidDirective(directives: DirectiveExpressionNode[], nodeName: string) {\n for (const directive of directives) {\n error({ code: \"invalid-directive-location\", format: { nodeName }, target: directive });\n }\n }\n\n function parseExpected(expectedToken: Token) {\n if (token() === expectedToken) {\n nextToken();\n return true;\n }\n\n const location = getAdjustedDefaultLocation(expectedToken);\n error({\n code: \"token-expected\",\n format: { token: TokenDisplay[expectedToken] },\n target: location,\n printable: isPunctuation(expectedToken),\n });\n return false;\n }\n\n function expectTokenIsOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const tok = token();\n for (const expected of args) {\n if (expected === Token.None) {\n continue;\n }\n if (tok === expected) {\n return tok;\n }\n }\n errorTokenIsNotOneOf(...args);\n return Token.None;\n }\n\n function parseExpectedOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const tok = expectTokenIsOneOf(...args);\n if (tok !== Token.None) {\n nextToken();\n }\n return tok;\n }\n\n function errorTokenIsNotOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const location = getAdjustedDefaultLocation(args[0]);\n const displayList = args.map((t, i) => {\n if (i === args.length - 1) {\n return `or ${TokenDisplay[t]}`;\n }\n return TokenDisplay[t];\n });\n error({ code: \"token-expected\", format: { token: displayList.join(\", \") }, target: location });\n }\n\n function parseOptional(optionalToken: Token) {\n if (token() === optionalToken) {\n nextToken();\n return true;\n }\n\n return false;\n }\n\n function getAdjustedDefaultLocation(token: Token) {\n // Put the squiggly immediately after prior token when missing punctuation.\n // Avoids saying ';' is expected far away after a long comment, for example.\n // It's also confusing to squiggle the current token even if its nearby\n // in this case.\n return isPunctuation(token)\n ? { pos: previousTokenEnd, end: previousTokenEnd + 1, realPos: tokenPos() }\n : undefined;\n }\n}\n\nexport type NodeCallback<T> = (c: Node) => T;\n\nexport function exprIsBareIdentifier(\n expr: Expression,\n): expr is TypeReferenceNode & { target: IdentifierNode; arguments: [] } {\n return (\n expr.kind === SyntaxKind.TypeReference &&\n expr.target.kind === SyntaxKind.Identifier &&\n expr.arguments.length === 0\n );\n}\n\nexport function visitChildren<T>(node: Node, cb: NodeCallback<T>): T | undefined {\n if (node.directives) {\n const result = visitEach(cb, node.directives);\n if (result) return result;\n }\n if (node.docs) {\n const result = visitEach(cb, node.docs);\n if (result) return result;\n }\n\n switch (node.kind) {\n case SyntaxKind.TypeSpecScript:\n return visitNode(cb, node.id) || visitEach(cb, node.statements);\n case SyntaxKind.ArrayExpression:\n return visitNode(cb, node.elementType);\n case SyntaxKind.AugmentDecoratorStatement:\n return (\n visitNode(cb, node.target) ||\n visitNode(cb, node.targetType) ||\n visitEach(cb, node.arguments)\n );\n case SyntaxKind.DecoratorExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.CallExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.DirectiveExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.ImportStatement:\n return visitNode(cb, node.path);\n case SyntaxKind.OperationStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.signature)\n );\n case SyntaxKind.OperationSignatureDeclaration:\n return visitNode(cb, node.parameters) || visitNode(cb, node.returnType);\n case SyntaxKind.OperationSignatureReference:\n return visitNode(cb, node.baseOperation);\n case SyntaxKind.NamespaceStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n (isArray(node.statements) ? visitEach(cb, node.statements) : visitNode(cb, node.statements))\n );\n case SyntaxKind.InterfaceStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.extends) ||\n visitEach(cb, node.operations)\n );\n case SyntaxKind.UsingStatement:\n return visitNode(cb, node.name);\n case SyntaxKind.IntersectionExpression:\n return visitEach(cb, node.options);\n case SyntaxKind.MemberExpression:\n return visitNode(cb, node.base) || visitNode(cb, node.id);\n case SyntaxKind.ModelExpression:\n return visitEach(cb, node.properties);\n case SyntaxKind.ModelProperty:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitNode(cb, node.value) ||\n visitNode(cb, node.default)\n );\n case SyntaxKind.ModelSpreadProperty:\n return visitNode(cb, node.target);\n\n case SyntaxKind.ModelStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.extends) ||\n visitNode(cb, node.is) ||\n visitEach(cb, node.properties)\n );\n case SyntaxKind.ScalarStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.members) ||\n visitNode(cb, node.extends)\n );\n case SyntaxKind.ScalarConstructor:\n return visitNode(cb, node.id) || visitEach(cb, node.parameters);\n case SyntaxKind.UnionStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.options)\n );\n case SyntaxKind.UnionVariant:\n return visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.EnumStatement:\n return (\n visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitEach(cb, node.members)\n );\n case SyntaxKind.EnumMember:\n return visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.EnumSpreadMember:\n return visitNode(cb, node.target);\n case SyntaxKind.AliasStatement:\n return (\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.value)\n );\n case SyntaxKind.ConstStatement:\n return visitNode(cb, node.id) || visitNode(cb, node.value) || visitNode(cb, node.type);\n case SyntaxKind.DecoratorDeclarationStatement:\n return (\n visitEach(cb, node.modifiers) ||\n visitNode(cb, node.id) ||\n visitNode(cb, node.target) ||\n visitEach(cb, node.parameters)\n );\n case SyntaxKind.FunctionDeclarationStatement:\n return (\n visitEach(cb, node.modifiers) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.parameters) ||\n visitNode(cb, node.returnType)\n );\n case SyntaxKind.FunctionParameter:\n return visitNode(cb, node.id) || visitNode(cb, node.type);\n case SyntaxKind.TypeReference:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.ValueOfExpression:\n return visitNode(cb, node.target);\n case SyntaxKind.TypeOfExpression:\n return visitNode(cb, node.target);\n case SyntaxKind.TupleExpression:\n return visitEach(cb, node.values);\n case SyntaxKind.UnionExpression:\n return visitEach(cb, node.options);\n\n case SyntaxKind.InvalidStatement:\n return visitEach(cb, node.decorators);\n case SyntaxKind.TemplateParameterDeclaration:\n return (\n visitNode(cb, node.id) || visitNode(cb, node.constraint) || visitNode(cb, node.default)\n );\n case SyntaxKind.TemplateArgument:\n return (node.name && visitNode(cb, node.name)) || visitNode(cb, node.argument);\n case SyntaxKind.Doc:\n return visitEach(cb, node.content) || visitEach(cb, node.tags);\n case SyntaxKind.DocParamTag:\n case SyntaxKind.DocTemplateTag:\n return (\n visitNode(cb, node.tagName) || visitNode(cb, node.paramName) || visitEach(cb, node.content)\n );\n case SyntaxKind.DocPropTag:\n return (\n visitNode(cb, node.tagName) || visitNode(cb, node.propName) || visitEach(cb, node.content)\n );\n case SyntaxKind.DocReturnsTag:\n case SyntaxKind.DocErrorsTag:\n case SyntaxKind.DocUnknownTag:\n return visitNode(cb, node.tagName) || visitEach(cb, node.content);\n\n case SyntaxKind.StringTemplateExpression:\n return visitNode(cb, node.head) || visitEach(cb, node.spans);\n case SyntaxKind.StringTemplateSpan:\n return visitNode(cb, node.expression) || visitNode(cb, node.literal);\n case SyntaxKind.ObjectLiteral:\n return visitEach(cb, node.properties);\n case SyntaxKind.ObjectLiteralProperty:\n return visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.ObjectLiteralSpreadProperty:\n return visitNode(cb, node.target);\n case SyntaxKind.ArrayLiteral:\n return visitEach(cb, node.values);\n // no children for the rest of these.\n case SyntaxKind.StringTemplateHead:\n case SyntaxKind.StringTemplateMiddle:\n case SyntaxKind.StringTemplateTail:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.BooleanLiteral:\n case SyntaxKind.Identifier:\n case SyntaxKind.EmptyStatement:\n case SyntaxKind.VoidKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.ExternKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.JsSourceFile:\n case SyntaxKind.JsNamespaceDeclaration:\n case SyntaxKind.DocText:\n return;\n\n default:\n // Dummy const to ensure we handle all node types.\n // If you get an error here, add a case for the new node type\n // you added..\n const _assertNever: never = node;\n return;\n }\n}\n\nfunction visitNode<T>(cb: NodeCallback<T>, node: Node | undefined): T | undefined {\n return node && cb(node);\n}\n\nfunction visitEach<T>(cb: NodeCallback<T>, nodes: readonly Node[] | undefined): T | undefined {\n if (!nodes) {\n return;\n }\n\n for (const node of nodes) {\n const result = cb(node);\n if (result) {\n return result;\n }\n }\n return;\n}\n\n/**\n * check whether a position belongs to a range (excluding the start and end pos)\n * i.e. <range.pos>{<start to return true>...<end to return true>}<range.end>\n *\n * remark: if range.pos is -1 means no start point found, so return false\n * if range.end is -1 means no end point found, so return true if position is greater than range.pos\n */\nexport function positionInRange(position: number, range: TextRange) {\n return range.pos >= 0 && position > range.pos && (range.end === -1 || position < range.end);\n}\n\nexport function getNodeAtPositionDetail(\n script: TypeSpecScriptNode,\n position: number,\n filter: (node: Node, flag: \"cur\" | \"pre\" | \"post\") => boolean = () => true,\n): PositionDetail {\n const cur = getNodeAtPosition(script, position, (n) => filter(n, \"cur\"));\n\n const input = script.file.text;\n const char = input.charCodeAt(position);\n const preChar = position >= 0 ? input.charCodeAt(position - 1) : NaN;\n const nextChar = position < input.length ? input.charCodeAt(position + 1) : NaN;\n\n let inTrivia = false;\n let triviaStart: number | undefined;\n let triviaEnd: number | undefined;\n if (!cur || cur.kind !== SyntaxKind.StringLiteral) {\n const { char: cp } = codePointBefore(input, position);\n if (!cp || !isIdentifierContinue(cp)) {\n triviaEnd = skipTrivia(input, position);\n triviaStart = skipTriviaBackward(script, position) + 1;\n inTrivia = triviaEnd !== position;\n }\n }\n\n if (!inTrivia) {\n const beforeId = skipContinuousIdentifier(input, position, true /*isBackward*/);\n triviaStart = skipTriviaBackward(script, beforeId) + 1;\n const afterId = skipContinuousIdentifier(input, position, false /*isBackward*/);\n triviaEnd = skipTrivia(input, afterId);\n }\n\n if (triviaStart === undefined || triviaEnd === undefined) {\n compilerAssert(false, \"unexpected, triviaStart and triviaEnd should be defined\");\n }\n\n return {\n node: cur,\n char,\n preChar,\n nextChar,\n position,\n inTrivia,\n triviaStartPosition: triviaStart,\n triviaEndPosition: triviaEnd,\n getPositionDetailBeforeTrivia: () => {\n // getNodeAtPosition will also include the 'node.end' position which is the triviaStart pos\n return getNodeAtPositionDetail(script, triviaStart, (n) => filter(n, \"pre\"));\n },\n getPositionDetailAfterTrivia: () => {\n return getNodeAtPositionDetail(script, triviaEnd, (n) => filter(n, \"post\"));\n },\n };\n}\n\n/**\n * Resolve the node in the syntax tree that that is at the given position.\n * @param script TypeSpec Script node\n * @param position Position\n * @param filter Filter if wanting to return a parent containing node early.\n */\nexport function getNodeAtPosition(\n script: TypeSpecScriptNode,\n position: number,\n filter?: (node: Node) => boolean,\n): Node | undefined;\nexport function getNodeAtPosition<T extends Node>(\n script: TypeSpecScriptNode,\n position: number,\n filter: (node: Node) => node is T,\n): T | undefined;\nexport function getNodeAtPosition(\n script: TypeSpecScriptNode,\n position: number,\n filter = (node: Node) => true,\n): Node | undefined {\n return visit(script);\n\n function visit(node: Node): Node | undefined {\n // We deliberately include the end position here because we need to hit\n // nodes when the cursor is positioned immediately after an identifier.\n // This is especially vital for completion. It's also generally OK\n // because the language doesn't (and should never) have syntax where you\n // could place the cursor ambiguously between two adjacent,\n // non-punctuation, non-trivia tokens that have no punctuation or trivia\n // separating them.\n if (node.pos <= position && position <= node.end) {\n // We only need to recursively visit children of nodes that satisfied\n // the condition above and therefore contain the given position. If a\n // node does not contain a position, then neither do its children.\n const child = visitChildren(node, visit);\n\n // A child match here is better than a self-match below as we want the\n // deepest (most specific) node. In other words, the search is depth\n // first. For example, consider `A<B<C>>`: If the cursor is on `B`,\n // then prefer B<C> over A<B<C>>.\n if (child) {\n return child;\n }\n\n if (filter(node)) {\n return node;\n }\n }\n\n return undefined;\n }\n}\n\nexport function hasParseError(node: Node) {\n if (node.flags & NodeFlags.ThisNodeHasError) {\n return true;\n }\n\n checkForDescendantErrors(node);\n return node.flags & NodeFlags.DescendantHasError;\n}\n\nfunction checkForDescendantErrors(node: Node) {\n if (node.flags & NodeFlags.DescendantErrorsExamined) {\n return;\n }\n mutate(node).flags |= NodeFlags.DescendantErrorsExamined;\n\n visitChildren(node, (child: Node) => {\n if (child.flags & NodeFlags.ThisNodeHasError) {\n mutate(node).flags |= NodeFlags.DescendantHasError | NodeFlags.DescendantErrorsExamined;\n return true;\n }\n checkForDescendantErrors(child);\n\n if (child.flags & NodeFlags.DescendantHasError) {\n mutate(node).flags |= NodeFlags.DescendantHasError | NodeFlags.DescendantErrorsExamined;\n return true;\n }\n mutate(child).flags |= NodeFlags.DescendantErrorsExamined;\n\n return false;\n });\n}\n\nexport function isImportStatement(node: Node): node is ImportStatementNode {\n return node.kind === SyntaxKind.ImportStatement;\n}\n\nfunction isBlocklessNamespace(node: Node) {\n if (node.kind !== SyntaxKind.NamespaceStatement) {\n return false;\n }\n while (!isArray(node.statements) && node.statements) {\n node = node.statements;\n }\n\n return node.statements === undefined;\n}\n\nexport function getFirstAncestor(\n node: Node,\n test: NodeCallback<boolean>,\n includeSelf: boolean = false,\n): Node | undefined {\n if (includeSelf && test(node)) {\n return node;\n }\n for (let n = node.parent; n; n = n.parent) {\n if (test(n)) {\n return n;\n }\n }\n return undefined;\n}\n\nexport function getIdentifierContext(id: IdentifierNode): IdentifierContext {\n const node = getFirstAncestor(id, (n) => n.kind !== SyntaxKind.MemberExpression);\n compilerAssert(node, \"Identifier with no non-member-expression ancestor.\");\n\n let kind: IdentifierKind;\n switch (node.kind) {\n case SyntaxKind.TypeReference:\n kind = IdentifierKind.TypeReference;\n break;\n case SyntaxKind.AugmentDecoratorStatement:\n case SyntaxKind.DecoratorExpression:\n kind = IdentifierKind.Decorator;\n break;\n case SyntaxKind.UsingStatement:\n kind = IdentifierKind.Using;\n break;\n case SyntaxKind.TemplateArgument:\n kind = IdentifierKind.TemplateArgument;\n break;\n case SyntaxKind.ObjectLiteralProperty:\n kind = IdentifierKind.ObjectLiteralProperty;\n break;\n case SyntaxKind.ModelProperty:\n switch (node.parent?.kind) {\n case SyntaxKind.ModelExpression:\n kind = IdentifierKind.ModelExpressionProperty;\n break;\n case SyntaxKind.ModelStatement:\n kind = IdentifierKind.ModelStatementProperty;\n break;\n default:\n compilerAssert(\"false\", \"ModelProperty with unexpected parent kind.\");\n kind =\n (id.parent as DeclarationNode).id === id\n ? IdentifierKind.Declaration\n : IdentifierKind.Other;\n break;\n }\n break;\n default:\n kind =\n (id.parent as DeclarationNode).id === id\n ? IdentifierKind.Declaration\n : IdentifierKind.Other;\n break;\n }\n\n return { node, kind };\n}\n", "import type { ParserOptions } from \"prettier\";\nimport { getSourceLocation } from \"../core/diagnostics.js\";\nimport { parse as typespecParse, visitChildren } from \"../core/parser.js\";\nimport { Diagnostic, Node, SyntaxKind, TypeSpecScriptNode } from \"../core/types.js\";\nimport { mutate } from \"../utils/misc.js\";\n\nexport function parse(text: string, options: ParserOptions<any>): TypeSpecScriptNode {\n const result = typespecParse(text, { comments: true, docs: true });\n\n flattenNamespaces(result);\n\n const errors = result.parseDiagnostics.filter((x) => x.severity === \"error\");\n if (errors.length > 0 && !result.printable) {\n throw new PrettierParserError(errors[0]);\n }\n // Remove doc comments as those are handled directly.\n mutate(result).comments = result.comments.filter(\n (x) => !(x.kind === SyntaxKind.BlockComment && x.parsedAsDocs),\n );\n return result;\n}\n\n/**\n * We are patching the syntax tree to flatten the namespace nodes that are created from namespace Foo.Bar; which have the same pos, end\n * This causes prettier to not know where comments belong.\n * https://github.com/microsoft/typespec/pull/2061\n */\nexport function flattenNamespaces(base: Node) {\n visitChildren(base, (node) => {\n if (node.kind === SyntaxKind.NamespaceStatement) {\n let current = node;\n const ids = [node.id];\n while (current.statements && \"kind\" in current.statements) {\n current = current.statements;\n ids.push(current.id);\n }\n Object.assign(node, current, {\n ids,\n });\n flattenNamespaces(current);\n }\n });\n}\n\nexport class PrettierParserError extends Error {\n public loc: { start: number; end: number };\n public constructor(public readonly error: Diagnostic) {\n super(error.message);\n const location = getSourceLocation(error.target);\n this.loc = {\n start: location?.pos ?? 0,\n end: location?.end ?? 0,\n };\n }\n}\n", "import type { AstPath, Doc, Printer } from \"prettier\";\nimport { builders } from \"prettier/doc\";\nimport { compilerAssert } from \"../../core/diagnostics.js\";\nimport {\n printIdentifier as printIdentifierString,\n splitLines,\n} from \"../../core/helpers/syntax-utils.js\";\nimport {\n AliasStatementNode,\n ArrayExpressionNode,\n ArrayLiteralNode,\n AugmentDecoratorStatementNode,\n BlockComment,\n BooleanLiteralNode,\n CallExpressionNode,\n Comment,\n ConstStatementNode,\n DecoratorDeclarationStatementNode,\n DecoratorExpressionNode,\n DirectiveExpressionNode,\n DocNode,\n EnumMemberNode,\n EnumSpreadMemberNode,\n EnumStatementNode,\n FunctionDeclarationStatementNode,\n FunctionParameterNode,\n IdentifierNode,\n InterfaceStatementNode,\n IntersectionExpressionNode,\n LineComment,\n MemberExpressionNode,\n ModelExpressionNode,\n ModelPropertyNode,\n ModelSpreadPropertyNode,\n ModelStatementNode,\n Node,\n NodeFlags,\n NumericLiteralNode,\n ObjectLiteralNode,\n ObjectLiteralPropertyNode,\n ObjectLiteralSpreadPropertyNode,\n OperationSignatureDeclarationNode,\n OperationSignatureReferenceNode,\n OperationStatementNode,\n ScalarConstructorNode,\n ScalarStatementNode,\n Statement,\n StringLiteralNode,\n StringTemplateExpressionNode,\n StringTemplateSpanNode,\n SyntaxKind,\n TemplateArgumentNode,\n TemplateParameterDeclarationNode,\n TextRange,\n TupleExpressionNode,\n TypeOfExpressionNode,\n TypeReferenceNode,\n TypeSpecScriptNode,\n UnionExpressionNode,\n UnionStatementNode,\n UnionVariantNode,\n UsingStatementNode,\n ValueOfExpressionNode,\n} from \"../../core/types.js\";\nimport { FlattenedNamespaceStatementNode } from \"../types.js\";\nimport { commentHandler } from \"./comment-handler.js\";\nimport { needsParens } from \"./needs-parens.js\";\nimport { DecorableNode, PrettierChildPrint, TypeSpecPrettierOptions } from \"./types.js\";\nimport { util } from \"./util.js\";\n\nconst {\n align,\n breakParent,\n group,\n hardline,\n ifBreak,\n indent,\n join,\n line,\n softline,\n literalline,\n markAsRoot,\n} = builders;\n\nconst { isNextLineEmpty } = util as any;\n\n/**\n * If the decorators for that node should try to be kept inline.\n */\nconst DecoratorsTryInline = {\n modelProperty: true,\n enumMember: true,\n unionVariant: true,\n};\n\nexport const typespecPrinter: Printer<Node> = {\n print: printTypeSpec,\n isBlockComment: (node: any) => isBlockComment(node),\n canAttachComment: canAttachComment,\n printComment: printComment,\n handleComments: commentHandler,\n};\n\nexport function printTypeSpec(\n // Path to the AST node to print\n path: AstPath<Node>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const docs = printDocComments(path, options, print);\n const directives = shouldPrintDirective(node) ? printDirectives(path, options, print) : \"\";\n const printedNode = printNode(path, options, print);\n const value = needsParens(path, options) ? [\"(\", printedNode, \")\"] : printedNode;\n const parts: Doc[] = [docs, directives, value];\n if (node.kind === SyntaxKind.TypeSpecScript) {\n // For TypeSpecScript(root of TypeSpec document) we had a new line at the end.\n // This must be done here so the hardline entry can be the last item of the doc array returned by the printer\n // so the markdown(and other embedded formatter) can omit that extra line.\n parts.push(hardline);\n }\n return parts;\n}\n\nfunction shouldPrintDirective(node: Node) {\n // Model property handle printing directive itself.\n return node.kind !== SyntaxKind.ModelProperty;\n}\n\nexport function printNode(\n // Path to the AST node to print\n path: AstPath<Node>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node: Node = path.node;\n\n switch (node.kind) {\n // Root\n case SyntaxKind.TypeSpecScript:\n return printTypeSpecScript(path as AstPath<TypeSpecScriptNode>, options, print);\n // Statements\n case SyntaxKind.ImportStatement:\n return [`import \"${node.path.value}\";`];\n case SyntaxKind.UsingStatement:\n return [`using `, (path as AstPath<UsingStatementNode>).call(print, \"name\"), `;`];\n case SyntaxKind.OperationStatement:\n return printOperationStatement(path as AstPath<OperationStatementNode>, options, print);\n case SyntaxKind.OperationSignatureDeclaration:\n return printOperationSignatureDeclaration(\n path as AstPath<OperationSignatureDeclarationNode>,\n options,\n print,\n );\n case SyntaxKind.OperationSignatureReference:\n return printOperationSignatureReference(\n path as AstPath<OperationSignatureReferenceNode>,\n options,\n print,\n );\n case SyntaxKind.NamespaceStatement:\n return printNamespaceStatement(\n path as AstPath<FlattenedNamespaceStatementNode>,\n options,\n print,\n );\n case SyntaxKind.ModelStatement:\n return printModelStatement(path as AstPath<ModelStatementNode>, options, print);\n case SyntaxKind.ScalarStatement:\n return printScalarStatement(path as AstPath<ScalarStatementNode>, options, print);\n case SyntaxKind.ScalarConstructor:\n return printScalarConstructor(path as AstPath<ScalarConstructorNode>, options, print);\n case SyntaxKind.AliasStatement:\n return printAliasStatement(path as AstPath<AliasStatementNode>, options, print);\n case SyntaxKind.EnumStatement:\n return printEnumStatement(path as AstPath<EnumStatementNode>, options, print);\n case SyntaxKind.UnionStatement:\n return printUnionStatement(path as AstPath<UnionStatementNode>, options, print);\n case SyntaxKind.InterfaceStatement:\n return printInterfaceStatement(path as AstPath<InterfaceStatementNode>, options, print);\n // Others.\n case SyntaxKind.Identifier:\n return printIdentifier(node);\n case SyntaxKind.StringLiteral:\n return printStringLiteral(path as AstPath<StringLiteralNode>, options);\n case SyntaxKind.NumericLiteral:\n return printNumberLiteral(path as AstPath<NumericLiteralNode>, options);\n case SyntaxKind.BooleanLiteral:\n return printBooleanLiteral(path as AstPath<BooleanLiteralNode>, options);\n case SyntaxKind.ModelExpression:\n return printModelExpression(path as AstPath<ModelExpressionNode>, options, print);\n case SyntaxKind.ModelProperty:\n return printModelProperty(path as AstPath<ModelPropertyNode>, options, print);\n case SyntaxKind.DecoratorExpression:\n return printDecorator(path as AstPath<DecoratorExpressionNode>, options, print);\n case SyntaxKind.AugmentDecoratorStatement:\n return printAugmentDecorator(path as AstPath<AugmentDecoratorStatementNode>, options, print);\n case SyntaxKind.DirectiveExpression:\n return printDirective(path as AstPath<DirectiveExpressionNode>, options, print);\n case SyntaxKind.UnionExpression:\n return printUnion(path as AstPath<UnionExpressionNode>, options, print);\n case SyntaxKind.IntersectionExpression:\n return printIntersection(path as AstPath<IntersectionExpressionNode>, options, print);\n case SyntaxKind.ArrayExpression:\n return printArray(path as AstPath<ArrayExpressionNode>, options, print);\n case SyntaxKind.TupleExpression:\n return printTuple(path as AstPath<TupleExpressionNode>, options, print);\n case SyntaxKind.MemberExpression:\n return printMemberExpression(path as AstPath<MemberExpressionNode>, options, print);\n case SyntaxKind.EnumMember:\n return printEnumMember(path as AstPath<EnumMemberNode>, options, print);\n case SyntaxKind.EnumSpreadMember:\n return printEnumSpreadMember(path as AstPath<EnumSpreadMemberNode>, options, print);\n case SyntaxKind.UnionVariant:\n return printUnionVariant(path as AstPath<UnionVariantNode>, options, print);\n case SyntaxKind.TypeReference:\n return printTypeReference(path as AstPath<TypeReferenceNode>, options, print);\n case SyntaxKind.TemplateArgument:\n return printTemplateArgument(path as AstPath<TemplateArgumentNode>, options, print);\n case SyntaxKind.ValueOfExpression:\n return printValueOfExpression(path as AstPath<ValueOfExpressionNode>, options, print);\n case SyntaxKind.TypeOfExpression:\n return printTypeOfExpression(path as AstPath<TypeOfExpressionNode>, options, print);\n case SyntaxKind.TemplateParameterDeclaration:\n return printTemplateParameterDeclaration(\n path as AstPath<TemplateParameterDeclarationNode>,\n options,\n print,\n );\n case SyntaxKind.ModelSpreadProperty:\n return printModelSpread(path as AstPath<ModelSpreadPropertyNode>, options, print);\n case SyntaxKind.DecoratorDeclarationStatement:\n return printDecoratorDeclarationStatement(\n path as AstPath<DecoratorDeclarationStatementNode>,\n options,\n print,\n );\n case SyntaxKind.FunctionDeclarationStatement:\n return printFunctionDeclarationStatement(\n path as AstPath<FunctionDeclarationStatementNode>,\n options,\n print,\n );\n case SyntaxKind.FunctionParameter:\n return printFunctionParameterDeclaration(\n path as AstPath<FunctionParameterNode>,\n options,\n print,\n );\n case SyntaxKind.ExternKeyword:\n return \"extern\";\n case SyntaxKind.VoidKeyword:\n return \"void\";\n case SyntaxKind.NeverKeyword:\n return \"never\";\n case SyntaxKind.UnknownKeyword:\n return \"unknown\";\n case SyntaxKind.Doc:\n return printDoc(path as AstPath<DocNode>, options, print);\n case SyntaxKind.DocText:\n case SyntaxKind.DocParamTag:\n case SyntaxKind.DocPropTag:\n case SyntaxKind.DocTemplateTag:\n case SyntaxKind.DocReturnsTag:\n case SyntaxKind.DocErrorsTag:\n case SyntaxKind.DocUnknownTag:\n // https://github.com/microsoft/typespec/issues/1319 Tracks pretty-printing doc comments.\n compilerAssert(\n false,\n \"Currently, doc comments are only handled as regular comments and we do not opt in to parsing them so we shouldn't reach here.\",\n );\n return \"\";\n case SyntaxKind.EmptyStatement:\n return \"\";\n case SyntaxKind.StringTemplateExpression:\n return printStringTemplateExpression(\n path as AstPath<StringTemplateExpressionNode>,\n options,\n print,\n );\n case SyntaxKind.ObjectLiteral:\n return printObjectLiteral(path as AstPath<ObjectLiteralNode>, options, print);\n case SyntaxKind.ObjectLiteralProperty:\n return printObjectLiteralProperty(path as AstPath<ObjectLiteralPropertyNode>, options, print);\n case SyntaxKind.ObjectLiteralSpreadProperty:\n return printObjectLiteralSpreadProperty(\n path as AstPath<ObjectLiteralSpreadPropertyNode>,\n options,\n print,\n );\n case SyntaxKind.ArrayLiteral:\n return printArrayLiteral(path as AstPath<ArrayLiteralNode>, options, print);\n case SyntaxKind.ConstStatement:\n return printConstStatement(path as AstPath<ConstStatementNode>, options, print);\n case SyntaxKind.CallExpression:\n return printCallExpression(path as AstPath<CallExpressionNode>, options, print);\n case SyntaxKind.StringTemplateSpan:\n case SyntaxKind.StringTemplateHead:\n case SyntaxKind.StringTemplateMiddle:\n case SyntaxKind.StringTemplateTail:\n case SyntaxKind.JsSourceFile:\n case SyntaxKind.JsNamespaceDeclaration:\n case SyntaxKind.InvalidStatement:\n return getRawText(node, options);\n default:\n // Dummy const to ensure we handle all node types.\n // If you get an error here, add a case for the new node type\n // you added..\n const _assertNever: never = node;\n return getRawText(node, options);\n }\n}\n\nexport function printTypeSpecScript(\n path: AstPath<TypeSpecScriptNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const body = [];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n body.push(printStatementSequence(path, options, print, \"statements\"));\n return body;\n}\n\nexport function printAliasStatement(\n path: AstPath<AliasStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const template = printTemplateParameters(path, options, print, \"templateParameters\");\n return [\"alias \", id, template, \" = \", path.call(print, \"value\"), \";\"];\n}\n\nexport function printConstStatement(\n path: AstPath<ConstStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const type = node.type ? [\": \", path.call(print, \"type\")] : \"\";\n return [\"const \", id, type, \" = \", path.call(print, \"value\"), \";\"];\n}\n\nexport function printCallExpression(\n path: AstPath<CallExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printCallLikeArgs(path, options, print);\n return [path.call(print, \"target\"), args];\n}\n\nfunction printTemplateParameters<T extends Node>(\n path: AstPath<T>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n propertyName: keyof T,\n) {\n const node = path.node;\n const args = node[propertyName] as any as TemplateParameterDeclarationNode[];\n if ((args as any).length === 0) {\n return \"\";\n }\n\n const shouldHug = (args as any).length === 1;\n if (shouldHug) {\n return [\"<\", join(\", \", path.map(print, propertyName as any)), \">\"];\n } else {\n const body = indent([softline, join([\", \", softline], path.map(print, propertyName as any))]);\n return group([\"<\", body, softline, \">\"]);\n }\n}\n\nexport function canAttachComment(node: Node): boolean {\n const kind = node.kind as SyntaxKind;\n return Boolean(\n kind &&\n kind !== SyntaxKind.LineComment &&\n kind !== SyntaxKind.BlockComment &&\n kind !== SyntaxKind.EmptyStatement &&\n kind !== SyntaxKind.DocParamTag &&\n kind !== SyntaxKind.DocReturnsTag &&\n kind !== SyntaxKind.DocTemplateTag &&\n kind !== SyntaxKind.DocText &&\n kind !== SyntaxKind.DocUnknownTag &&\n !(node.flags & NodeFlags.Synthetic),\n );\n}\n\nexport function printComment(\n commentPath: AstPath<Node | Comment>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const comment = commentPath.node;\n (comment as any).printed = true;\n\n switch (comment.kind) {\n case SyntaxKind.BlockComment:\n return printBlockComment(commentPath as AstPath<BlockComment>, options);\n case SyntaxKind.LineComment:\n return `${getRawText(comment, options).trimEnd()}`;\n default:\n throw new Error(`Not a comment: ${JSON.stringify(comment)}`);\n }\n}\n\nfunction printBlockComment(commentPath: AstPath<BlockComment>, options: TypeSpecPrettierOptions) {\n const comment = commentPath.node;\n const rawComment = options.originalText.slice(comment.pos + 2, comment.end - 2);\n\n const printed = isIndentableBlockComment(rawComment)\n ? printIndentableBlockCommentContent(rawComment)\n : rawComment;\n return [\"/*\", printed, \"*/\"];\n}\n\nfunction isIndentableBlockComment(rawComment: string): boolean {\n // If the comment has multiple lines and every line starts with a star\n // we can fix the indentation of each line. The stars in the `/*` and\n // `*/` delimiters are not included in the comment value, so add them\n // back first.\n const lines = `*${rawComment}*`.split(\"\\n\");\n return lines.length > 1 && lines.every((line) => line.trim()[0] === \"*\");\n}\n\nfunction printIndentableBlockCommentContent(rawComment: string): Doc {\n const lines = rawComment.split(\"\\n\");\n\n return [\n join(\n hardline,\n lines.map((line, index) =>\n index === 0\n ? line.trimEnd()\n : \" \" + (index < lines.length - 1 ? line.trim() : line.trimStart()),\n ),\n ),\n ];\n}\n\n/** Print a doc comment. */\nfunction printDoc(\n path: AstPath<DocNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const rawComment = getRawText(node, options).slice(3, -2);\n\n const printed = isIndentableBlockComment(rawComment)\n ? printIndentableBlockCommentContent(rawComment)\n : rawComment.includes(\"\\n\")\n ? rawComment\n : ` ${rawComment.trim()} `;\n return [\"/**\", printed, \"*/\"];\n}\n\nexport function printDecorators(\n path: AstPath<DecorableNode>,\n options: object,\n print: PrettierChildPrint,\n { tryInline }: { tryInline: boolean },\n): { decorators: Doc; multiline: boolean } {\n const node = path.node;\n if (node.decorators.length === 0) {\n return { decorators: \"\", multiline: false };\n }\n\n const shouldBreak = shouldDecoratorBreakLine(path, options, { tryInline });\n const decorators = path.map((x) => [print(x as any), ifBreak(line, \" \")], \"decorators\");\n\n return {\n decorators: group([shouldBreak ? breakParent : \"\", decorators]),\n multiline: shouldBreak,\n };\n}\n\n/** Check if the decorators of the given node should be broken in sparate line */\nfunction shouldDecoratorBreakLine(\n path: AstPath<DecorableNode>,\n options: object,\n { tryInline }: { tryInline: boolean },\n) {\n const node = path.node;\n\n return (\n !tryInline || node.decorators.length >= 3 || hasNewlineBetweenOrAfterDecorators(node, options)\n );\n}\n\n/**\n * Check if there is already new lines in between the decorators of the node.\n */\nfunction hasNewlineBetweenOrAfterDecorators(node: DecorableNode, options: any) {\n return node.decorators.some((decorator) => util.hasNewline(options.originalText, decorator.end));\n}\n\nexport function printDecorator(\n path: AstPath<DecoratorExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printDecoratorArgs(path, options, print);\n const node = path.node;\n const name =\n node.target.kind === SyntaxKind.Identifier\n ? printIdentifier(node.target, \"allow-reserved\")\n : path.call(print, \"target\");\n return [\"@\", name, args];\n}\n\nexport function printAugmentDecorator(\n path: AstPath<AugmentDecoratorStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const target =\n node.target.kind === SyntaxKind.Identifier\n ? printIdentifier(node.target, \"allow-reserved\")\n : path.call(print, \"target\");\n const args = printAugmentDecoratorArgs(path, options, print);\n return [\"@@\", target, args, \";\"];\n}\n\nfunction printAugmentDecoratorArgs(\n path: AstPath<AugmentDecoratorStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\n \"(\",\n group([\n indent(\n join(\", \", [\n path.call(print, \"targetType\"),\n ...path.map((arg) => [softline, print(arg)], \"arguments\"),\n ]),\n ),\n softline,\n ]),\n \")\",\n ];\n}\n\nexport function printDocComments(path: AstPath<Node>, options: object, print: PrettierChildPrint) {\n const node = path.node;\n if (node.docs === undefined || node.docs.length === 0) {\n return \"\";\n }\n\n const docs = path.map((x) => [print(x as any), line], \"docs\");\n return group([...docs, breakParent]);\n}\n\nexport function printDirectives(path: AstPath<Node>, options: object, print: PrettierChildPrint) {\n const node = path.node;\n if (node.directives === undefined || node.directives.length === 0) {\n return \"\";\n }\n\n const directives = path.map((x) => [print(x as any), line], \"directives\");\n\n return group([...directives, breakParent]);\n}\n\nexport function printDirective(\n path: AstPath<DirectiveExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printDirectiveArgs(path, options, print);\n return [\"#\", path.call(print, \"target\"), \" \", args];\n}\n\nfunction printDecoratorArgs(\n path: AstPath<DecoratorExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.arguments.length === 0) {\n return \"\";\n }\n\n return printCallLikeArgs(path, options, print);\n}\n\nfunction printCallLikeArgs(\n path: AstPath<DecoratorExpressionNode | CallExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n\n // So that decorator with single object arguments have ( and { hugging.\n // @deco(#{\n // value: \"foo\"\n // })\n const shouldHug =\n node.arguments.length === 1 &&\n (node.arguments[0].kind === SyntaxKind.ModelExpression ||\n node.arguments[0].kind === SyntaxKind.ObjectLiteral ||\n node.arguments[0].kind === SyntaxKind.ArrayLiteral ||\n node.arguments[0].kind === SyntaxKind.StringLiteral ||\n node.arguments[0].kind === SyntaxKind.StringTemplateExpression);\n\n if (shouldHug) {\n return [\n \"(\",\n join(\n \", \",\n path.map((arg) => [print(arg)], \"arguments\"),\n ),\n \")\",\n ];\n }\n\n return [\n \"(\",\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"arguments\"),\n ),\n ),\n softline,\n ]),\n \")\",\n ];\n}\n\nexport function printDirectiveArgs(\n path: AstPath<DirectiveExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n\n if (node.arguments.length === 0) {\n return \"\";\n }\n\n return join(\n \" \",\n path.map((arg) => [print(arg)], \"arguments\"),\n );\n}\n\nexport function printEnumStatement(\n path: AstPath<EnumStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const id = path.call(print, \"id\");\n return [decorators, \"enum \", id, \" \", printEnumBlock(path, options, print)];\n}\n\nfunction printEnumBlock(\n path: AstPath<EnumStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.members.length === 0) {\n return \"{}\";\n }\n\n const body = joinMembersInBlock(path, \"members\", options, print, \",\", hardline);\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nexport function printEnumMember(\n path: AstPath<EnumMemberNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n const value = node.value ? [\": \", path.call(print, \"value\")] : \"\";\n const { decorators } = printDecorators(path, options, print, {\n tryInline: DecoratorsTryInline.enumMember,\n });\n return [decorators, id, value];\n}\n\nfunction printEnumSpreadMember(\n path: AstPath<EnumSpreadMemberNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n return [\"...\", path.call(print, \"target\")];\n}\n\nexport function printUnionStatement(\n path: AstPath<UnionStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n return [decorators, \"union \", id, generic, \" \", printUnionVariantsBlock(path, options, print)];\n}\n\nexport function printUnionVariantsBlock(\n path: AstPath<UnionStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.options.length === 0) {\n return \"{}\";\n }\n\n const body = joinMembersInBlock(path, \"options\", options, print, \",\", hardline);\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nexport function printUnionVariant(\n path: AstPath<UnionVariantNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id =\n path.node.id === undefined ? \"\" : [printIdentifier(path.node.id, \"allow-reserved\"), \": \"];\n const { decorators } = printDecorators(path, options, print, {\n tryInline: DecoratorsTryInline.unionVariant,\n });\n return [decorators, id, path.call(print, \"value\")];\n}\n\nexport function printInterfaceStatement(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n const extendList = printInterfaceExtends(path, options, print);\n\n return [\n decorators,\n \"interface \",\n id,\n generic,\n extendList,\n \" \",\n printInterfaceMembers(path, options, print),\n ];\n}\n\nfunction printInterfaceExtends(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n if (node.extends.length === 0) {\n return \"\";\n }\n\n const keyword = \"extends \";\n return [group(indent([line, keyword, indent(join([\",\", line], path.map(print, \"extends\")))]))];\n}\n\nexport function printInterfaceMembers(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasOperations = node.operations.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasOperations && !nodeHasComments) {\n return \"{}\";\n }\n\n const lastOperation = node.operations[node.operations.length - 1];\n\n const parts: Doc[] = [];\n path.each((operationPath) => {\n const node = operationPath.node as any as OperationStatementNode;\n\n const printed = print(operationPath);\n parts.push(printed);\n\n if (node !== lastOperation) {\n parts.push(hardline);\n\n if (isNextLineEmpty(options.originalText, node, options.locEnd)) {\n parts.push(hardline);\n }\n }\n }, \"operations\");\n\n const body: Doc[] = [hardline, parts];\n\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nfunction printDanglingComments(\n path: AstPath<any>,\n options: TypeSpecPrettierOptions,\n { sameIndent }: { sameIndent: boolean },\n) {\n const node = path.node;\n const parts: Doc[] = [];\n if (!node || !node.comments) {\n return \"\";\n }\n path.each((commentPath) => {\n const comment: any = commentPath.node;\n if (!comment.leading && !comment.trailing) {\n parts.push(printComment(path, options));\n }\n }, \"comments\");\n\n if (parts.length === 0) {\n return \"\";\n }\n\n if (sameIndent) {\n return join(hardline, parts);\n }\n return indent([hardline, join(hardline, parts)]);\n}\n\n/**\n * Handle printing an intersection node.\n * @example `Foo & Bar` or `{foo: string} & {bar: string}`\n *\n * @param path Prettier AST Path.\n * @param options Prettier options\n * @param print Prettier child print callback.\n * @returns Prettier document.\n */\nexport function printIntersection(\n path: AstPath<IntersectionExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const types = path.map(print, \"options\");\n const result: (Doc | string)[] = [];\n let wasIndented = false;\n for (let i = 0; i < types.length; ++i) {\n if (i === 0) {\n result.push(types[i]);\n } else if (isModelNode(node.options[i - 1]) && isModelNode(node.options[i])) {\n // If both are objects, don't indent\n result.push([\" & \", wasIndented ? indent(types[i]) : types[i]]);\n } else if (!isModelNode(node.options[i - 1]) && !isModelNode(node.options[i])) {\n // If no object is involved, go to the next line if it breaks\n result.push(indent([\" &\", line, types[i]]));\n } else {\n // If you go from object to non-object or vis-versa, then inline it\n if (i > 1) {\n wasIndented = true;\n }\n result.push(\" & \", i > 1 ? indent(types[i]) : types[i]);\n }\n }\n return group(result);\n}\n\nfunction isModelNode(node: Node) {\n return node.kind === SyntaxKind.ModelExpression;\n}\n\nexport function printArray(\n path: AstPath<ArrayExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n return [path.call(print, \"elementType\"), \"[]\"];\n}\n\nexport function printTuple(\n path: AstPath<TupleExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n return group([\n \"[\",\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"values\"),\n ),\n ),\n softline,\n \"]\",\n ]);\n}\n\nexport function printMemberExpression(\n path: AstPath<MemberExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [node.base ? [path.call(print, \"base\"), node.selector] : \"\", id];\n}\n\nexport function printModelExpression(\n path: AstPath<ModelExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const inBlock = isModelExpressionInBlock(path);\n const node = path.node;\n if (inBlock) {\n return group(printModelPropertiesBlock(path, options, print));\n } else {\n const properties =\n node.properties.length === 0\n ? \"\"\n : indent(\n joinMembersInBlock(path, \"properties\", options, print, ifBreak(\",\", \", \"), softline),\n );\n return group([properties, softline]);\n }\n}\n\nexport function printObjectLiteral(\n path: AstPath<ObjectLiteralNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.properties && node.properties.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"#{}\";\n }\n const lineDoc = softline;\n const body: Doc[] = [\n joinMembersInBlock(path, \"properties\", options, print, ifBreak(\",\", \", \"), softline),\n ];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"#{\", ifBreak(\"\", \" \"), indent(body), lineDoc, ifBreak(\"\", \" \"), \"}\"]);\n}\n\nexport function printObjectLiteralProperty(\n path: AstPath<ObjectLiteralPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [printDirectives(path, options, print), id, \": \", path.call(print, \"value\")];\n}\n\nexport function printObjectLiteralSpreadProperty(\n path: AstPath<ObjectLiteralSpreadPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [printDirectives(path, options, print), \"...\", path.call(print, \"target\")];\n}\n\nexport function printArrayLiteral(\n path: AstPath<ArrayLiteralNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return group([\n \"#[\",\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"values\"),\n ),\n ),\n softline,\n \"]\",\n ]);\n}\n\nexport function printModelStatement(\n path: AstPath<ModelStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const heritage = node.extends\n ? [ifBreak(line, \" \"), \"extends \", path.call(print, \"extends\")]\n : \"\";\n const isBase = node.is ? [ifBreak(line, \" \"), \"is \", path.call(print, \"is\")] : \"\";\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const shouldPrintBody = nodeHasComments || !(node.properties.length === 0 && node.is);\n const body = shouldPrintBody ? [\" \", printModelPropertiesBlock(path, options, print)] : \";\";\n return [\n printDecorators(path, options, print, { tryInline: false }).decorators,\n \"model \",\n id,\n generic,\n group(indent([\"\", heritage, isBase])),\n body,\n ];\n}\n\nfunction printModelPropertiesBlock(\n path: AstPath<\n Node & {\n properties?: readonly (ModelPropertyNode | ModelSpreadPropertyNode)[];\n }\n >,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.properties && node.properties.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"{}\";\n }\n const tryInline = path.getParentNode()?.kind === SyntaxKind.TemplateParameterDeclaration;\n const lineDoc = tryInline ? softline : hardline;\n const seperator = isModelAValue(path) ? \",\" : \";\";\n\n const body = [joinMembersInBlock(path, \"properties\", options, print, seperator, lineDoc)];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), lineDoc, \"}\"]);\n}\n\n/**\n * Join members nodes that are in a block by adding extra new lines when needed.(e.g. when there are decorators or doc comments )\n * @param path Prettier AST Path.\n * @param options Prettier options\n * @param print Prettier print callback\n * @param separator Separator\n * @param regularLine What line to use when we should split lines\n * @returns\n */\nfunction joinMembersInBlock<T extends Node>(\n path: AstPath<T>,\n member: keyof T,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n separator: Doc,\n regularLine: Doc = hardline,\n): Doc {\n const doc: Doc[] = [regularLine];\n const propertyContainerNode = path.node;\n\n let newLineBeforeNextProp = false;\n path.each((item, propertyIndex) => {\n const isFirst = propertyIndex === 0;\n const isLast = propertyIndex === (propertyContainerNode[member] as any).length - 1;\n const shouldWrapInNewLines = shouldWrapMemberInNewLines(item as any, options);\n\n if ((newLineBeforeNextProp || shouldWrapInNewLines) && !isFirst) {\n doc.push(hardline);\n newLineBeforeNextProp = false;\n }\n doc.push(print(item));\n if (isLast) {\n doc.push(ifBreak(separator));\n } else {\n doc.push(separator);\n doc.push(regularLine);\n if (shouldWrapInNewLines) {\n newLineBeforeNextProp = true;\n }\n }\n }, member as any);\n return doc;\n}\n\n/**\n * Check if property item (PropertyNode, SpreadProperty) should be wrapped in new lines.\n * It can be wrapped for the following reasons:\n * - has decorators on lines above\n * - has leading comments\n */\nfunction shouldWrapMemberInNewLines(\n path: AstPath<\n | ModelPropertyNode\n | ModelSpreadPropertyNode\n | EnumMemberNode\n | EnumSpreadMemberNode\n | ScalarConstructorNode\n | UnionVariantNode\n | ObjectLiteralPropertyNode\n | ObjectLiteralSpreadPropertyNode\n >,\n options: any,\n): boolean {\n const node = path.node;\n return (\n (node.kind !== SyntaxKind.ModelSpreadProperty &&\n node.kind !== SyntaxKind.EnumSpreadMember &&\n node.kind !== SyntaxKind.ScalarConstructor &&\n node.kind !== SyntaxKind.ObjectLiteralProperty &&\n node.kind !== SyntaxKind.ObjectLiteralSpreadProperty &&\n shouldDecoratorBreakLine(path as any, options, {\n tryInline: DecoratorsTryInline.modelProperty,\n })) ||\n hasComments(node, CommentCheckFlags.Leading) ||\n (node.docs && node.docs?.length > 0)\n );\n}\n\n/**\n * Figure out if this model is being used as a definition or value.\n * @returns true if the model is used as a value(e.g. decorator value), false if it is used as a model definition.\n */\nfunction isModelAValue(path: AstPath<Node>): boolean {\n let count = 0;\n let node: Node | null = path.node;\n do {\n switch (node.kind) {\n case SyntaxKind.ModelStatement:\n case SyntaxKind.AliasStatement:\n case SyntaxKind.OperationStatement:\n return false;\n case SyntaxKind.DecoratorExpression:\n return true;\n }\n } while ((node = path.getParentNode(count++)));\n return true;\n}\n\nexport function printModelProperty(\n path: AstPath<ModelPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const { decorators } = printDecorators(path as AstPath<DecorableNode>, options, print, {\n tryInline: DecoratorsTryInline.modelProperty,\n });\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [\n printDirectives(path, options, print),\n decorators,\n id,\n node.optional ? \"?: \" : \": \",\n path.call(print, \"value\"),\n node.default ? [\" = \", path.call(print, \"default\")] : \"\",\n ];\n}\n\nfunction printIdentifier(\n id: IdentifierNode,\n context: \"allow-reserved\" | \"disallow-reserved\" = \"disallow-reserved\",\n) {\n return printIdentifierString(id.sv, context);\n}\n\nfunction isModelExpressionInBlock(path: AstPath<ModelExpressionNode>) {\n const parent: Node | null = path.getParentNode() as any;\n\n switch (parent?.kind) {\n case SyntaxKind.OperationSignatureDeclaration:\n return parent.parameters !== path.getNode();\n default:\n return true;\n }\n}\n\nfunction printScalarStatement(\n path: AstPath<ScalarStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const template = printTemplateParameters(path, options, print, \"templateParameters\");\n\n const heritage = node.extends\n ? [ifBreak(line, \" \"), \"extends \", path.call(print, \"extends\")]\n : \"\";\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const shouldPrintBody = nodeHasComments || !(node.members.length === 0);\n\n const members = shouldPrintBody ? [\" \", printScalarBody(path, options, print)] : \";\";\n return [\n printDecorators(path, options, print, { tryInline: false }).decorators,\n \"scalar \",\n id,\n template,\n group(indent([\"\", heritage])),\n members,\n ];\n}\n\nfunction printScalarBody(\n path: AstPath<ScalarStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.members && node.members.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"{}\";\n }\n const body = [joinMembersInBlock(path, \"members\", options, print, \";\", hardline)];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nfunction printScalarConstructor(\n path: AstPath<ScalarConstructorNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"parameters\"),\n ),\n ),\n softline,\n ]),\n ];\n return [\"init \", id, \"(\", parameters, \")\"];\n}\n\nexport function printNamespaceStatement(\n path: AstPath<FlattenedNamespaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const names = path.map(print, \"ids\");\n const currentNode = path.getNode();\n\n const suffix =\n currentNode?.statements === undefined\n ? \";\"\n : [\n \" {\",\n indent([hardline, printStatementSequence(path, options, print, \"statements\")]),\n hardline,\n \"}\",\n ];\n\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n return [decorators, `namespace `, join(\".\", names), suffix];\n}\n\nexport function printOperationSignatureDeclaration(\n path: AstPath<OperationSignatureDeclarationNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\"(\", path.call(print, \"parameters\"), \"): \", path.call(print, \"returnType\")];\n}\n\nexport function printOperationSignatureReference(\n path: AstPath<OperationSignatureReferenceNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\" is \", path.call(print, \"baseOperation\")];\n}\n\nexport function printOperationStatement(\n path: AstPath<OperationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const inInterface = (path.getParentNode()?.kind as any) === SyntaxKind.InterfaceStatement;\n const templateParams = printTemplateParameters(path, options, print, \"templateParameters\");\n const { decorators } = printDecorators(path as AstPath<DecorableNode>, options, print, {\n tryInline: true,\n });\n\n return [\n decorators,\n inInterface ? \"\" : \"op \",\n path.call(print, \"id\"),\n templateParams,\n path.call(print, \"signature\"),\n `;`,\n ];\n}\n\nexport function printStatementSequence<T extends Node>(\n path: AstPath<T>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n property: keyof T,\n) {\n const node = path.node;\n const parts: Doc[] = [];\n const lastStatement = getLastStatement(node[property] as any as Statement[]);\n\n path.each((statementPath) => {\n const node = path.node;\n\n if (node.kind === SyntaxKind.EmptyStatement) {\n return;\n }\n\n const printed = print(statementPath);\n parts.push(printed);\n\n if (node !== lastStatement) {\n parts.push(hardline);\n\n if (isNextLineEmpty(options.originalText, node, options.locEnd)) {\n parts.push(hardline);\n }\n }\n }, property as any);\n\n return parts;\n}\n\nfunction getLastStatement(statements: Statement[]): Statement | undefined {\n for (let i = statements.length - 1; i >= 0; i--) {\n const statement = statements[i];\n if (statement.kind !== SyntaxKind.EmptyStatement) {\n return statement;\n }\n }\n return undefined;\n}\n\nexport function printUnion(\n path: AstPath<UnionExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const shouldHug = shouldHugType(node);\n\n const types = path.map((typePath) => {\n let printedType: string | Doc = print(typePath);\n if (!shouldHug) {\n printedType = align(2, printedType);\n }\n return printedType;\n }, \"options\");\n\n if (shouldHug) {\n return join(\" | \", types);\n }\n\n const shouldAddStartLine = true;\n const code = [ifBreak([shouldAddStartLine ? line : \"\", \"| \"], \"\"), join([line, \"| \"], types)];\n return group(indent(code));\n}\n\nfunction shouldHugType(node: Node) {\n if (node.kind === SyntaxKind.UnionExpression || node.kind === SyntaxKind.IntersectionExpression) {\n return node.options.length < 4;\n }\n return false;\n}\n\nexport function printTypeReference(\n path: AstPath<TypeReferenceNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n const template = printTemplateParameters(path, options, print, \"arguments\");\n return [type, template];\n}\n\nexport function printTemplateArgument(\n path: AstPath<TemplateArgumentNode>,\n _options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n if (path.node.name !== undefined) {\n const name = path.call(print, \"name\");\n const argument = path.call(print, \"argument\");\n\n return group([name, \" = \", argument]);\n } else {\n return path.call(print, \"argument\");\n }\n}\n\nexport function printValueOfExpression(\n path: AstPath<ValueOfExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n return [\"valueof \", type];\n}\nexport function printTypeOfExpression(\n path: AstPath<TypeOfExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n return [\"typeof \", type];\n}\n\nfunction printTemplateParameterDeclaration(\n path: AstPath<TemplateParameterDeclarationNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n return [\n path.call(print, \"id\"),\n node.constraint ? [\" extends \", path.call(print, \"constraint\")] : \"\",\n node.default ? [\" = \", path.call(print, \"default\")] : \"\",\n ];\n}\n\nfunction printModelSpread(\n path: AstPath<ModelSpreadPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n return [\"...\", path.call(print, \"target\")];\n}\n\nfunction printDecoratorDeclarationStatement(\n path: AstPath<DecoratorDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\", \", [\n [softline, path.call(print, \"target\")],\n ...path.map((arg) => [softline, print(arg)], \"parameters\"),\n ]),\n ),\n softline,\n ]),\n ];\n return [printModifiers(path, options, print), \"dec \", id, \"(\", parameters, \")\", \";\"];\n}\n\nfunction printFunctionDeclarationStatement(\n path: AstPath<FunctionDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"parameters\"),\n ),\n ),\n softline,\n ]),\n ];\n const returnType = node.returnType ? [\": \", path.call(print, \"returnType\")] : \"\";\n return [printModifiers(path, options, print), \"fn \", id, \"(\", parameters, \")\", returnType, \";\"];\n}\n\nfunction printFunctionParameterDeclaration(\n path: AstPath<FunctionParameterNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n\n const type = node.type ? [\": \", path.call(print, \"type\")] : \"\";\n\n return [\n node.rest ? \"...\" : \"\",\n printDirectives(path, options, print),\n id,\n node.optional ? \"?\" : \"\",\n type,\n ];\n}\n\nexport function printModifiers(\n path: AstPath<DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n if (node.modifiers.length === 0) {\n return \"\";\n }\n\n return path.map((x) => [print(x as any), \" \"], \"modifiers\");\n}\n\nfunction printStringLiteral(\n path: AstPath<StringLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n const multiline = isMultiline(node, options);\n\n const raw = getRawText(node, options);\n if (multiline) {\n const lines = splitLines(raw.slice(3));\n const whitespaceIndent = lines[lines.length - 1].length - 3;\n const newLines = trimMultilineString(lines, whitespaceIndent);\n return [`\"\"\"`, indent(markAsRoot(newLines))];\n } else {\n return raw;\n }\n}\n\nfunction isMultiline(\n node: StringLiteralNode | StringTemplateExpressionNode,\n options: TypeSpecPrettierOptions,\n) {\n return (\n options.originalText[node.pos] &&\n options.originalText[node.pos + 1] === `\"` &&\n options.originalText[node.pos + 2] === `\"`\n );\n}\n\nfunction printNumberLiteral(\n path: AstPath<NumericLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n return node.valueAsString;\n}\n\nfunction printBooleanLiteral(\n path: AstPath<BooleanLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n return node.value ? \"true\" : \"false\";\n}\n\nexport function printStringTemplateExpression(\n path: AstPath<StringTemplateExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const multiline = isMultiline(node, options);\n const rawHead = getRawText(node.head, options);\n if (multiline) {\n const lastSpan = node.spans[node.spans.length - 1];\n const lastLines = splitLines(getRawText(lastSpan.literal, options));\n const whitespaceIndent = lastLines[lastLines.length - 1].length - 3;\n const content = [\n trimMultilineString(splitLines(rawHead.slice(3)), whitespaceIndent),\n path.map((span: AstPath<StringTemplateSpanNode>) => {\n const expression = span.call(print, \"expression\");\n const spanRawText = getRawText(span.node.literal, options);\n const spanLines = splitLines(spanRawText);\n return [\n expression,\n spanLines[0],\n literalline,\n trimMultilineString(spanLines.slice(1), whitespaceIndent),\n ];\n }, \"spans\"),\n ];\n\n return [`\"\"\"`, indent(markAsRoot([content]))];\n } else {\n const content = [\n rawHead,\n path.map((span: AstPath<StringTemplateSpanNode>) => {\n const expression = span.call(print, \"expression\");\n return [expression, getRawText(span.node.literal, options)];\n }, \"spans\"),\n ];\n return content;\n }\n}\n\nfunction trimMultilineString(lines: string[], whitespaceIndent: number): Doc[] {\n const newLines = [];\n for (let i = 0; i < lines.length; i++) {\n newLines.push(lines[i].slice(whitespaceIndent));\n if (i < lines.length - 1) {\n newLines.push(literalline);\n }\n }\n return newLines;\n}\n\n/**\n * @param node Node that has postition information.\n * @param options Prettier options\n * @returns Raw text in the file for the given node.\n */\nfunction getRawText(node: TextRange, options: TypeSpecPrettierOptions): string {\n if (\"rawText\" in node) {\n return node.rawText as string;\n }\n return options.originalText.slice(node.pos, node.end);\n}\n\nfunction hasComments(node: any, flags?: CommentCheckFlags) {\n if (!node.comments || node.comments.length === 0) {\n return false;\n }\n const test = getCommentTestFunction(flags);\n return test ? node.comments.some(test) : true;\n}\n\nenum CommentCheckFlags {\n /** Check comment is a leading comment */\n Leading = 1 << 1,\n /** Check comment is a trailing comment */\n Trailing = 1 << 2,\n /** Check comment is a dangling comment */\n Dangling = 1 << 3,\n /** Check comment is a block comment */\n Block = 1 << 4,\n /** Check comment is a line comment */\n Line = 1 << 5,\n /** Check comment is a `prettier-ignore` comment */\n PrettierIgnore = 1 << 6,\n /** Check comment is the first attached comment */\n First = 1 << 7,\n /** Check comment is the last attached comment */\n Last = 1 << 8,\n}\n\ntype CommentTestFn = (comment: any, index: number, comments: any[]) => boolean;\n\nfunction getCommentTestFunction(flags: CommentCheckFlags | undefined): CommentTestFn | undefined {\n if (flags) {\n return (comment: any, index: number, comments: any[]) =>\n !(\n (flags & CommentCheckFlags.Leading && !comment.leading) ||\n (flags & CommentCheckFlags.Trailing && !comment.trailing) ||\n (flags & CommentCheckFlags.Dangling && (comment.leading || comment.trailing)) ||\n (flags & CommentCheckFlags.Block && !isBlockComment(comment)) ||\n (flags & CommentCheckFlags.Line && !isLineComment(comment)) ||\n (flags & CommentCheckFlags.First && index !== 0) ||\n (flags & CommentCheckFlags.Last && index !== comments.length - 1)\n );\n }\n return undefined;\n}\n\nfunction isBlockComment(comment: Comment): comment is BlockComment {\n return comment.kind === SyntaxKind.BlockComment;\n}\n\nfunction isLineComment(comment: Comment): comment is LineComment {\n return comment.kind === SyntaxKind.BlockComment;\n}\n", "// Have to create this file so we don't import any JS code from \"prettier\"\n// itself otherwise it cause all kind of issue when bundling in the browser.\nimport type { util as utilType } from \"prettier\";\nimport * as prettier from \"prettier/standalone\";\n\nexport const util: typeof utilType = (prettier as any).util;\n", "import type { Printer } from \"prettier\";\nimport { Node, SyntaxKind, TextRange, TypeSpecScriptNode } from \"../../core/types.js\";\nimport { util } from \"./util.js\";\n\ninterface CommentNode extends TextRange {\n readonly kind: SyntaxKind.LineComment | SyntaxKind.BlockComment;\n precedingNode?: Node;\n enclosingNode?: Node;\n followingNode?: Node;\n}\n\n/**\n * Override the default behavior to attach comments to syntax node.\n */\nexport const commentHandler: Printer<Node>[\"handleComments\"] = {\n ownLine: (comment, text, options, ast, isLastComment) =>\n [\n addEmptyInterfaceComment,\n addEmptyModelComment,\n addEmptyScalarComment,\n addCommentBetweenAnnotationsAndNode,\n handleOnlyComments,\n ].some((x) => x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment })),\n remaining: (comment, text, options, ast, isLastComment) =>\n [handleOnlyComments].some((x) =>\n x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment }),\n ),\n endOfLine: (comment, text, options, ast, isLastComment) =>\n [handleOnlyComments].some((x) =>\n x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment }),\n ),\n};\n\ninterface CommentContext {\n comment: CommentNode;\n text: string;\n options: any;\n ast: TypeSpecScriptNode;\n isLastComment: boolean;\n}\n/**\n * When a comment is on an empty interface make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * interface Foo {\n * // My comment\n * }\n */\nfunction addEmptyInterfaceComment({ comment, ast }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.InterfaceStatement &&\n enclosingNode.operations.length === 0 &&\n precedingNode &&\n precedingNode.kind === SyntaxKind.Identifier\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is in between a node and its annotations(Decorator, directives, doc comments).\n *\n * @example\n *\n * @foo\n * // My comment\n * @bar\n * model Foo {\n * }\n */\nfunction addCommentBetweenAnnotationsAndNode({ comment }: CommentContext) {\n const { enclosingNode, precedingNode } = comment;\n\n if (\n precedingNode &&\n (precedingNode.kind === SyntaxKind.DecoratorExpression ||\n precedingNode.kind === SyntaxKind.DirectiveExpression ||\n precedingNode.kind === SyntaxKind.Doc) &&\n enclosingNode &&\n (enclosingNode.kind === SyntaxKind.NamespaceStatement ||\n enclosingNode.kind === SyntaxKind.ModelStatement ||\n enclosingNode.kind === SyntaxKind.EnumStatement ||\n enclosingNode.kind === SyntaxKind.OperationStatement ||\n enclosingNode.kind === SyntaxKind.ScalarStatement ||\n enclosingNode.kind === SyntaxKind.InterfaceStatement ||\n enclosingNode.kind === SyntaxKind.ModelProperty ||\n enclosingNode.kind === SyntaxKind.EnumMember ||\n enclosingNode.kind === SyntaxKind.UnionVariant ||\n enclosingNode.kind === SyntaxKind.UnionStatement)\n ) {\n util.addTrailingComment(precedingNode, comment);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is on an empty model make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * model Foo {\n * // My comment\n * }\n */\nfunction addEmptyModelComment({ comment }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.ModelStatement &&\n enclosingNode.properties.length === 0 &&\n precedingNode &&\n (precedingNode === enclosingNode.is ||\n precedingNode === enclosingNode.id ||\n precedingNode === enclosingNode.extends)\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is on an empty scalar make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * scalar foo {\n * // My comment\n * }\n */\nfunction addEmptyScalarComment({ comment }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.ScalarStatement &&\n enclosingNode.members.length === 0 &&\n precedingNode &&\n (precedingNode === enclosingNode.id || precedingNode === enclosingNode.extends)\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\nfunction handleOnlyComments({ comment, ast, isLastComment }: CommentContext) {\n const { enclosingNode } = comment;\n if (ast?.statements?.length === 0) {\n if (isLastComment) {\n util.addDanglingComment(ast, comment, undefined);\n } else {\n util.addLeadingComment(ast, comment);\n }\n return true;\n }\n\n if (\n enclosingNode?.kind === SyntaxKind.TypeSpecScript &&\n enclosingNode.statements.length === 0 &&\n enclosingNode.directives?.length === 0\n ) {\n if (isLastComment) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n } else {\n util.addLeadingComment(enclosingNode, comment);\n }\n return true;\n }\n\n return false;\n}\n", "import type { AstPath } from \"prettier\";\nimport { Node, SyntaxKind } from \"../../core/types.js\";\nimport { TypeSpecPrettierOptions } from \"./types.js\";\n\n/**\n * Check if the current path should be wrapped in parentheses\n * @param path Prettier print path.\n * @param options Prettier options\n */\nexport function needsParens(path: AstPath<Node>, options: TypeSpecPrettierOptions): boolean {\n const parent = path.getParentNode();\n if (!parent) {\n return false;\n }\n\n const node = path.node;\n switch (node.kind) {\n case SyntaxKind.ValueOfExpression:\n return (\n parent.kind === SyntaxKind.UnionExpression ||\n parent.kind === SyntaxKind.ArrayExpression ||\n parent.kind === SyntaxKind.IntersectionExpression\n );\n case SyntaxKind.IntersectionExpression:\n return (\n parent.kind === SyntaxKind.UnionExpression || parent.kind === SyntaxKind.ArrayExpression\n );\n case SyntaxKind.UnionExpression:\n return (\n parent.kind === SyntaxKind.IntersectionExpression ||\n parent.kind === SyntaxKind.ArrayExpression\n );\n default:\n return false;\n }\n}\n", "/**\n * Reexport the bare minimum for rollup to do the tree shaking.\n */\nimport * as TypeSpecPrettierPlugin from \"../formatter/index.js\";\nexport default TypeSpecPrettierPlugin;\n", "/**\n * Reexport the bare minimum for rollup to do the tree shaking.\n */\nimport TypeSpecPrettierPlugin from \"@typespec/compiler/internals/prettier-formatter\";\nexport default TypeSpecPrettierPlugin;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAEA;;;;;;;;;ACEM,SAAU,iBAAiB,MAAc,MAAY;AACzD,MAAI,aAAmC;AAEvC,SAAO;IACL;IACA;IACA;IACA;;AAGF,WAAS,gBAAa;AACpB,WAAQ,aAAa,cAAc,eAAe,IAAI;EACxD;AAEA,WAAS,8BAA8B,UAAgB;AACrD,UAAM,SAAS,cAAa;AAE5B,QAAIA,QAAO,aAAa,QAAQ,QAAQ;AAQxC,QAAIA,QAAO,GAAG;AACZ,MAAAA,QAAO,CAACA,QAAO;IACjB;AAEA,WAAO;MACL,MAAAA;MACA,WAAW,WAAW,OAAOA,KAAI;;EAErC;AACF;AAaA,SAAS,eAAe,MAAY;AAClC,QAAM,SAAS,CAAA;AACf,MAAI,QAAQ;AACZ,MAAI,MAAM;AAEV,SAAO,MAAM,KAAK,QAAQ;AACxB,UAAM,KAAK,KAAK,WAAW,GAAG;AAC9B;AACA,YAAQ,IAAI;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;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAQ;EACR;E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ACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;;;;AC9kBL,SAAU,eAAe,WAAiB;AAC9C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BAAA,MAAA,IAAA,GAAA,IAAA;AACF,GAjBK,sBAAA,oBAAiB,CAAA,EAAA;AAqBtB,SAAS,uBAAuB,OAAoC;AAClE,MAAI,OAAO;AACT,WAAO,CAAC,SAAc,OAAe,aACnC,EACG,QAAQ,kBAAkB,WAAW,CAAC,QAAQ,WAC9C,QAAQ,kBAAkB,YAAY,CAAC,QAAQ,YAC/C,QAAQ,kBAAkB,aAAa,QAAQ,WAAW,QAAQ,aAClE,QAAQ,kBAAkB,SAAS,CAAC,eAAe,OAAO,KAC1D,QAAQ,kBAAkB,QAAQ,CAAC,cAAc,OAAO,KACxD,QAAQ,kBAAkB,SAAS,UAAU,KAC7C,QAAQ,kBAAkB,QAAQ,UAAU,SAAS,SAAS;EAErE;AACA,SAAO;AACT;AAEA,SAAS,eAAe,SAAgB;AACtC,SAAO,QAAQ,SAAS,WAAW;AACrC;AAEA,SAAS,cAAc,SAAgB;AACrC,SAAO,QAAQ,SAAS,WAAW;AACrC;;;AfvoDO,IAAM,iBAAiB,CAAA;AAEvB,IAAM,YAA+B;EAC1C;IACE,MAAM;IACN,SAAS,CAAC,UAAU;IACpB,YAAY,CAAC,MAAM;IACnB,mBAAmB,CAAC,UAAU;;;AAIlC,IAAM,iBAAyB;EAC7B,OAAAC;EACA,WAAW;EACX,SAAS,MAAU;AACjB,WAAO,KAAK;EACd;EACA,OAAO,MAAU;AACf,WAAO,KAAK;EACd;;AAEK,IAAM,UAAU;EACrB,UAAU;;AAGL,IAAM,WAAW;EACtB,mBAAmB;;;;AmB3BrB,IAAA,6BAAe;;;ACAf,IAAO,gBAAQ;",
|
|
6
|
-
"names": ["
|
|
3
|
+
"sources": ["../../compiler/src/formatter/index.ts", "../../compiler/src/utils/misc.ts", "../../compiler/src/core/diagnostic-creator.ts", "../../compiler/src/core/param-message.ts", "../../compiler/src/core/messages.ts", "../../compiler/src/core/source-file.ts", "../../compiler/src/core/types.ts", "../../compiler/src/core/diagnostics.ts", "../../compiler/src/core/nonascii.ts", "../../compiler/src/core/charcode.ts", "../../compiler/src/core/helpers/syntax-utils.ts", "../../compiler/src/core/compiler-code-fixes/triple-quote-indent.codefix.ts", "../../compiler/src/core/scanner.ts", "../../compiler/src/core/parser.ts", "../../compiler/src/formatter/parser.ts", "../../compiler/src/formatter/print/printer.ts", "../../compiler/src/formatter/print/util.ts", "../../compiler/src/formatter/print/comment-handler.ts", "../../compiler/src/formatter/print/needs-parens.ts", "../../compiler/src/internals/prettier-formatter.ts", "../src/index.mjs"],
|
|
4
|
+
"sourcesContent": ["import type { Parser, SupportLanguage } from \"prettier\";\nimport { Node } from \"../core/types.js\";\nimport { parse } from \"./parser.js\";\nimport { typespecPrinter } from \"./print/index.js\";\n\nexport const defaultOptions = {};\n\nexport const languages: SupportLanguage[] = [\n {\n name: \"TypeSpec\",\n parsers: [\"typespec\"],\n extensions: [\".tsp\"],\n vscodeLanguageIds: [\"typespec\"],\n },\n];\n\nconst TypeSpecParser: Parser = {\n parse,\n astFormat: \"typespec-format\",\n locStart(node: Node) {\n return node.pos;\n },\n locEnd(node: Node) {\n return node.end;\n },\n};\nexport const parsers = {\n typespec: TypeSpecParser,\n};\n\nexport const printers = {\n \"typespec-format\": typespecPrinter,\n};\n", "import { isPathAbsolute, isUrl, normalizePath, resolvePath } from \"../core/path-utils.js\";\nimport type {\n MutableSymbolTable,\n RekeyableMap,\n SourceFile,\n SymbolTable,\n SystemHost,\n} from \"../core/types.js\";\n\n/**\n * Recursively calls Object.freeze such that all objects and arrays\n * referenced are frozen.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepFreeze<T>(value: T): T {\n if (Array.isArray(value)) {\n value.forEach(deepFreeze);\n } else if (typeof value === \"object\") {\n for (const prop in value) {\n deepFreeze(value[prop]);\n }\n }\n\n return Object.freeze(value);\n}\n\n/**\n * Deeply clones an object.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepClone<T>(value: T): T {\n if (Array.isArray(value)) {\n return value.map(deepClone) as any;\n }\n\n if (value === null) {\n return value;\n }\n\n if (typeof value === \"object\") {\n const obj: any = {};\n for (const prop in value) {\n obj[prop] = deepClone(value[prop]);\n }\n return obj;\n }\n\n return value;\n}\n\n/**\n * Checks if two objects are deeply equal.\n *\n * Does not support cycles. Intended to be used only on plain data that can\n * be directly represented in JSON.\n */\nexport function deepEquals(left: unknown, right: unknown): boolean {\n if (left === right) {\n return true;\n }\n if (left === null || right === null || typeof left !== \"object\" || typeof right !== \"object\") {\n return false;\n }\n if (Array.isArray(left)) {\n return Array.isArray(right) ? arrayEquals(left, right, deepEquals) : false;\n }\n return mapEquals(new Map(Object.entries(left)), new Map(Object.entries(right)), deepEquals);\n}\n\nexport type EqualityComparer<T> = (x: T, y: T) => boolean;\n\n/**\n * Check if two arrays have the same elements.\n *\n * @param equals Optional callback for element equality comparison.\n * Default is to compare by identity using `===`.\n */\nexport function arrayEquals<T>(\n left: T[],\n right: T[],\n equals: EqualityComparer<T> = (x, y) => x === y,\n): boolean {\n if (left === right) {\n return true;\n }\n if (left.length !== right.length) {\n return false;\n }\n for (let i = 0; i < left.length; i++) {\n if (!equals(left[i], right[i])) {\n return false;\n }\n }\n\n return true;\n}\n\n/**\n * Check if two maps have the same entries.\n *\n * @param equals Optional callback for value equality comparison.\n * Default is to compare by identity using `===`.\n */\nexport function mapEquals<K, V>(\n left: Map<K, V>,\n right: Map<K, V>,\n equals: EqualityComparer<V> = (x, y) => x === y,\n): boolean {\n if (left === right) {\n return true;\n }\n if (left.size !== right.size) {\n return false;\n }\n for (const [key, value] of left) {\n if (!right.has(key) || !equals(value, right.get(key)!)) {\n return false;\n }\n }\n return true;\n}\n\nexport async function getNormalizedRealPath(host: SystemHost, path: string) {\n try {\n return normalizePath(await host.realpath(path));\n } catch (error: any) {\n // This could mean the file got deleted but VSCode still has it in memory. So keep the original path.\n if (error.code === \"ENOENT\") {\n return normalizePath(path);\n }\n throw error;\n }\n}\n\nexport async function readUrlOrPath(host: SystemHost, pathOrUrl: string): Promise<SourceFile> {\n if (isUrl(pathOrUrl)) {\n return host.readUrl(pathOrUrl);\n }\n return host.readFile(pathOrUrl);\n}\n\nexport function resolveRelativeUrlOrPath(base: string, relativeOrAbsolute: string): string {\n if (isUrl(relativeOrAbsolute)) {\n return relativeOrAbsolute;\n } else if (isPathAbsolute(relativeOrAbsolute)) {\n return relativeOrAbsolute;\n } else if (isUrl(base)) {\n return new URL(relativeOrAbsolute, base).href;\n } else {\n return resolvePath(base, relativeOrAbsolute);\n }\n}\n\n/**\n * A specially typed version of `Array.isArray` to work around [this issue](https://github.com/microsoft/TypeScript/issues/17002).\n */\nexport function isArray<T>(\n arg: T | {},\n): arg is T extends readonly any[] ? (unknown extends T ? never : readonly any[]) : any[] {\n return Array.isArray(arg);\n}\n\n/**\n * Check if argument is not undefined.\n */\nexport function isDefined<T>(arg: T | undefined): arg is T {\n return arg !== undefined;\n}\n\nexport function isWhitespaceStringOrUndefined(str: string | undefined): boolean {\n return !str || /^\\s*$/.test(str);\n}\n\nexport function firstNonWhitespaceCharacterIndex(line: string): number {\n return line.search(/\\S/);\n}\n\nexport function distinctArray<T, P>(arr: T[], keySelector: (item: T) => P): T[] {\n const map = new Map<P, T>();\n for (const item of arr) {\n map.set(keySelector(item), item);\n }\n return Array.from(map.values());\n}\n\nexport function tryParseJson(content: string): any | undefined {\n try {\n return JSON.parse(content);\n } catch {\n return undefined;\n }\n}\n\nexport function debounce<T extends (...args: any[]) => any>(fn: T, delayInMs: number): T {\n let timer: NodeJS.Timeout | undefined;\n return function (this: any, ...args: Parameters<T>) {\n if (timer) {\n clearTimeout(timer);\n }\n timer = setTimeout(() => {\n fn.apply(this, args);\n }, delayInMs);\n } as T;\n}\n\n/**\n * Remove undefined properties from object.\n */\nexport function omitUndefined<T extends Record<string, unknown>>(data: T): T {\n return Object.fromEntries(Object.entries(data).filter(([k, v]) => v !== undefined)) as any;\n}\n\n/**\n * Extract package.json's tspMain entry point in a given path.\n * @param path Path that contains package.json\n * @param reportDiagnostic optional diagnostic handler.\n */\nexport function resolveTspMain(packageJson: any): string | undefined {\n if (packageJson?.tspMain !== undefined) {\n return packageJson.tspMain;\n }\n return undefined;\n}\n\n/**\n * A map keyed by a set of objects.\n *\n * This is likely non-optimal.\n */\nexport class MultiKeyMap<K extends readonly object[], V> {\n #currentId = 0;\n #idMap = new WeakMap<object, number>();\n #items = new Map<string, V>();\n\n get(items: K): V | undefined {\n return this.#items.get(this.compositeKeyFor(items));\n }\n\n set(items: K, value: V): void {\n const key = this.compositeKeyFor(items);\n this.#items.set(key, value);\n }\n\n private compositeKeyFor(items: K) {\n return items.map((i) => this.keyFor(i)).join(\",\");\n }\n\n private keyFor(item: object) {\n if (this.#idMap.has(item)) {\n return this.#idMap.get(item);\n }\n\n const id = this.#currentId++;\n this.#idMap.set(item, id);\n return id;\n }\n}\n\n/**\n * A map with exactly two keys per value.\n *\n * Functionally the same as `MultiKeyMap<[K1, K2], V>`, but more efficient.\n * @hidden bug in typedoc\n */\nexport class TwoLevelMap<K1, K2, V> extends Map<K1, Map<K2, V>> {\n /**\n * Get an existing entry in the map or add a new one if not found.\n *\n * @param key1 The first key\n * @param key2 The second key\n * @param create A callback to create the new entry when not found.\n * @param sentinel An optional sentinel value to use to indicate that the\n * entry is being created.\n */\n getOrAdd(key1: K1, key2: K2, create: () => V, sentinel?: V): V {\n let map = this.get(key1);\n if (map === undefined) {\n map = new Map();\n this.set(key1, map);\n }\n let entry = map.get(key2);\n if (entry === undefined) {\n if (sentinel !== undefined) {\n map.set(key2, sentinel);\n }\n entry = create();\n map.set(key2, entry);\n }\n return entry;\n }\n}\n\n// Adapted from https://github.com/microsoft/TypeScript/blob/bc52ff6f4be9347981de415a35da90497eae84ac/src/compiler/core.ts#L1507\nexport class Queue<T> {\n #elements: T[];\n #headIndex = 0;\n\n constructor(elements?: T[]) {\n this.#elements = elements?.slice() ?? [];\n }\n\n isEmpty(): boolean {\n return this.#headIndex === this.#elements.length;\n }\n\n enqueue(...items: T[]): void {\n this.#elements.push(...items);\n }\n\n dequeue(): T {\n if (this.isEmpty()) {\n throw new Error(\"Queue is empty.\");\n }\n\n const result = this.#elements[this.#headIndex];\n this.#elements[this.#headIndex] = undefined!; // Don't keep referencing dequeued item\n this.#headIndex++;\n\n // If more than half of the queue is empty, copy the remaining elements to the\n // front and shrink the array (unless we'd be saving fewer than 100 slots)\n if (this.#headIndex > 100 && this.#headIndex > this.#elements.length >> 1) {\n const newLength = this.#elements.length - this.#headIndex;\n this.#elements.copyWithin(0, this.#headIndex);\n this.#elements.length = newLength;\n this.#headIndex = 0;\n }\n\n return result;\n }\n}\n\n/**\n * The mutable equivalent of a type.\n */\n//prettier-ignore\nexport type Mutable<T> =\n T extends SymbolTable ? T & MutableSymbolTable :\n T extends ReadonlyMap<infer K, infer V> ? Map<K, V> :\n T extends ReadonlySet<infer T> ? Set<T> :\n T extends readonly (infer V)[] ? V[] :\n // brand to force explicit conversion.\n { -readonly [P in keyof T]: T[P] };\n\n//prettier-ignore\ntype MutableExt<T> =\nT extends SymbolTable ? T & MutableSymbolTable :\nT extends ReadonlyMap<infer K, infer V> ? Map<K, V> :\nT extends ReadonlySet<infer T> ? Set<T> :\nT extends readonly (infer V)[] ? V[] :\n// brand to force explicit conversion.\n{ -readonly [P in keyof T]: T[P] } & { __writableBrand: never };\n\n/**\n * Casts away readonly typing.\n *\n * Use it like this when it is safe to override readonly typing:\n * mutate(item).prop = value;\n */\nexport function mutate<T>(value: T): MutableExt<T> {\n return value as MutableExt<T>;\n}\n\nexport function createStringMap<T>(caseInsensitive: boolean): Map<string, T> {\n return caseInsensitive ? new CaseInsensitiveMap<T>() : new Map<string, T>();\n}\n\nclass CaseInsensitiveMap<T> extends Map<string, T> {\n get(key: string) {\n return super.get(key.toUpperCase());\n }\n set(key: string, value: T) {\n return super.set(key.toUpperCase(), value);\n }\n has(key: string) {\n return super.has(key.toUpperCase());\n }\n delete(key: string) {\n return super.delete(key.toUpperCase());\n }\n}\n\nexport function createRekeyableMap<K, V>(entries?: Iterable<[K, V]>): RekeyableMap<K, V> {\n return new RekeyableMapImpl<K, V>(entries);\n}\n\ninterface RekeyableMapKey<K> {\n key: K;\n}\n\nclass RekeyableMapImpl<K, V> implements RekeyableMap<K, V> {\n #keys = new Map<K, RekeyableMapKey<K>>();\n #values = new Map<RekeyableMapKey<K>, V>();\n\n constructor(entries?: Iterable<[K, V]>) {\n if (entries) {\n for (const [key, value] of entries) {\n this.set(key, value);\n }\n }\n }\n\n clear(): void {\n this.#keys.clear();\n this.#values.clear();\n }\n\n delete(key: K): boolean {\n const keyItem = this.#keys.get(key);\n if (keyItem) {\n this.#keys.delete(key);\n return this.#values.delete(keyItem);\n }\n return false;\n }\n\n forEach(callbackfn: (value: V, key: K, map: Map<K, V>) => void, thisArg?: any): void {\n this.#values.forEach((value, keyItem) => {\n callbackfn(value, keyItem.key, this);\n }, thisArg);\n }\n\n get(key: K): V | undefined {\n const keyItem = this.#keys.get(key);\n return keyItem ? this.#values.get(keyItem) : undefined;\n }\n\n has(key: K): boolean {\n return this.#keys.has(key);\n }\n\n set(key: K, value: V): this {\n let keyItem = this.#keys.get(key);\n if (!keyItem) {\n keyItem = { key };\n this.#keys.set(key, keyItem);\n }\n\n this.#values.set(keyItem, value);\n return this;\n }\n\n get size() {\n return this.#values.size;\n }\n\n *entries(): MapIterator<[K, V]> {\n for (const [k, v] of this.#values) {\n yield [k.key, v];\n }\n }\n\n *keys(): MapIterator<K> {\n for (const k of this.#values.keys()) {\n yield k.key;\n }\n }\n\n values(): MapIterator<V> {\n return this.#values.values();\n }\n\n [Symbol.iterator](): MapIterator<[K, V]> {\n return this.entries();\n }\n\n [Symbol.toStringTag] = \"RekeyableMap\";\n\n rekey(existingKey: K, newKey: K): boolean {\n const keyItem = this.#keys.get(existingKey);\n if (!keyItem) {\n return false;\n }\n this.#keys.delete(existingKey);\n const newKeyItem = this.#keys.get(newKey);\n if (newKeyItem) {\n this.#values.delete(newKeyItem);\n }\n keyItem.key = newKey;\n this.#keys.set(newKey, keyItem);\n return true;\n }\n}\n\nexport function isPromise(value: unknown): value is Promise<unknown> {\n return !!value && typeof (value as any).then === \"function\";\n}\n\nexport function getEnvironmentVariable(\n envVarName: string,\n defaultWhenNotAvailable?: string,\n): string | undefined {\n // make sure we are fine in both node and browser environments\n if (typeof process !== \"undefined\") {\n return process?.env?.[envVarName] ?? defaultWhenNotAvailable;\n }\n return defaultWhenNotAvailable;\n}\n", "import { mutate } from \"../utils/misc.js\";\nimport type { Program } from \"./program.js\";\nimport type {\n Diagnostic,\n DiagnosticCreator,\n DiagnosticMap,\n DiagnosticMessages,\n DiagnosticReport,\n} from \"./types.js\";\n\n/**\n * Create a new diagnostics creator.\n * @param diagnostics Map of the potential diagnostics.\n * @param libraryName Optional name of the library if in the scope of a library.\n * @returns @see DiagnosticCreator\n */\nexport function createDiagnosticCreator<T extends { [code: string]: DiagnosticMessages }>(\n diagnostics: DiagnosticMap<T>,\n libraryName?: string,\n): DiagnosticCreator<T> {\n const errorMessage = libraryName\n ? `It must match one of the code defined in the library '${libraryName}'`\n : \"It must match one of the code defined in the compiler.\";\n\n function createDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n diagnostic: DiagnosticReport<T, C, M>,\n ): Diagnostic {\n const diagnosticDef = diagnostics[diagnostic.code];\n\n if (!diagnosticDef) {\n const codeStr = Object.keys(diagnostics)\n .map((x) => ` - ${x}`)\n .join(\"\\n\");\n const code = String(diagnostic.code);\n throw new Error(\n `Unexpected diagnostic code '${code}'. ${errorMessage}. Defined codes:\\n${codeStr}`,\n );\n }\n\n const message = diagnosticDef.messages[diagnostic.messageId ?? \"default\"];\n if (!message) {\n const codeStr = Object.keys(diagnosticDef.messages)\n .map((x) => ` - ${x}`)\n .join(\"\\n\");\n const messageId = String(diagnostic.messageId);\n const code = String(diagnostic.code);\n throw new Error(\n `Unexpected message id '${messageId}'. ${errorMessage} for code '${code}'. Defined codes:\\n${codeStr}`,\n );\n }\n\n const messageStr = typeof message === \"string\" ? message : message((diagnostic as any).format);\n\n const result: Diagnostic = {\n code: libraryName ? `${libraryName}/${String(diagnostic.code)}` : diagnostic.code.toString(),\n severity: diagnosticDef.severity,\n message: messageStr,\n target: diagnostic.target,\n };\n if (diagnosticDef.url) {\n mutate(result).url = diagnosticDef.url;\n }\n if (diagnostic.codefixes) {\n mutate(result).codefixes = diagnostic.codefixes;\n }\n return result;\n }\n\n function reportDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n program: Program,\n diagnostic: DiagnosticReport<T, C, M>,\n ) {\n const diag = createDiagnostic(diagnostic);\n program.reportDiagnostic(diag);\n }\n\n return {\n diagnostics,\n createDiagnostic,\n reportDiagnostic,\n } as any;\n}\n", "import type { CallableMessage } from \"./types.js\";\n\nexport function paramMessage<const T extends string[]>(\n strings: readonly string[],\n ...keys: T\n): CallableMessage<T> {\n const template = (dict: Record<T[number], string>) => {\n const result = [strings[0]];\n keys.forEach((key, i) => {\n const value = (dict as any)[key];\n if (value !== undefined) {\n result.push(value);\n }\n result.push(strings[i + 1]);\n });\n return result.join(\"\");\n };\n template.keys = keys;\n return template;\n}\n", "// Static assert: this won't compile if one of the entries above is invalid.\nimport { createDiagnosticCreator } from \"./diagnostic-creator.js\";\nimport { paramMessage } from \"./param-message.js\";\nimport type { TypeOfDiagnostics } from \"./types.js\";\n\nconst diagnostics = {\n /**\n * Scanner errors.\n */\n \"digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Digit expected.\",\n },\n },\n\n \"hex-digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Hexadecimal digit expected.\",\n },\n },\n\n \"binary-digit-expected\": {\n severity: \"error\",\n messages: {\n default: \"Binary digit expected.\",\n },\n },\n\n unterminated: {\n severity: \"error\",\n messages: {\n default: paramMessage`Unterminated ${\"token\"}.`,\n },\n },\n \"creating-file\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Error creating single file: ${\"filename\"}, ${\"error\"}`,\n },\n },\n\n \"invalid-escape-sequence\": {\n severity: \"error\",\n messages: {\n default: \"Invalid escape sequence.\",\n },\n },\n\n \"no-new-line-start-triple-quote\": {\n severity: \"error\",\n messages: {\n default: \"String content in triple quotes must begin on a new line.\",\n },\n },\n\n \"no-new-line-end-triple-quote\": {\n severity: \"error\",\n messages: {\n default: \"Closing triple quotes must begin on a new line.\",\n },\n },\n\n \"triple-quote-indent\": {\n severity: \"error\",\n description:\n \"Report when a triple-quoted string has lines with less indentation as the closing triple quotes.\",\n url: \"https://typespec.io/docs/standard-library/diags/triple-quote-indent\",\n messages: {\n default:\n \"All lines in triple-quoted string lines must have the same indentation as closing triple quotes.\",\n },\n },\n\n \"invalid-character\": {\n severity: \"error\",\n messages: {\n default: \"Invalid character.\",\n },\n },\n\n /**\n * Utils\n */\n \"file-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`File ${\"path\"} not found.`,\n },\n },\n \"file-load\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"message\"}`,\n },\n },\n\n /**\n * Init templates\n */\n \"init-template-invalid-json\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Unable to parse ${\"url\"}: ${\"message\"}. Check that the template URL is correct.`,\n },\n },\n \"init-template-download-failed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Failed to download template from ${\"url\"}: ${\"message\"}. Check that the template URL is correct.`,\n },\n },\n\n /**\n * Parser errors.\n */\n \"multiple-blockless-namespace\": {\n severity: \"error\",\n messages: {\n default: \"Cannot use multiple blockless namespaces.\",\n },\n },\n \"blockless-namespace-first\": {\n severity: \"error\",\n messages: {\n default: \"Blockless namespaces can't follow other declarations.\",\n topLevel: \"Blockless namespace can only be top-level.\",\n },\n },\n \"import-first\": {\n severity: \"error\",\n messages: {\n default: \"Imports must come prior to namespaces or other declarations.\",\n topLevel: \"Imports must be top-level and come prior to namespaces or other declarations.\",\n },\n },\n \"token-expected\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"token\"} expected.`,\n unexpected: paramMessage`Unexpected token ${\"token\"}`,\n numericOrStringLiteral: \"Expected numeric or string literal.\",\n identifier: \"Identifier expected.\",\n expression: \"Expression expected.\",\n statement: \"Statement expected.\",\n property: \"Property expected.\",\n enumMember: \"Enum member expected.\",\n typeofTarget: \"Typeof expects a value literal or value reference.\",\n },\n },\n \"unknown-directive\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Unknown directive '#${\"id\"}'`,\n },\n },\n \"augment-decorator-target\": {\n severity: \"error\",\n messages: {\n default: `Augment decorator first argument must be a type reference.`,\n noInstance: `Cannot reference template instances.`,\n noModelExpression: `Cannot augment model expressions.`,\n noUnionExpression: `Cannot augment union expressions.`,\n },\n },\n \"duplicate-decorator\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} cannot be used twice on the same declaration.`,\n },\n },\n \"decorator-conflict\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} cannot be used with decorator ${\"otherDecoratorName\"} on the same declaration.`,\n },\n },\n \"reserved-identifier\": {\n severity: \"error\",\n messages: {\n default: \"Keyword cannot be used as identifier.\",\n future: paramMessage`${\"name\"} is a reserved keyword`,\n },\n },\n \"invalid-directive-location\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot place directive on ${\"nodeName\"}.`,\n },\n },\n \"invalid-decorator-location\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot decorate ${\"nodeName\"}.`,\n },\n },\n \"default-required\": {\n severity: \"error\",\n messages: {\n default: \"Required template parameters must not follow optional template parameters\",\n },\n },\n \"invalid-template-argument-name\": {\n severity: \"error\",\n messages: {\n default: \"Template parameter argument names must be valid, bare identifiers.\",\n },\n },\n \"invalid-template-default\": {\n severity: \"error\",\n messages: {\n default:\n \"Template parameter defaults can only reference previously declared type parameters.\",\n },\n },\n \"required-parameter-first\": {\n severity: \"error\",\n messages: {\n default: \"A required parameter cannot follow an optional parameter.\",\n },\n },\n \"rest-parameter-last\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter must be last in a parameter list.\",\n },\n },\n \"rest-parameter-required\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter cannot be optional.\",\n },\n },\n /**\n * Parser doc comment warnings.\n * Design goal: Malformed doc comments should only produce warnings, not errors.\n */\n \"doc-invalid-identifier\": {\n severity: \"warning\",\n messages: {\n default: \"Invalid identifier.\",\n tag: \"Invalid tag name. Use backticks around code if this was not meant to be a tag.\",\n param: \"Invalid parameter name.\",\n prop: \"Invalid property name.\",\n templateParam: \"Invalid template parameter name.\",\n },\n },\n /**\n * Checker\n */\n \"using-invalid-ref\": {\n severity: \"error\",\n messages: {\n default: \"Using must refer to a namespace\",\n },\n },\n \"invalid-type-ref\": {\n severity: \"error\",\n messages: {\n default: \"Invalid type reference\",\n decorator: \"Can't put a decorator in a type\",\n function: \"Can't use a function as a type\",\n },\n },\n \"invalid-template-args\": {\n severity: \"error\",\n messages: {\n default: \"Invalid template arguments.\",\n notTemplate: \"Can't pass template arguments to non-templated type\",\n tooMany: \"Too many template arguments provided.\",\n unknownName: paramMessage`No parameter named '${\"name\"}' exists in the target template.`,\n positionalAfterNamed:\n \"Positional template arguments cannot follow named arguments in the same argument list.\",\n missing: paramMessage`Template argument '${\"name\"}' is required and not specified.`,\n specifiedAgain: paramMessage`Cannot specify template argument '${\"name\"}' again.`,\n },\n },\n \"intersect-non-model\": {\n severity: \"error\",\n messages: {\n default: \"Cannot intersect non-model types (including union types).\",\n },\n },\n \"intersect-invalid-index\": {\n severity: \"error\",\n messages: {\n default: \"Cannot intersect incompatible models.\",\n never: \"Cannot intersect a model that cannot hold properties.\",\n array: \"Cannot intersect an array model.\",\n },\n },\n \"incompatible-indexer\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property is incompatible with indexer:\\n${\"message\"}`,\n },\n },\n \"no-array-properties\": {\n severity: \"error\",\n messages: {\n default: \"Array models cannot have any properties.\",\n },\n },\n \"intersect-duplicate-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Intersection contains duplicate property definitions for ${\"propName\"}`,\n },\n },\n \"invalid-decorator\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"id\"} is not a decorator`,\n },\n },\n \"invalid-ref\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot resolve ${\"id\"}`,\n identifier: paramMessage`Unknown identifier ${\"id\"}`,\n decorator: paramMessage`Unknown decorator @${\"id\"}`,\n inDecorator: paramMessage`Cannot resolve ${\"id\"} in decorator`,\n underNamespace: paramMessage`Namespace ${\"namespace\"} doesn't have member ${\"id\"}`,\n member: paramMessage`${\"kind\"} doesn't have member ${\"id\"}`,\n metaProperty: paramMessage`${\"kind\"} doesn't have meta property ${\"id\"}`,\n node: paramMessage`Cannot resolve '${\"id\"}' in node ${\"nodeName\"} since it has no members. Did you mean to use \"::\" instead of \".\"?`,\n },\n },\n \"duplicate-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Model already has a property named ${\"propName\"}`,\n },\n },\n \"override-property-mismatch\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Model has an inherited property named ${\"propName\"} of type ${\"propType\"} which cannot override type ${\"parentType\"}`,\n disallowedOptionalOverride: paramMessage`Model has a required inherited property named ${\"propName\"} which cannot be overridden as optional`,\n },\n },\n \"extend-scalar\": {\n severity: \"error\",\n messages: {\n default: \"Scalar must extend other scalars.\",\n },\n },\n \"extend-model\": {\n severity: \"error\",\n messages: {\n default: \"Models must extend other models.\",\n modelExpression: \"Models cannot extend model expressions.\",\n },\n },\n \"is-model\": {\n severity: \"error\",\n messages: {\n default: \"Model `is` must specify another model.\",\n modelExpression: \"Model `is` cannot specify a model expression.\",\n },\n },\n \"is-operation\": {\n severity: \"error\",\n messages: {\n default: \"Operation can only reuse the signature of another operation.\",\n },\n },\n \"spread-model\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread properties of non-model type.\",\n neverIndex: \"Cannot spread type because it cannot hold properties.\",\n selfSpread: \"Cannot spread type within its own declaration.\",\n },\n },\n\n \"unsupported-default\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Default must be have a value type but has type '${\"type\"}'.`,\n },\n },\n \"spread-object\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread properties of non-object type.\",\n },\n },\n \"expect-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`${\"name\"} refers to a type, but is being used as a value here.`,\n model: paramMessage`${\"name\"} refers to a model type, but is being used as a value here. Use #{} to create an object value.`,\n modelExpression: `Is a model expression type, but is being used as a value here. Use #{} to create an object value.`,\n tuple: `Is a tuple type, but is being used as a value here. Use #[] to create an array value.`,\n templateConstraint: paramMessage`${\"name\"} template parameter can be a type but is being used as a value here.`,\n },\n },\n \"non-callable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type ${\"type\"} is not is not callable.`,\n },\n },\n \"named-init-required\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Only scalar deriving from 'string', 'numeric' or 'boolean' can be instantited without a named constructor.`,\n },\n },\n \"invalid-primitive-init\": {\n severity: \"error\",\n messages: {\n default: `Instantiating scalar deriving from 'string', 'numeric' or 'boolean' can only take a single argument.`,\n invalidArg: paramMessage`Expected a single argument of type ${\"expected\"} but got ${\"actual\"}.`,\n },\n },\n \"ambiguous-scalar-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Value ${\"value\"} type is ambiguous between ${\"types\"}. To resolve be explicit when instantiating this value(e.g. '${\"example\"}(${\"value\"})').`,\n },\n },\n unassignable: {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"sourceType\"}' is not assignable to type '${\"targetType\"}'`,\n },\n },\n \"property-unassignable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Types of property '${\"propName\"}' are incompatible`,\n },\n },\n \"property-required\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' is required in type '${\"targetType\"}' but here is optional.`,\n },\n },\n \"value-in-type\": {\n severity: \"error\",\n messages: {\n default: \"A value cannot be used as a type.\",\n referenceTemplate: \"Template parameter can be passed values but is used as a type.\",\n noTemplateConstraint:\n \"Template parameter has no constraint but a value is passed. Add `extends valueof unknown` to accept any value.\",\n },\n },\n \"no-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' cannot be defined because model cannot hold properties.`,\n },\n },\n \"missing-index\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Index signature for type '${\"indexType\"}' is missing in type '${\"sourceType\"}'.`,\n },\n },\n \"missing-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propertyName\"}' is missing on type '${\"sourceType\"}' but required in '${\"targetType\"}'`,\n },\n },\n \"unexpected-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Object value may only specify known properties, and '${\"propertyName\"}' does not exist in type '${\"type\"}'.`,\n },\n },\n \"extends-interface\": {\n severity: \"error\",\n messages: {\n default: \"Interfaces can only extend other interfaces\",\n },\n },\n \"extends-interface-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Interface extends cannot have duplicate members. The duplicate member is named ${\"name\"}`,\n },\n },\n \"interface-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Interface already has a member named ${\"name\"}`,\n },\n },\n \"union-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Union already has a variant named ${\"name\"}`,\n },\n },\n \"enum-member-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Enum already has a member named ${\"name\"}`,\n },\n },\n \"constructor-duplicate\": {\n severity: \"error\",\n messages: {\n default: paramMessage`A constructor already exists with name ${\"name\"}`,\n },\n },\n \"spread-enum\": {\n severity: \"error\",\n messages: {\n default: \"Cannot spread members of non-enum type.\",\n },\n },\n \"decorator-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Decorator ${\"decoratorName\"} failed!\\n\\n${\"error\"}`,\n },\n },\n \"rest-parameter-array\": {\n severity: \"error\",\n messages: {\n default: \"A rest parameter must be of an array type.\",\n },\n },\n \"decorator-extern\": {\n severity: \"error\",\n messages: {\n default: \"A decorator declaration must be prefixed with the 'extern' modifier.\",\n },\n },\n \"function-extern\": {\n severity: \"error\",\n messages: {\n default: \"A function declaration must be prefixed with the 'extern' modifier.\",\n },\n },\n \"function-unsupported\": {\n severity: \"error\",\n messages: {\n default: \"Function are currently not supported.\",\n },\n },\n \"missing-implementation\": {\n severity: \"error\",\n messages: {\n default: \"Extern declaration must have an implementation in JS file.\",\n },\n },\n \"overload-same-parent\": {\n severity: \"error\",\n messages: {\n default: `Overload must be in the same interface or namespace.`,\n },\n },\n shadow: {\n severity: \"warning\",\n messages: {\n default: paramMessage`Shadowing parent template parameter with the same name \"${\"name\"}\"`,\n },\n },\n \"invalid-deprecation-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`#deprecation directive is expecting a string literal as the message but got a \"${\"kind\"}\"`,\n missing: \"#deprecation directive is expecting a message argument but none was provided.\",\n },\n },\n \"duplicate-deprecation\": {\n severity: \"warning\",\n messages: {\n default: \"The #deprecated directive cannot be used more than once on the same declaration.\",\n },\n },\n\n /**\n * Configuration\n */\n \"config-invalid-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Argument \"${\"name\"}\" is not defined as a parameter in the config.`,\n },\n },\n \"config-circular-variable\": {\n severity: \"error\",\n messages: {\n default: paramMessage`There is a circular reference to variable \"${\"name\"}\" in the cli configuration or arguments.`,\n },\n },\n \"config-path-absolute\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Path \"${\"path\"}\" cannot be relative. Use {cwd} or {project-root} to specify what the path should be relative to.`,\n },\n },\n \"config-invalid-name\": {\n severity: \"error\",\n messages: {\n default: paramMessage`The configuration name \"${\"name\"}\" is invalid because it contains a dot (\".\"). Using a dot will conflict with using nested configuration values.`,\n },\n },\n \"path-unix-style\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Path should use unix style separators. Use \"/\" instead of \"\\\\\".`,\n },\n },\n \"config-path-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`No configuration file found at config path \"${\"path\"}\".`,\n },\n },\n /**\n * Program\n */\n \"dynamic-import\": {\n severity: \"error\",\n messages: {\n default: \"Dynamically generated TypeSpec cannot have imports\",\n },\n },\n \"invalid-import\": {\n severity: \"error\",\n messages: {\n default: \"Import paths must reference either a directory, a .tsp file, or .js file\",\n },\n },\n \"invalid-main\": {\n severity: \"error\",\n messages: {\n default: \"Main file must either be a .tsp file or a .js file.\",\n },\n },\n \"import-not-found\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Couldn't resolve import \"${\"path\"}\"`,\n },\n },\n \"library-invalid\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Library \"${\"path\"}\" is invalid: ${\"message\"}`,\n },\n },\n \"incompatible-library\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Multiple versions of \"${\"name\"}\" library were loaded:\\n${\"versionMap\"}`,\n },\n },\n \"compiler-version-mismatch\": {\n severity: \"warning\",\n messages: {\n default: paramMessage`Current TypeSpec compiler conflicts with local version of @typespec/compiler referenced in ${\"basedir\"}. \\nIf this warning occurs on the command line, try running \\`typespec\\` with a working directory of ${\"basedir\"}. \\nIf this warning occurs in the IDE, try configuring the \\`tsp-server\\` path to ${\"betterTypeSpecServerPath\"}.\\n Expected: ${\"expected\"}\\n Resolved: ${\"actual\"}`,\n },\n },\n \"duplicate-symbol\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Duplicate name: \"${\"name\"}\"`,\n },\n },\n \"decorator-decl-target\": {\n severity: \"error\",\n messages: {\n default: \"dec must have at least one parameter.\",\n required: \"dec first parameter must be required.\",\n },\n },\n \"mixed-string-template\": {\n severity: \"error\",\n messages: {\n default:\n \"String template is interpolating values and types. It must be either all values to produce a string value or or all types for string template type.\",\n },\n },\n \"non-literal-string-template\": {\n severity: \"error\",\n messages: {\n default:\n \"Value interpolated in this string template cannot be converted to a string. Only literal types can be automatically interpolated.\",\n },\n },\n\n /**\n * Binder\n */\n \"ambiguous-symbol\": {\n severity: \"error\",\n messages: {\n default: paramMessage`\"${\"name\"}\" is an ambiguous name between ${\"duplicateNames\"}. Try using fully qualified name instead: ${\"duplicateNames\"}`,\n },\n },\n \"duplicate-using\": {\n severity: \"error\",\n messages: {\n default: paramMessage`duplicate using of \"${\"usingName\"}\" namespace`,\n },\n },\n\n /**\n * Library\n */\n \"on-validate-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`onValidate failed with errors. ${\"error\"}`,\n },\n },\n \"invalid-emitter\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Requested emitter package ${\"emitterPackage\"} does not provide an \"$onEmit\" function.`,\n },\n },\n \"js-error\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Failed to load ${\"specifier\"} due to the following JS error: ${\"error\"}`,\n },\n },\n \"missing-import\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Emitter '${\"emitterName\"}' requires '${\"requiredImport\"}' to be imported. Add 'import \"${\"requiredImport\"}\".`,\n },\n },\n\n /**\n * Linter\n */\n \"invalid-rule-ref\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Reference \"${\"ref\"}\" is not a valid reference to a rule or ruleset. It must be in the following format: \"<library-name>:<rule-name>\"`,\n },\n },\n \"unknown-rule\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule \"${\"ruleName\"}\" is not found in library \"${\"libraryName\"}\"`,\n },\n },\n \"unknown-rule-set\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule set \"${\"ruleSetName\"}\" is not found in library \"${\"libraryName\"}\"`,\n },\n },\n \"rule-enabled-disabled\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Rule \"${\"ruleName\"}\" has been enabled and disabled in the same ruleset.`,\n },\n },\n\n /**\n * Formatter\n */\n \"format-failed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`File '${\"file\"}' failed to format. ${\"details\"}`,\n },\n },\n\n /**\n * Decorator\n */\n \"invalid-pattern-regex\": {\n severity: \"warning\",\n messages: {\n default: \"@pattern decorator expects a valid regular expression pattern.\",\n },\n },\n\n \"decorator-wrong-target\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot apply ${\"decorator\"} decorator to ${\"to\"}`,\n withExpected: paramMessage`Cannot apply ${\"decorator\"} decorator to ${\"to\"} since it is not assignable to ${\"expected\"}`,\n },\n },\n \"invalid-argument\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Argument of type '${\"value\"}' is not assignable to parameter of type '${\"expected\"}'`,\n },\n },\n \"invalid-argument-count\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Expected ${\"expected\"} arguments, but got ${\"actual\"}.`,\n atLeast: paramMessage`Expected at least ${\"expected\"} arguments, but got ${\"actual\"}.`,\n },\n },\n \"known-values-invalid-enum\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Enum cannot be used on this type. Member ${\"member\"} is not assignable to type ${\"type\"}.`,\n },\n },\n \"invalid-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"kind\"}' is not a value type.`,\n atPath: paramMessage`Type '${\"kind\"}' of '${\"path\"}' is not a value type.`,\n },\n },\n deprecated: {\n severity: \"warning\",\n messages: {\n default: paramMessage`Deprecated: ${\"message\"}`,\n },\n },\n \"no-optional-key\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propertyName\"}' marked as key cannot be optional.`,\n },\n },\n \"invalid-discriminated-union\": {\n severity: \"error\",\n messages: {\n default: \"\",\n noAnonVariants: \"Unions with anonymous variants cannot be discriminated\",\n },\n },\n \"invalid-discriminated-union-variant\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Union variant \"${\"name\"}\" must be a model type.`,\n noEnvelopeModel: paramMessage`Union variant \"${\"name\"}\" must be a model type when the union has envelope: none.`,\n discriminantMismatch: paramMessage`Variant \"${\"name\"}\" explicitly defines the discriminator property \"${\"discriminant\"}\" but the value \"${\"propertyValue\"}\" do not match the variant name \"${\"variantName\"}\".`,\n duplicateDefaultVariant: `Discriminated union only allow a single default variant(Without a variant name).`,\n noDiscriminant: paramMessage`Variant \"${\"name\"}\" type is missing the discriminant property \"${\"discriminant\"}\".`,\n wrongDiscriminantType: paramMessage`Variant \"${\"name\"}\" type's discriminant property \"${\"discriminant\"}\" must be a string literal or string enum member.`,\n },\n },\n \"missing-discriminator-property\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Each derived model of a discriminated model type should have set the discriminator property(\"${\"discriminator\"}\") or have a derived model which has. Add \\`${\"discriminator\"}: \"<discriminator-value>\"\\``,\n },\n },\n \"invalid-discriminator-value\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Discriminator value should be a string, union of string or string enum but was ${\"kind\"}.`,\n required: \"The discriminator property must be a required property.\",\n duplicate: paramMessage`Discriminator value \"${\"discriminator\"}\" is already used in another variant.`,\n },\n },\n\n \"invalid-encode\": {\n severity: \"error\",\n messages: {\n default: \"Invalid encoding\",\n wrongType: paramMessage`Encoding '${\"encoding\"}' cannot be used on type '${\"type\"}'. Expected: ${\"expected\"}.`,\n wrongEncodingType: paramMessage`Encoding '${\"encoding\"}' on type '${\"type\"}' is expected to be serialized as '${\"expected\"}' but got '${\"actual\"}'.`,\n wrongNumericEncodingType: paramMessage`Encoding '${\"encoding\"}' on type '${\"type\"}' is expected to be serialized as '${\"expected\"}' but got '${\"actual\"}'. Set '@encode' 2nd parameter to be of type ${\"expected\"}. e.g. '@encode(\"${\"encoding\"}\", int32)'`,\n firstArg: `First argument of \"@encode\" must be the encoding name or the string type when encoding numeric types.`,\n },\n },\n\n \"invalid-mime-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Invalid mime type '${\"mimeType\"}'`,\n },\n },\n \"no-mime-type-suffix\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Cannot use mime type '${\"mimeType\"}' with suffix '${\"suffix\"}'. Use a simple mime \\`type/subtype\\` instead.`,\n },\n },\n \"encoded-name-conflict\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Encoded name '${\"name\"}' conflicts with existing member name for mime type '${\"mimeType\"}'`,\n duplicate: paramMessage`Same encoded name '${\"name\"}' is used for 2 members '${\"mimeType\"}'`,\n },\n },\n\n \"incompatible-paging-props\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paging property has multiple types: '${\"kinds\"}'`,\n },\n },\n \"invalid-paging-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paging property '${\"kind\"}' is not valid in this context.`,\n input: paramMessage`Paging property '${\"kind\"}' cannot be used in the parameters of an operation.`,\n output: paramMessage`Paging property '${\"kind\"}' cannot be used in the return type of an operation.`,\n },\n },\n \"duplicate-paging-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Duplicate property paging '${\"kind\"}' for operation ${\"operationName\"}.`,\n },\n },\n \"missing-paging-items\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Paged operation '${\"operationName\"}' return type must have a property annotated with @pageItems.`,\n },\n },\n /**\n * Service\n */\n \"service-decorator-duplicate\": {\n severity: \"error\",\n messages: {\n default: `@service can only be set once per TypeSpec document.`,\n },\n },\n \"list-type-not-model\": {\n severity: \"error\",\n messages: {\n default: \"@list decorator's parameter must be a model type.\",\n },\n },\n \"invalid-range\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Range \"${\"start\"}..${\"end\"}\" is invalid.`,\n },\n },\n\n /**\n * Mutator\n */\n \"add-response\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a response to anything except an operation statement.\",\n },\n },\n \"add-parameter\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a parameter to anything except an operation statement.\",\n },\n },\n \"add-model-property\": {\n severity: \"error\",\n messages: {\n default: \"Cannot add a model property to anything except a model statement.\",\n },\n },\n \"add-model-property-fail\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Could not add property/parameter \"${\"propertyName\"}\" of type \"${\"propertyTypeName\"}\"`,\n },\n },\n \"add-response-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Could not add response type \"${\"responseTypeName\"}\" to operation ${\"operationName\"}\"`,\n },\n },\n \"circular-base-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type '${\"typeName\"}' recursively references itself as a base type.`,\n },\n },\n \"circular-constraint\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Type parameter '${\"typeName\"}' has a circular constraint.`,\n },\n },\n \"circular-op-signature\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Operation '${\"typeName\"}' recursively references itself.`,\n },\n },\n \"circular-alias-type\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Alias type '${\"typeName\"}' recursively references itself.`,\n },\n },\n \"circular-const\": {\n severity: \"error\",\n messages: {\n default: paramMessage`const '${\"name\"}' recursively references itself.`,\n },\n },\n \"circular-prop\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Property '${\"propName\"}' recursively references itself.`,\n },\n },\n \"conflict-marker\": {\n severity: \"error\",\n messages: {\n default: \"Conflict marker encountered.\",\n },\n },\n\n // #region Visibility\n \"visibility-sealed\": {\n severity: \"error\",\n messages: {\n default: paramMessage`Visibility of property '${\"propName\"}' is sealed and cannot be changed.`,\n },\n },\n \"default-visibility-not-member\": {\n severity: \"error\",\n messages: {\n default: \"The default visibility modifiers of a class must be members of the class enum.\",\n },\n },\n \"operation-visibility-constraint-empty\": {\n severity: \"error\",\n messages: {\n default: \"Operation visibility constraints with no arguments are not allowed.\",\n returnType: \"Return type visibility constraints with no arguments are not allowed.\",\n parameter:\n \"Parameter visibility constraints with no arguments are not allowed. To disable effective PATCH optionality, use @patch(#{ implicitOptionality: false }) instead.\",\n },\n },\n // #endregion\n\n // #region CLI\n \"no-compatible-vs-installed\": {\n severity: \"error\",\n messages: {\n default: \"No compatible version of Visual Studio found.\",\n },\n },\n \"vs-extension-windows-only\": {\n severity: \"error\",\n messages: {\n default: \"Visual Studio extension is not supported on non-Windows.\",\n },\n },\n \"vscode-in-path\": {\n severity: \"error\",\n messages: {\n default:\n \"Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.\",\n osx: \"Couldn't find VS Code 'code' command in PATH. Make sure you have the VS Code executable added to the system PATH.\\nSee instruction for Mac OS here https://code.visualstudio.com/docs/setup/mac\",\n },\n },\n \"invalid-option-flag\": {\n severity: \"error\",\n messages: {\n default: paramMessage`The --option parameter value \"${\"value\"}\" must be in the format: <emitterName>.some-options=value`,\n },\n },\n // #endregion CLI\n} as const;\n\nexport type CompilerDiagnostics = TypeOfDiagnostics<typeof diagnostics>;\nexport const { createDiagnostic, reportDiagnostic } = createDiagnosticCreator(diagnostics);\n", "import { CharCode } from \"./charcode.js\";\nimport { getAnyExtensionFromPath } from \"./path-utils.js\";\nimport type { SourceFile, SourceFileKind } from \"./types.js\";\n\nexport function createSourceFile(text: string, path: string): SourceFile {\n let lineStarts: number[] | undefined = undefined;\n\n return {\n text,\n path,\n getLineStarts,\n getLineAndCharacterOfPosition,\n };\n\n function getLineStarts() {\n return (lineStarts = lineStarts ?? scanLineStarts(text));\n }\n\n function getLineAndCharacterOfPosition(position: number) {\n const starts = getLineStarts();\n\n let line = binarySearch(starts, position);\n\n // When binarySearch returns < 0 indicating that the value was not found, it\n // returns the bitwise complement of the index where the value would need to\n // be inserted to keep the array sorted. So flipping the bits back to this\n // positive index tells us what the line number would be if we were to\n // create a new line starting at the given position, and subtracting 1 from\n // that therefore gives us the line number we're after.\n if (line < 0) {\n line = ~line - 1;\n }\n\n return {\n line,\n character: position - starts[line],\n };\n }\n}\n\nexport function getSourceFileKindFromExt(path: string): SourceFileKind | undefined {\n const ext = getAnyExtensionFromPath(path);\n if (ext === \".js\" || ext === \".mjs\") {\n return \"js\";\n } else if (ext === \".tsp\") {\n return \"typespec\";\n } else {\n return undefined;\n }\n}\n\nfunction scanLineStarts(text: string): number[] {\n const starts = [];\n let start = 0;\n let pos = 0;\n\n while (pos < text.length) {\n const ch = text.charCodeAt(pos);\n pos++;\n switch (ch) {\n case CharCode.CarriageReturn:\n if (text.charCodeAt(pos) === CharCode.LineFeed) {\n pos++;\n }\n // fallthrough\n case CharCode.LineFeed:\n starts.push(start);\n start = pos;\n break;\n }\n }\n\n starts.push(start);\n return starts;\n}\n\n/**\n * Search sorted array of numbers for the given value. If found, return index\n * in array where value was found. If not found, return a negative number that\n * is the bitwise complement of the index where value would need to be inserted\n * to keep the array sorted.\n */\nfunction binarySearch(array: readonly number[], value: number) {\n let low = 0;\n let high = array.length - 1;\n while (low <= high) {\n const middle = low + ((high - low) >> 1);\n const v = array[middle];\n if (v < value) {\n low = middle + 1;\n } else if (v > value) {\n high = middle - 1;\n } else {\n return middle;\n }\n }\n\n return ~low;\n}\n", "import type { JSONSchemaType as AjvJSONSchemaType } from \"ajv\";\nimport type { ModuleResolutionResult } from \"../module-resolver/index.js\";\nimport type { YamlPathTarget, YamlScript } from \"../yaml/types.js\";\nimport type { Numeric } from \"./numeric.js\";\nimport type { Program } from \"./program.js\";\nimport type { TokenFlags } from \"./scanner.js\";\n\n// prettier-ignore\nexport type MarshalledValue<Value> = \nValue extends StringValue ? string\n : Value extends NumericValue ? number | Numeric\n : Value extends BooleanValue ? boolean\n : Value extends ObjectValue ? Record<string, unknown>\n : Value extends ArrayValue ? unknown[]\n : Value extends EnumValue ? EnumMember\n : Value extends NullValue ? null\n : Value extends ScalarValue ? Value\n : Value\n\n/**\n * Type System types\n */\n\nexport type DecoratorArgumentValue = Type | number | string | boolean;\n\nexport interface DecoratorArgument {\n value: Type | Value;\n /**\n * Marshalled value for use in Javascript.\n */\n jsValue:\n | Type\n | Value\n | Record<string, unknown>\n | unknown[]\n | string\n | number\n | boolean\n | Numeric\n | null;\n node?: Node;\n}\n\nexport interface DecoratorApplication {\n definition?: Decorator;\n decorator: DecoratorFunction;\n args: DecoratorArgument[];\n node?: DecoratorExpressionNode | AugmentDecoratorStatementNode;\n}\n\n/**\n * Signature for a decorator JS implementation function.\n * Use `@typespec/tspd` to generate an accurate signature from the `extern dec`\n */\nexport interface DecoratorFunction {\n (\n program: DecoratorContext,\n target: any,\n ...customArgs: any[]\n ): DecoratorValidatorCallbacks | void;\n namespace?: string;\n}\n\nexport type ValidatorFn = () => readonly Diagnostic[];\n\nexport interface DecoratorValidatorCallbacks {\n /**\n * Run validation after all decorators are run on the same type. Useful if trying to validate this decorator is compatible with other decorators without relying on the order they are applied.\n * @note This is meant for validation which means the type graph should be treated as readonly in this function.\n */\n readonly onTargetFinish?: ValidatorFn;\n\n /**\n * Run validation after everything is checked in the type graph. Useful when trying to get an overall view of the program.\n * @note This is meant for validation which means the type graph should be treated as readonly in this function.\n */\n readonly onGraphFinish?: ValidatorFn;\n}\n\nexport interface BaseType {\n readonly entityKind: \"Type\";\n kind: string;\n /** Node used to construct this type. If the node is undefined it means the type was dynamically built. With typekit for example. */\n node?: Node;\n instantiationParameters?: Type[];\n\n /**\n * If the type is currently being created.\n */\n creating?: true;\n\n /**\n * Reflect if a type has been finished(Decorators have been called).\n * There is multiple reasons a type might not be finished:\n * - a template declaration will not\n * - a template instance that argument that are still template parameters\n * - a template instance that is only partially instantiated(like a templated operation inside a templated interface)\n */\n isFinished: boolean;\n}\n\nexport interface DecoratedType {\n decorators: DecoratorApplication[];\n}\n\n/**\n * Union of all the types that implement TemplatedTypeBase\n */\nexport type TemplatedType = Model | Operation | Interface | Union | Scalar;\n\nexport interface TypeMapper {\n partial: boolean;\n getMappedType(type: TemplateParameter): Type | Value | IndeterminateEntity;\n args: readonly (Type | Value | IndeterminateEntity)[];\n /** @internal Node used to create this type mapper. */\n readonly source: {\n readonly node: Node;\n readonly mapper: TypeMapper | undefined;\n };\n /** @internal */\n map: Map<TemplateParameter, Type | Value | IndeterminateEntity>;\n}\n\nexport interface TemplatedTypeBase {\n templateMapper?: TypeMapper;\n templateNode?: Node;\n}\n\n/**\n * Represent every single entity that are part of the TypeSpec program. Those are composed of different elements:\n * - Types\n * - Values\n * - Value Constraints\n */\nexport type Entity = Type | Value | MixedParameterConstraint | IndeterminateEntity;\n\nexport type Type =\n | BooleanLiteral\n | Decorator\n | Enum\n | EnumMember\n | FunctionParameter\n | Interface\n | IntrinsicType\n | Model\n | ModelProperty\n | Namespace\n | NumericLiteral\n | Operation\n | Scalar\n | ScalarConstructor\n | StringLiteral\n | StringTemplate\n | StringTemplateSpan\n | TemplateParameter\n | Tuple\n | Union\n | UnionVariant;\n\nexport type StdTypes = {\n // Models\n Array: Model;\n Record: Model;\n} & Record<IntrinsicScalarName, Scalar>;\nexport type StdTypeName = keyof StdTypes;\n\nexport interface ObjectType extends BaseType {\n kind: \"Object\";\n properties: Record<string, Type>;\n}\n\nexport interface MixedParameterConstraint {\n readonly entityKind: \"MixedParameterConstraint\";\n readonly node?: UnionExpressionNode | Expression;\n\n /** Type constraints */\n readonly type?: Type;\n\n /** Expecting value */\n readonly valueType?: Type;\n}\n\n/** When an entity that could be used as a type or value has not figured out if it is a value or type yet. */\nexport interface IndeterminateEntity {\n readonly entityKind: \"Indeterminate\";\n readonly type:\n | StringLiteral\n | StringTemplate\n | NumericLiteral\n | BooleanLiteral\n | EnumMember\n | UnionVariant\n | NullType;\n}\n\nexport interface IntrinsicType extends BaseType {\n kind: \"Intrinsic\";\n name: \"ErrorType\" | \"void\" | \"never\" | \"unknown\" | \"null\";\n}\n\nexport interface ErrorType extends IntrinsicType {\n name: \"ErrorType\";\n}\n\nexport interface VoidType extends IntrinsicType {\n name: \"void\";\n}\n\nexport interface NeverType extends IntrinsicType {\n name: \"never\";\n}\n\nexport interface UnknownType extends IntrinsicType {\n name: \"unknown\";\n}\nexport interface NullType extends IntrinsicType {\n name: \"null\";\n}\n\nexport type IntrinsicScalarName =\n | \"bytes\"\n | \"numeric\"\n | \"integer\"\n | \"float\"\n | \"int64\"\n | \"int32\"\n | \"int16\"\n | \"int8\"\n | \"uint64\"\n | \"uint32\"\n | \"uint16\"\n | \"uint8\"\n | \"safeint\"\n | \"float32\"\n | \"float64\"\n | \"decimal\"\n | \"decimal128\"\n | \"string\"\n | \"plainDate\"\n | \"plainTime\"\n | \"utcDateTime\"\n | \"offsetDateTime\"\n | \"duration\"\n | \"boolean\"\n | \"url\";\n\nexport type NeverIndexer = {\n readonly key: NeverType;\n readonly value: undefined;\n};\n\nexport type ModelIndexer = {\n readonly key: Scalar;\n readonly value: Type;\n};\n\nexport interface ArrayModelType extends Model {\n indexer: { key: Scalar; value: Type };\n}\n\nexport interface RecordModelType extends Model {\n indexer: { key: Scalar; value: Type };\n}\n\nexport interface Model extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Model\";\n name: string;\n node?: ModelStatementNode | ModelExpressionNode | IntersectionExpressionNode | ObjectLiteralNode;\n namespace?: Namespace;\n indexer?: ModelIndexer;\n\n /**\n * The properties of the model.\n *\n * Properties are ordered in the order that they appear in source.\n * Properties obtained via `model is` appear before properties defined in\n * the model body. Properties obtained via `...` are inserted where the\n * spread appears in source.\n *\n * Properties inherited via `model extends` are not included. Use\n * {@link walkPropertiesInherited} to enumerate all properties in the\n * inheritance hierarchy.\n */\n properties: RekeyableMap<string, ModelProperty>;\n\n /**\n * Model this model extends. This represent inheritance.\n */\n baseModel?: Model;\n\n /**\n * Direct children. This is the reverse relation of {@link baseModel}\n */\n derivedModels: Model[];\n\n /**\n * The model that is referenced via `model is`.\n */\n sourceModel?: Model;\n\n /**\n * Models that were used to build this model. This include any model referenced in `model is`, `...` or when intersecting models.\n */\n sourceModels: SourceModel[];\n\n /**\n * Late-bound symbol of this model type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface SourceModel {\n /**\n * How was this model used.\n * - is: `model A is B`\n * - spread: `model A {...B}`\n * - intersection: `alias A = B & C`\n */\n readonly usage: \"is\" | \"spread\" | \"intersection\";\n /** Source model */\n readonly model: Model;\n\n /** Node where this source model was referenced. */\n readonly node?: Node;\n}\n\nexport interface ModelProperty extends BaseType, DecoratedType {\n kind: \"ModelProperty\";\n node?: ModelPropertyNode | ModelSpreadPropertyNode | ObjectLiteralPropertyNode;\n name: string;\n type: Type;\n // when spread or intersection operators make new property types,\n // this tracks the property we copied from.\n sourceProperty?: ModelProperty;\n optional: boolean;\n defaultValue?: Value;\n model?: Model;\n}\n\n//#region Values\nexport type Value =\n | ScalarValue\n | NumericValue\n | StringValue\n | BooleanValue\n | ObjectValue\n | ArrayValue\n | EnumValue\n | NullValue;\n\n/** @internal */\nexport type ValueWithTemplate = Value | TemplateValue;\n\ninterface BaseValue {\n readonly entityKind: \"Value\";\n readonly valueKind: string;\n /**\n * Represent the storage type of a value.\n * @example\n * ```tsp\n * const a = \"hello\"; // Type here would be \"hello\"\n * const b: string = a; // Type here would be string\n * const c: string | int32 = b; // Type here would be string | int32\n * ```\n */\n type: Type;\n}\n\nexport interface ObjectValue extends BaseValue {\n valueKind: \"ObjectValue\";\n node?: ObjectLiteralNode;\n properties: Map<string, ObjectValuePropertyDescriptor>;\n}\n\nexport interface ObjectValuePropertyDescriptor {\n node?: ObjectLiteralPropertyNode;\n name: string;\n value: Value;\n}\n\nexport interface ArrayValue extends BaseValue {\n valueKind: \"ArrayValue\";\n node?: ArrayLiteralNode;\n values: Value[];\n}\n\nexport interface ScalarValue extends BaseValue {\n valueKind: \"ScalarValue\";\n scalar: Scalar;\n value: { name: string; args: Value[] };\n}\n\nexport interface NumericValue extends BaseValue {\n valueKind: \"NumericValue\";\n scalar: Scalar | undefined;\n value: Numeric;\n}\nexport interface StringValue extends BaseValue {\n valueKind: \"StringValue\";\n scalar: Scalar | undefined;\n value: string;\n}\nexport interface BooleanValue extends BaseValue {\n valueKind: \"BooleanValue\";\n scalar: Scalar | undefined;\n value: boolean;\n}\nexport interface EnumValue extends BaseValue {\n valueKind: \"EnumValue\";\n value: EnumMember;\n}\nexport interface NullValue extends BaseValue {\n valueKind: \"NullValue\";\n value: null;\n}\n\n/**\n * This is an internal type that represent a value while in a template declaration.\n * This type should currently never be exposed on the type graph(unlike TemplateParameter).\n * @internal\n */\nexport interface TemplateValue extends BaseValue {\n valueKind: \"TemplateValue\";\n}\n\n//#endregion Values\n\nexport interface Scalar extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Scalar\";\n name: string;\n node?: ScalarStatementNode;\n /**\n * Namespace the scalar was defined in.\n */\n namespace?: Namespace;\n\n /**\n * Scalar this scalar extends.\n */\n baseScalar?: Scalar;\n\n /**\n * Direct children. This is the reverse relation of @see baseScalar\n */\n derivedScalars: Scalar[];\n\n constructors: Map<string, ScalarConstructor>;\n /**\n * Late-bound symbol of this scalar type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface ScalarConstructor extends BaseType {\n kind: \"ScalarConstructor\";\n node?: ScalarConstructorNode;\n name: string;\n scalar: Scalar;\n parameters: SignatureFunctionParameter[];\n}\n\nexport interface Interface extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Interface\";\n name: string;\n node?: InterfaceStatementNode;\n namespace?: Namespace;\n\n /**\n * The interfaces that provide additional operations via `interface extends`.\n *\n * Note that despite the same `extends` keyword in source form, this is a\n * different semantic relationship than the one from {@link Model} to\n * {@link Model.baseModel}. Operations from extended interfaces are copied\n * into {@link Interface.operations}.\n */\n sourceInterfaces: Interface[];\n\n /**\n * The operations of the interface.\n *\n * Operations are ordered in the order that they appear in the source.\n * Operations obtained via `interface extends` appear before operations\n * declared in the interface body.\n */\n operations: RekeyableMap<string, Operation>;\n\n /**\n * Late-bound symbol of this interface type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface Enum extends BaseType, DecoratedType {\n kind: \"Enum\";\n name: string;\n node?: EnumStatementNode;\n namespace?: Namespace;\n\n /**\n * The members of the enum.\n *\n * Members are ordered in the order that they appear in source. Members\n * obtained via `...` are inserted where the spread appears in source.\n */\n members: RekeyableMap<string, EnumMember>;\n\n /**\n * Late-bound symbol of this enum type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface EnumMember extends BaseType, DecoratedType {\n kind: \"EnumMember\";\n name: string;\n enum: Enum;\n node?: EnumMemberNode;\n value?: string | number;\n /**\n * when spread operators make new enum members,\n * this tracks the enum member we copied from.\n */\n sourceMember?: EnumMember;\n}\n\nexport interface Operation extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Operation\";\n node?: OperationStatementNode;\n name: string;\n namespace?: Namespace;\n interface?: Interface;\n parameters: Model;\n returnType: Type;\n\n /**\n * The operation that is referenced via `op is`.\n */\n sourceOperation?: Operation;\n}\n\nexport interface Namespace extends BaseType, DecoratedType {\n kind: \"Namespace\";\n name: string;\n namespace?: Namespace;\n node?: NamespaceStatementNode | JsNamespaceDeclarationNode;\n\n /**\n * The models in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n models: Map<string, Model>;\n\n /**\n * The scalars in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n scalars: Map<string, Scalar>;\n\n /**\n * The operations in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n operations: Map<string, Operation>;\n\n /**\n * The sub-namespaces in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n namespaces: Map<string, Namespace>;\n\n /**\n * The interfaces in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n interfaces: Map<string, Interface>;\n\n /**\n * The enums in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n enums: Map<string, Enum>;\n\n /**\n * The unions in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n unions: Map<string, Union>;\n\n /**\n * The decorators declared in the namespace.\n *\n * Order is implementation-defined and may change.\n */\n decoratorDeclarations: Map<string, Decorator>;\n}\n\nexport type LiteralType = StringLiteral | NumericLiteral | BooleanLiteral;\n\nexport interface StringLiteral extends BaseType {\n kind: \"String\";\n node?: StringLiteralNode;\n value: string;\n}\n\nexport interface NumericLiteral extends BaseType {\n kind: \"Number\";\n node?: NumericLiteralNode;\n value: number;\n numericValue: Numeric;\n valueAsString: string;\n}\n\nexport interface BooleanLiteral extends BaseType {\n kind: \"Boolean\";\n node?: BooleanLiteralNode;\n value: boolean;\n}\n\nexport interface StringTemplate extends BaseType {\n kind: \"StringTemplate\";\n /** If the template can be render as as string this is the string value */\n stringValue?: string;\n node?: StringTemplateExpressionNode;\n spans: StringTemplateSpan[];\n}\n\nexport type StringTemplateSpan = StringTemplateSpanLiteral | StringTemplateSpanValue;\n\nexport interface StringTemplateSpanLiteral extends BaseType {\n kind: \"StringTemplateSpan\";\n node?: StringTemplateHeadNode | StringTemplateMiddleNode | StringTemplateTailNode;\n isInterpolated: false;\n type: StringLiteral;\n}\n\nexport interface StringTemplateSpanValue extends BaseType {\n kind: \"StringTemplateSpan\";\n node?: Expression;\n isInterpolated: true;\n type: Type;\n}\n\nexport interface Tuple extends BaseType {\n kind: \"Tuple\";\n node?: TupleExpressionNode | ArrayLiteralNode;\n values: Type[];\n}\n\nexport interface Union extends BaseType, DecoratedType, TemplatedTypeBase {\n kind: \"Union\";\n name?: string;\n node?: UnionExpressionNode | UnionStatementNode;\n namespace?: Namespace;\n\n /**\n * The variants of the union.\n *\n * Variants are ordered in order that they appear in source.\n */\n variants: RekeyableMap<string | symbol, UnionVariant>;\n\n expression: boolean;\n\n /**\n * Late-bound symbol of this interface type.\n * @internal\n */\n symbol?: Sym;\n}\n\nexport interface UnionVariant extends BaseType, DecoratedType {\n kind: \"UnionVariant\";\n name: string | symbol;\n node?: UnionVariantNode | undefined;\n type: Type;\n union: Union;\n}\n\n/**\n * This is a type you should never see in the program.\n * If you do you might be missing a `isTemplateDeclaration` check to exclude that type.\n * Working with template declaration is not something that is currently supported.\n *\n * @experimental\n */\nexport interface TemplateParameter extends BaseType {\n kind: \"TemplateParameter\";\n /** @internal */\n node: TemplateParameterDeclarationNode;\n /** @internal */\n constraint?: MixedParameterConstraint;\n /** @internal */\n default?: Type | Value | IndeterminateEntity;\n}\n\nexport interface Decorator extends BaseType {\n kind: \"Decorator\";\n node?: DecoratorDeclarationStatementNode;\n name: `@${string}`;\n namespace: Namespace;\n target: MixedFunctionParameter;\n parameters: MixedFunctionParameter[];\n implementation: (...args: unknown[]) => void;\n}\n\nexport interface FunctionParameterBase extends BaseType {\n kind: \"FunctionParameter\";\n node?: FunctionParameterNode;\n name: string;\n optional: boolean;\n rest: boolean;\n}\n\n/** Represent a function parameter that could accept types or values in the TypeSpec program. */\nexport interface MixedFunctionParameter extends FunctionParameterBase {\n mixed: true;\n type: MixedParameterConstraint;\n}\n/** Represent a function parameter that represent the parameter signature(i.e the type would be the type of the value passed) */\nexport interface SignatureFunctionParameter extends FunctionParameterBase {\n mixed: false;\n type: Type;\n}\nexport type FunctionParameter = MixedFunctionParameter | SignatureFunctionParameter;\n\nexport interface Sym {\n readonly flags: SymbolFlags;\n\n /**\n * Nodes which contribute to this declaration, present if SymbolFlags.Declaration is set.\n */\n readonly declarations: readonly Node[];\n\n /**\n * Node which resulted in this symbol, present if SymbolFlags.Declaration is not set.\n */\n readonly node: Node;\n\n /**\n * The name of the symbol\n */\n readonly name: string;\n\n /**\n * A unique identifier for this symbol. Used to look up the symbol links.\n */\n readonly id?: number;\n\n /**\n * The symbol containing this symbol, if any. E.g. for things declared in\n * a namespace, this refers to the namespace.\n */\n readonly parent?: Sym;\n\n /**\n * Externally visible symbols contained inside this symbol. E.g. all declarations\n * in a namespace, or members of an enum.\n */\n readonly exports?: SymbolTable;\n\n /**\n * Symbols for members of this symbol which must be referenced off the parent symbol\n * and cannot be referenced by other means (i.e. by unqualified lookup of the symbol\n * name).\n */\n readonly members?: SymbolTable;\n\n /**\n * Symbol table\n */\n readonly metatypeMembers?: SymbolTable;\n\n /**\n * For using symbols, this is the used symbol.\n */\n readonly symbolSource?: Sym;\n\n /**\n * For late-bound symbols, this is the type referenced by the symbol.\n */\n readonly type?: Type;\n\n /**\n * For decorator and function symbols, this is the JS function implementation.\n */\n readonly value?: (...args: any[]) => any;\n}\n\nexport interface SymbolLinks {\n type?: Type;\n\n /** For types that can be instanitated this is the type of the declaration */\n declaredType?: Type;\n /** For types that can be instanitated those are the types per instantiation */\n instantiations?: TypeInstantiationMap;\n\n /** For const statements the value of the const */\n value?: Value | null;\n\n /**\n * When a symbol contains unknown members, symbol lookup during\n * name resolution should always return unknown if it can't definitely\n * find a member.\n */\n hasUnknownMembers?: boolean;\n\n /**\n * True if we have completed the early binding of member symbols for this model during\n * the name resolution phase.\n */\n membersBound?: boolean;\n\n /**\n * The symbol aliased by an alias symbol. When present, guaranteed to be a\n * non-alias symbol. Will not be present when the name resolver could not\n * determine a symbol for the alias, e.g. when it is a computed type.\n */\n aliasedSymbol?: Sym;\n\n /**\n * The result of resolving the aliased reference. When resolved, aliasedSymbol\n * will contain the resolved symbol. Otherwise, aliasedSymbol may be present\n * if the alias is a type literal with a symbol, otherwise it will be\n * undefined.\n */\n aliasResolutionResult?: ResolutionResultFlags;\n\n // TODO: any better idea?\n aliasResolutionIsTemplate?: boolean;\n\n /**\n * The symbol for the constraint of a type parameter. Will not be present when\n * the name resolver could not determine a symbol for the constraint, e.g.\n * when it is a computed type.\n */\n constraintSymbol?: Sym;\n\n /**\n * The result of resolving the type parameter constraint. When resolved,\n * constraintSymbol will contain the resolved symbol. Otherwise,\n * constraintSymbol may be present if the constraint is a type literal with a\n * symbol, otherwise it will be undefined.\n */\n constraintResolutionResult?: ResolutionResultFlags;\n}\n\nexport interface ResolutionResult {\n resolutionResult: ResolutionResultFlags;\n isTemplateInstantiation?: boolean;\n resolvedSymbol: Sym | undefined;\n finalSymbol: Sym | undefined;\n ambiguousSymbols?: Sym[];\n}\n\nexport interface NodeLinks {\n /** the result of type checking this node */\n resolvedType?: Type;\n\n /**The syntax symbol resolved by this node. */\n resolvedSymbol?: Sym;\n\n /** If the resolvedSymbol is an alias point to the symbol the alias reference(recursively), otherwise is the same as resolvedSymbol */\n finalSymbol?: Sym | undefined;\n\n /**\n * If the link involve template argument.\n * Note that this only catch if template arguments are used. If referencing the default instance(e.g Foo for Foo<string = \"abc\">) this will not be set to true.\n * This is by design as the symbol reference has different meaning depending on the context:\n * - For augment decorator it would reference the template declaration\n * - For type references it would reference the default instance.\n */\n isTemplateInstantiation?: boolean;\n\n /**\n * The result of resolution of this reference node.\n *\n * When the the result is `Resolved`, `resolvedSymbol` contains the result.\n **/\n resolutionResult?: ResolutionResultFlags;\n\n /** If the resolution result is Ambiguous list of symbols that are */\n ambiguousSymbols?: Sym[];\n}\n\nexport enum ResolutionResultFlags {\n None = 0,\n Resolved = 1 << 1,\n Unknown = 1 << 2,\n Ambiguous = 1 << 3,\n NotFound = 1 << 4,\n\n ResolutionFailed = Unknown | Ambiguous | NotFound,\n}\n\n/**\n * @hidden bug in typedoc\n */\nexport interface SymbolTable extends ReadonlyMap<string, Sym> {\n /**\n * Duplicate\n */\n readonly duplicates: ReadonlyMap<Sym, ReadonlySet<Sym>>;\n}\n\nexport interface MutableSymbolTable extends SymbolTable {\n set(key: string, value: Sym): void;\n\n /**\n * Put the symbols in the source table into this table.\n * @param source table to copy\n * @param parentSym Parent symbol that the source symbol should update to.\n */\n include(source: SymbolTable, parentSym?: Sym): void;\n}\n\n// prettier-ignore\nexport const enum SymbolFlags {\n None = 0,\n Model = 1 << 1,\n Scalar = 1 << 2,\n Operation = 1 << 3,\n Enum = 1 << 4,\n Interface = 1 << 5,\n Union = 1 << 6,\n Alias = 1 << 7,\n Namespace = 1 << 8,\n Decorator = 1 << 9,\n TemplateParameter = 1 << 10,\n Function = 1 << 11,\n FunctionParameter = 1 << 12,\n Using = 1 << 13,\n DuplicateUsing = 1 << 14,\n SourceFile = 1 << 15,\n Member = 1 << 16,\n Const = 1 << 17,\n\n\n /**\n * A symbol which represents a declaration. Such symbols will have at least\n * one entry in the `declarations[]` array referring to a node with an `id`.\n * \n * Symbols which do not represent declarations \n */\n Declaration = 1 << 20,\n\n Implementation = 1 << 21,\n \n /**\n * A symbol which was late-bound, in which case, the type referred to\n * by this symbol is stored directly in the symbol.\n */\n LateBound = 1 << 22,\n\n ExportContainer = Namespace | SourceFile,\n /**\n * Symbols whose members will be late bound (and stored on the type)\n */\n MemberContainer = Model | Enum | Union | Interface | Scalar,\n}\n\n/**\n * Maps type arguments to instantiated type.\n */\nexport interface TypeInstantiationMap {\n get(args: readonly (Type | Value | IndeterminateEntity)[]): Type | undefined;\n set(args: readonly (Type | Value | IndeterminateEntity)[], type: Type): void;\n}\n\n/**\n * A map where keys can be changed without changing enumeration order.\n * @hidden bug in typedoc\n */\nexport interface RekeyableMap<K, V> extends Map<K, V> {\n /**\n * Change the given key without impacting enumeration order.\n *\n * @param existingKey Existing key\n * @param newKey New key\n * @returns boolean if updated successfully.\n */\n rekey(existingKey: K, newKey: K): boolean;\n}\n\n/**\n * AST types\n */\nexport enum SyntaxKind {\n TypeSpecScript,\n JsSourceFile,\n ImportStatement,\n Identifier,\n AugmentDecoratorStatement,\n DecoratorExpression,\n DirectiveExpression,\n MemberExpression,\n NamespaceStatement,\n UsingStatement,\n OperationStatement,\n OperationSignatureDeclaration,\n OperationSignatureReference,\n ModelStatement,\n ModelExpression,\n ModelProperty,\n ModelSpreadProperty,\n ScalarStatement,\n InterfaceStatement,\n UnionStatement,\n UnionVariant,\n EnumStatement,\n EnumMember,\n EnumSpreadMember,\n AliasStatement,\n DecoratorDeclarationStatement,\n FunctionDeclarationStatement,\n FunctionParameter,\n UnionExpression,\n IntersectionExpression,\n TupleExpression,\n ArrayExpression,\n StringLiteral,\n NumericLiteral,\n BooleanLiteral,\n StringTemplateExpression,\n StringTemplateHead,\n StringTemplateMiddle,\n StringTemplateTail,\n StringTemplateSpan,\n ExternKeyword,\n VoidKeyword,\n NeverKeyword,\n UnknownKeyword,\n ValueOfExpression,\n TypeReference,\n TemplateParameterDeclaration,\n EmptyStatement,\n InvalidStatement,\n LineComment,\n BlockComment,\n Doc,\n DocText,\n DocParamTag,\n DocPropTag,\n DocReturnsTag,\n DocErrorsTag,\n DocTemplateTag,\n DocUnknownTag,\n Return,\n JsNamespaceDeclaration,\n TemplateArgument,\n TypeOfExpression,\n ObjectLiteral,\n ObjectLiteralProperty,\n ObjectLiteralSpreadProperty,\n ArrayLiteral,\n ConstStatement,\n CallExpression,\n ScalarConstructor,\n}\n\nexport const enum NodeFlags {\n None = 0,\n /**\n * If this is set, the DescendantHasError bit can be trusted. If this not set,\n * children need to be visited still to see if DescendantHasError should be\n * set.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n DescendantErrorsExamined = 1 << 0,\n\n /**\n * Indicates that a parse error was associated with this specific node.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n ThisNodeHasError = 1 << 1,\n\n /**\n * Indicates that a child of this node (or one of its children,\n * transitively) has a parse error.\n *\n * Use the parser's `hasParseError` API instead of using this flag directly.\n */\n DescendantHasError = 1 << 2,\n\n /**\n * Indicates that a node was created synthetically and therefore may not be parented.\n */\n Synthetic = 1 << 3,\n}\n\nexport interface BaseNode extends TextRange {\n readonly kind: SyntaxKind;\n readonly parent?: Node;\n readonly directives?: readonly DirectiveExpressionNode[];\n readonly docs?: readonly DocNode[];\n readonly flags: NodeFlags;\n /**\n * Could be undefined but making this optional creates a lot of noise. In practice,\n * you will likely only access symbol in cases where you know the node has a symbol.\n * @internal\n */\n readonly symbol: Sym;\n /** Unique id across the process used to look up NodeLinks */\n _id?: number;\n}\n\nexport interface TemplateDeclarationNode {\n readonly templateParameters: readonly TemplateParameterDeclarationNode[];\n readonly templateParametersRange: TextRange;\n readonly locals?: SymbolTable;\n}\n\n/**\n * owner node and other related information according to the position\n */\nexport interface PositionDetail {\n readonly node: Node | undefined;\n readonly position: number;\n readonly char: number;\n readonly preChar: number;\n readonly nextChar: number;\n readonly inTrivia: boolean;\n\n /**\n * if the position is in a trivia, return the start position of the trivia containing the position\n * if the position is not a trivia, return the start position of the trivia before the text(identifier code) containing the position\n *\n * Please be aware that this may not be the pre node in the tree because some non-trivia char is ignored in the tree but will counted here\n *\n * also comments are considered as trivia\n */\n readonly triviaStartPosition: number;\n /**\n * if the position is in a trivia, return the end position (exclude as other 'end' means) of the trivia containing the position\n * if the position is not a trivia, return the end position (exclude as other 'end' means) of the trivia after the node containing the position\n *\n * Please be aware that this may not be the next node in the tree because some non-trivia char is ignored in the tree but will considered here\n *\n * also comments are considered as trivia\n */\n readonly triviaEndPosition: number;\n /** get the PositionDetail of positionBeforeTrivia */\n readonly getPositionDetailBeforeTrivia: () => PositionDetail;\n /** get the PositionDetail of positionAfterTrivia */\n readonly getPositionDetailAfterTrivia: () => PositionDetail;\n}\n\nexport type Node =\n | TypeSpecScriptNode\n | JsSourceFileNode\n | JsNamespaceDeclarationNode\n | TemplateArgumentNode\n | TemplateParameterDeclarationNode\n | ModelPropertyNode\n | UnionVariantNode\n | OperationStatementNode\n | OperationSignatureDeclarationNode\n | OperationSignatureReferenceNode\n | EnumMemberNode\n | EnumSpreadMemberNode\n | ModelSpreadPropertyNode\n | DecoratorExpressionNode\n | DirectiveExpressionNode\n | Statement\n | Expression\n | FunctionParameterNode\n | StringTemplateSpanNode\n | StringTemplateHeadNode\n | StringTemplateMiddleNode\n | StringTemplateTailNode\n | Modifier\n | DocNode\n | DocContent\n | DocTag\n | ReferenceExpression\n | ObjectLiteralNode\n | ObjectLiteralPropertyNode\n | ObjectLiteralSpreadPropertyNode\n | ScalarConstructorNode\n | ArrayLiteralNode;\n\n/**\n * Node that can be used as template\n */\nexport type TemplateableNode =\n | ModelStatementNode\n | ScalarStatementNode\n | AliasStatementNode\n | InterfaceStatementNode\n | OperationStatementNode\n | UnionStatementNode;\n\n/**\n * Node types that can have referencable members\n */\nexport type MemberContainerNode =\n | ModelStatementNode\n | ModelExpressionNode\n | InterfaceStatementNode\n | EnumStatementNode\n | UnionStatementNode\n | IntersectionExpressionNode\n | ScalarStatementNode;\n\nexport type MemberNode =\n | ModelPropertyNode\n | EnumMemberNode\n | OperationStatementNode\n | UnionVariantNode\n | ScalarConstructorNode;\n\nexport type MemberContainerType = Model | Enum | Interface | Union | Scalar;\n\n/**\n * Type that can be used as members of a container type.\n */\nexport type MemberType = ModelProperty | EnumMember | Operation | UnionVariant | ScalarConstructor;\n\nexport type Comment = LineComment | BlockComment;\n\nexport interface LineComment extends TextRange {\n readonly kind: SyntaxKind.LineComment;\n}\nexport interface BlockComment extends TextRange {\n readonly kind: SyntaxKind.BlockComment;\n /** If that comment was parsed as a doc comment. If parserOptions.docs=false this will always be false. */\n readonly parsedAsDocs?: boolean;\n}\n\nexport interface ParseOptions {\n /** When true, collect comment ranges in {@link TypeSpecScriptNode.comments}. */\n readonly comments?: boolean;\n /** When true, parse doc comments into {@link Node.docs}. */\n readonly docs?: boolean;\n}\n\nexport interface TypeSpecScriptNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.TypeSpecScript;\n readonly statements: readonly Statement[];\n readonly file: SourceFile;\n readonly inScopeNamespaces: readonly NamespaceStatementNode[]; // namespaces that declarations in this file belong to\n readonly namespaces: NamespaceStatementNode[]; // list of namespaces in this file (initialized during binding)\n readonly usings: readonly UsingStatementNode[];\n readonly comments: readonly Comment[];\n readonly parseDiagnostics: readonly Diagnostic[];\n readonly printable: boolean; // If this ast tree can safely be printed/formatted.\n readonly locals: SymbolTable;\n readonly parseOptions: ParseOptions; // Options used to parse this file\n}\n\nexport type Statement =\n | ImportStatementNode\n | ModelStatementNode\n | ScalarStatementNode\n | NamespaceStatementNode\n | InterfaceStatementNode\n | UnionStatementNode\n | UsingStatementNode\n | EnumStatementNode\n | AliasStatementNode\n | OperationStatementNode\n | DecoratorDeclarationStatementNode\n | FunctionDeclarationStatementNode\n | AugmentDecoratorStatementNode\n | ConstStatementNode\n | CallExpressionNode\n | EmptyStatementNode\n | InvalidStatementNode;\n\nexport interface DeclarationNode {\n readonly id: IdentifierNode;\n}\n\nexport type Declaration =\n | ModelStatementNode\n | ScalarStatementNode\n | InterfaceStatementNode\n | UnionStatementNode\n | NamespaceStatementNode\n | OperationStatementNode\n | TemplateParameterDeclarationNode\n | EnumStatementNode\n | AliasStatementNode\n | ConstStatementNode\n | DecoratorDeclarationStatementNode\n | FunctionDeclarationStatementNode;\n\nexport type ScopeNode =\n | NamespaceStatementNode\n | ModelStatementNode\n | InterfaceStatementNode\n | AliasStatementNode\n | TypeSpecScriptNode\n | JsSourceFileNode;\n\nexport interface ImportStatementNode extends BaseNode {\n readonly kind: SyntaxKind.ImportStatement;\n readonly path: StringLiteralNode;\n readonly parent?: TypeSpecScriptNode;\n}\n\nexport interface IdentifierNode extends BaseNode {\n readonly kind: SyntaxKind.Identifier;\n readonly sv: string;\n}\n\nexport interface DecoratorExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.DecoratorExpression;\n readonly target: IdentifierNode | MemberExpressionNode;\n readonly arguments: readonly Expression[];\n}\n\nexport interface AugmentDecoratorStatementNode extends BaseNode {\n readonly kind: SyntaxKind.AugmentDecoratorStatement;\n readonly target: IdentifierNode | MemberExpressionNode;\n readonly targetType: TypeReferenceNode;\n readonly arguments: readonly Expression[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface DirectiveExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.DirectiveExpression;\n readonly target: IdentifierNode;\n readonly arguments: readonly DirectiveArgument[];\n}\n\nexport type DirectiveArgument = StringLiteralNode | IdentifierNode;\n\nexport type Expression =\n | ArrayExpressionNode\n | MemberExpressionNode\n | ModelExpressionNode\n | ObjectLiteralNode\n | ArrayLiteralNode\n | TupleExpressionNode\n | UnionExpressionNode\n | IntersectionExpressionNode\n | TypeReferenceNode\n | ValueOfExpressionNode\n | TypeOfExpressionNode\n | CallExpressionNode\n | StringLiteralNode\n | NumericLiteralNode\n | BooleanLiteralNode\n | StringTemplateExpressionNode\n | VoidKeywordNode\n | NeverKeywordNode\n | AnyKeywordNode;\n\nexport type ReferenceExpression =\n | TypeReferenceNode\n | MemberExpressionNode\n | IdentifierNode\n | VoidKeywordNode\n | NeverKeywordNode;\n\nexport interface MemberExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.MemberExpression;\n readonly id: IdentifierNode;\n readonly base: MemberExpressionNode | IdentifierNode;\n readonly selector: \".\" | \"::\";\n}\n\nexport interface NamespaceStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.NamespaceStatement;\n readonly statements?: readonly Statement[] | NamespaceStatementNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly locals?: SymbolTable;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UsingStatementNode extends BaseNode {\n readonly kind: SyntaxKind.UsingStatement;\n readonly name: IdentifierNode | MemberExpressionNode;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface OperationSignatureDeclarationNode extends BaseNode {\n readonly kind: SyntaxKind.OperationSignatureDeclaration;\n readonly parameters: ModelExpressionNode;\n readonly returnType: Expression;\n}\n\nexport interface OperationSignatureReferenceNode extends BaseNode {\n readonly kind: SyntaxKind.OperationSignatureReference;\n readonly baseOperation: TypeReferenceNode;\n}\n\nexport type OperationSignature =\n | OperationSignatureDeclarationNode\n | OperationSignatureReferenceNode;\n\nexport interface OperationStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.OperationStatement;\n readonly signature: OperationSignature;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode | InterfaceStatementNode;\n}\n\nexport interface ModelStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.ModelStatement;\n readonly properties: readonly (ModelPropertyNode | ModelSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n readonly extends?: Expression;\n readonly is?: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ScalarStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.ScalarStatement;\n readonly extends?: TypeReferenceNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly members: readonly ScalarConstructorNode[];\n readonly bodyRange: TextRange;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ScalarConstructorNode extends BaseNode {\n readonly kind: SyntaxKind.ScalarConstructor;\n readonly id: IdentifierNode;\n readonly parameters: FunctionParameterNode[];\n readonly parent?: ScalarStatementNode;\n}\n\nexport interface InterfaceStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.InterfaceStatement;\n readonly operations: readonly OperationStatementNode[];\n readonly bodyRange: TextRange;\n readonly extends: readonly TypeReferenceNode[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UnionStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.UnionStatement;\n readonly options: readonly UnionVariantNode[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface UnionVariantNode extends BaseNode {\n readonly kind: SyntaxKind.UnionVariant;\n readonly id?: IdentifierNode;\n readonly value: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: UnionStatementNode;\n}\n\nexport interface EnumStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.EnumStatement;\n readonly members: readonly (EnumMemberNode | EnumSpreadMemberNode)[];\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface EnumMemberNode extends BaseNode {\n readonly kind: SyntaxKind.EnumMember;\n readonly id: IdentifierNode;\n readonly value?: StringLiteralNode | NumericLiteralNode;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly parent?: EnumStatementNode;\n}\n\nexport interface EnumSpreadMemberNode extends BaseNode {\n readonly kind: SyntaxKind.EnumSpreadMember;\n readonly target: TypeReferenceNode;\n}\n\nexport interface AliasStatementNode extends BaseNode, DeclarationNode, TemplateDeclarationNode {\n readonly kind: SyntaxKind.AliasStatement;\n readonly value: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface ConstStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.ConstStatement;\n readonly value: Expression;\n readonly type?: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\nexport interface CallExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.CallExpression;\n readonly target: MemberExpressionNode | IdentifierNode;\n readonly arguments: Expression[];\n}\n\nexport interface InvalidStatementNode extends BaseNode {\n readonly kind: SyntaxKind.InvalidStatement;\n readonly decorators: readonly DecoratorExpressionNode[];\n}\n\nexport interface EmptyStatementNode extends BaseNode {\n readonly kind: SyntaxKind.EmptyStatement;\n}\n\nexport interface ModelExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ModelExpression;\n readonly properties: (ModelPropertyNode | ModelSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n}\n\nexport interface ArrayExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ArrayExpression;\n readonly elementType: Expression;\n}\nexport interface TupleExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.TupleExpression;\n readonly values: readonly Expression[];\n}\n\nexport interface ModelPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ModelProperty;\n readonly id: IdentifierNode;\n readonly value: Expression;\n readonly decorators: readonly DecoratorExpressionNode[];\n readonly optional: boolean;\n readonly default?: Expression;\n readonly parent?: ModelStatementNode | ModelExpressionNode;\n}\n\nexport interface ModelSpreadPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ModelSpreadProperty;\n readonly target: TypeReferenceNode;\n readonly parent?: ModelStatementNode | ModelExpressionNode;\n}\n\nexport interface ObjectLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteral;\n readonly properties: (ObjectLiteralPropertyNode | ObjectLiteralSpreadPropertyNode)[];\n readonly bodyRange: TextRange;\n}\n\nexport interface ObjectLiteralPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteralProperty;\n readonly id: IdentifierNode;\n readonly value: Expression;\n readonly parent?: ObjectLiteralNode;\n}\n\nexport interface ObjectLiteralSpreadPropertyNode extends BaseNode {\n readonly kind: SyntaxKind.ObjectLiteralSpreadProperty;\n readonly target: TypeReferenceNode;\n readonly parent?: ObjectLiteralNode;\n}\n\nexport interface ArrayLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.ArrayLiteral;\n readonly values: readonly Expression[];\n}\n\nexport type LiteralNode =\n | StringLiteralNode\n | NumericLiteralNode\n | BooleanLiteralNode\n | StringTemplateHeadNode\n | StringTemplateMiddleNode\n | StringTemplateTailNode;\n\nexport interface StringLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.StringLiteral;\n readonly value: string;\n}\n\nexport interface NumericLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.NumericLiteral;\n readonly value: number;\n readonly valueAsString: string;\n}\n\nexport interface BooleanLiteralNode extends BaseNode {\n readonly kind: SyntaxKind.BooleanLiteral;\n readonly value: boolean;\n}\n\nexport interface StringTemplateExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.StringTemplateExpression;\n readonly head: StringTemplateHeadNode;\n readonly spans: readonly StringTemplateSpanNode[];\n}\n\n// Each of these corresponds to a substitution expression and a template literal, in that order.\n// The template literal must have kind TemplateMiddleLiteral or TemplateTailLiteral.\nexport interface StringTemplateSpanNode extends BaseNode {\n readonly kind: SyntaxKind.StringTemplateSpan;\n readonly expression: Expression;\n readonly literal: StringTemplateMiddleNode | StringTemplateTailNode;\n}\n\nexport interface StringTemplateLiteralLikeNode extends BaseNode {\n readonly value: string;\n\n /** @internal */\n readonly tokenFlags: TokenFlags;\n}\n\nexport interface StringTemplateHeadNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateHead;\n}\n\nexport interface StringTemplateMiddleNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateMiddle;\n}\n\nexport interface StringTemplateTailNode extends StringTemplateLiteralLikeNode {\n readonly kind: SyntaxKind.StringTemplateTail;\n}\n\nexport interface ExternKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.ExternKeyword;\n}\n\nexport interface VoidKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.VoidKeyword;\n}\n\nexport interface NeverKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.NeverKeyword;\n}\n\nexport interface AnyKeywordNode extends BaseNode {\n readonly kind: SyntaxKind.UnknownKeyword;\n}\n\nexport interface UnionExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.UnionExpression;\n readonly options: readonly Expression[];\n}\n\nexport interface IntersectionExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.IntersectionExpression;\n readonly options: readonly Expression[];\n}\n\nexport interface ValueOfExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.ValueOfExpression;\n readonly target: Expression;\n}\n\nexport interface TypeOfExpressionNode extends BaseNode {\n readonly kind: SyntaxKind.TypeOfExpression;\n readonly target: Expression;\n}\n\nexport interface TypeReferenceNode extends BaseNode {\n readonly kind: SyntaxKind.TypeReference;\n readonly target: MemberExpressionNode | IdentifierNode;\n readonly arguments: readonly TemplateArgumentNode[];\n}\n\nexport interface TemplateArgumentNode extends BaseNode {\n readonly kind: SyntaxKind.TemplateArgument;\n readonly name?: IdentifierNode;\n readonly argument: Expression;\n}\n\nexport interface TemplateParameterDeclarationNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.TemplateParameterDeclaration;\n readonly constraint?: Expression;\n readonly default?: Expression;\n readonly parent?: TemplateableNode;\n}\n\nexport const enum ModifierFlags {\n None,\n Extern = 1 << 1,\n}\n\nexport type Modifier = ExternKeywordNode;\n\n/**\n * Represent a decorator declaration\n * @example\n * ```typespec\n * extern dec doc(target: Type, value: valueof string);\n * ```\n */\nexport interface DecoratorDeclarationStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.DecoratorDeclarationStatement;\n readonly modifiers: readonly Modifier[];\n readonly modifierFlags: ModifierFlags;\n /**\n * Decorator target. First parameter.\n */\n readonly target: FunctionParameterNode;\n\n /**\n * Additional parameters\n */\n readonly parameters: FunctionParameterNode[];\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface FunctionParameterNode extends BaseNode {\n readonly kind: SyntaxKind.FunctionParameter;\n readonly id: IdentifierNode;\n readonly type?: Expression;\n\n /**\n * Parameter defined with `?`\n */\n readonly optional: boolean;\n\n /**\n * Parameter defined with `...` notation.\n */\n readonly rest: boolean;\n}\n\n/**\n * Represent a function declaration\n * @example\n * ```typespec\n * extern fn camelCase(value: StringLiteral): StringLiteral;\n * ```\n */\nexport interface FunctionDeclarationStatementNode extends BaseNode, DeclarationNode {\n readonly kind: SyntaxKind.FunctionDeclarationStatement;\n readonly modifiers: readonly Modifier[];\n readonly modifierFlags: ModifierFlags;\n readonly parameters: FunctionParameterNode[];\n readonly returnType?: Expression;\n readonly parent?: TypeSpecScriptNode | NamespaceStatementNode;\n}\n\nexport interface IdentifierContext {\n kind: IdentifierKind;\n node: Node;\n}\n\nexport enum IdentifierKind {\n TypeReference,\n TemplateArgument,\n Decorator,\n Function,\n Using,\n Declaration,\n ModelExpressionProperty,\n ModelStatementProperty,\n ObjectLiteralProperty,\n Other,\n}\n\n// Doc-comment related syntax\n\nexport interface DocNode extends BaseNode {\n readonly kind: SyntaxKind.Doc;\n readonly content: readonly DocContent[];\n readonly tags: readonly DocTag[];\n}\n\nexport interface DocTagBaseNode extends BaseNode {\n readonly tagName: IdentifierNode;\n readonly content: readonly DocContent[];\n}\n\nexport type DocTag =\n | DocReturnsTagNode\n | DocErrorsTagNode\n | DocParamTagNode\n | DocPropTagNode\n | DocTemplateTagNode\n | DocUnknownTagNode;\nexport type DocContent = DocTextNode;\n\nexport interface DocTextNode extends BaseNode {\n readonly kind: SyntaxKind.DocText;\n readonly text: string;\n}\n\nexport interface DocReturnsTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocReturnsTag;\n}\n\nexport interface DocErrorsTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocErrorsTag;\n}\n\nexport interface DocParamTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocParamTag;\n readonly paramName: IdentifierNode;\n}\n\nexport interface DocPropTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocPropTag;\n readonly propName: IdentifierNode;\n}\n\nexport interface DocTemplateTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocTemplateTag;\n readonly paramName: IdentifierNode;\n}\n\nexport interface DocUnknownTagNode extends DocTagBaseNode {\n readonly kind: SyntaxKind.DocUnknownTag;\n}\n////\n\n/**\n * Identifies the position within a source file by line number and offset from\n * beginning of line.\n */\nexport interface LineAndCharacter {\n /** The line number. 0-based. */\n line: number;\n\n /**\n * The offset in UTF-16 code units to the character from the beginning of the\n * line. 0-based.\n *\n * NOTE: This is not necessarily the same as what a given text editor might\n * call the \"column\". Tabs, combining characters, surrogate pairs, and so on\n * can all cause an editor to report the column differently. Indeed, different\n * text editors report different column numbers for the same position in a\n * given document.\n */\n character: number;\n}\n\nexport interface JsSourceFileNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.JsSourceFile;\n\n /* A source file with empty contents to represent the file on disk. */\n readonly file: SourceFile;\n\n /* The exports object as comes from `import()` */\n readonly esmExports: any;\n\n /* Any namespaces declared by decorators. */\n /** @internal */\n readonly namespaceSymbols: Sym[];\n}\n\nexport interface JsNamespaceDeclarationNode extends DeclarationNode, BaseNode {\n readonly kind: SyntaxKind.JsNamespaceDeclaration;\n}\n\nexport type EmitterFunc = (context: EmitContext) => Promise<void> | void;\n\nexport interface SourceFile {\n /** The source code text. */\n readonly text: string;\n\n /**\n * The source file path.\n *\n * This is used only for diagnostics. The command line compiler will populate\n * it with the actual path from which the file was read, but it can actually\n * be an arbitrary name for other scenarios.\n */\n readonly path: string;\n\n /**\n * Array of positions in the text where each line begins. There is one entry\n * per line, in order of lines, and each entry represents the offset in UTF-16\n * code units from the start of the document to the beginning of the line.\n */\n getLineStarts(): readonly number[];\n\n /**\n * Converts a one-dimensional position in the document (measured in UTF-16\n * code units) to line number and offset from line start.\n */\n getLineAndCharacterOfPosition(position: number): LineAndCharacter;\n}\n\n/**\n * Represent a location context in the mind of the compiler. This can be:\n * - the user project\n * - a library\n * - the compiler(standard library)\n * - virtual\n */\nexport type LocationContext =\n | ProjectLocationContext\n | CompilerLocationContext\n | SyntheticLocationContext\n | LibraryLocationContext;\n\n/** Defined in the user project. */\nexport interface ProjectLocationContext {\n readonly type: \"project\";\n readonly flags?: PackageFlags;\n}\n\n/** Built-in */\nexport interface CompilerLocationContext {\n readonly type: \"compiler\";\n}\n\n/** Refer to a type that was not declared in a file */\nexport interface SyntheticLocationContext {\n readonly type: \"synthetic\";\n}\n\n/** Defined in a library. */\nexport interface LibraryLocationContext {\n readonly type: \"library\";\n\n /** Library metadata */\n readonly metadata: ModuleLibraryMetadata;\n\n /** Module definition */\n readonly flags?: PackageFlags;\n}\n\nexport interface LibraryInstance {\n module: ModuleResolutionResult;\n entrypoint: JsSourceFileNode;\n metadata: LibraryMetadata;\n definition?: TypeSpecLibrary<any>;\n linter: LinterResolvedDefinition;\n}\n\nexport type LibraryMetadata = FileLibraryMetadata | ModuleLibraryMetadata;\n\ninterface LibraryMetadataBase {\n /** Library homepage. */\n homepage?: string;\n\n /** Library version */\n version?: string;\n\n bugs?: {\n /** Url where to file bugs for this library. */\n url?: string;\n };\n}\n\nexport interface FileLibraryMetadata extends LibraryMetadataBase {\n type: \"file\";\n\n /** Library name as specified in the package.json or in exported $lib. */\n name?: string;\n}\n\n/** Data for a library. Either loaded via a node_modules package or a standalone js file */\nexport interface ModuleLibraryMetadata extends LibraryMetadataBase {\n readonly type: \"module\";\n\n /** Library name as specified in the package.json or in exported $lib. */\n readonly name: string;\n}\n\nexport interface TextRange {\n /**\n * The starting position of the ranger measured in UTF-16 code units from the\n * start of the full string. Inclusive.\n */\n readonly pos: number;\n\n /**\n * The ending position measured in UTF-16 code units from the start of the\n * full string. Exclusive.\n */\n readonly end: number;\n}\n\nexport interface SourceLocation extends TextRange {\n file: SourceFile;\n isSynthetic?: boolean;\n}\n\n/** Used to explicitly specify that a diagnostic has no target. */\nexport const NoTarget = Symbol.for(\"NoTarget\");\n\n/** Diagnostic target that can be used when working with TypeSpec types. */\nexport type TypeSpecDiagnosticTarget = Node | Entity | Sym | TemplateInstanceTarget;\n\n/** Represent a diagnostic target that happens in a template instance context. */\nexport interface TemplateInstanceTarget {\n /** Node target */\n readonly node: Node;\n /** Template mapper used. */\n readonly templateMapper: TypeMapper;\n}\n\nexport type DiagnosticTarget = TypeSpecDiagnosticTarget | SourceLocation;\n\nexport type DiagnosticSeverity = \"error\" | \"warning\";\n\nexport interface Diagnostic {\n code: string;\n /** @internal Diagnostic documentation url */\n readonly url?: string;\n severity: DiagnosticSeverity;\n message: string;\n target: DiagnosticTarget | typeof NoTarget;\n readonly codefixes?: readonly CodeFix[];\n}\n\nexport interface CodeFix {\n readonly id: string;\n readonly label: string;\n readonly fix: (fixContext: CodeFixContext) => CodeFixEdit | CodeFixEdit[] | Promise<void> | void;\n}\n\nexport interface FilePos {\n readonly pos: number;\n readonly file: SourceFile;\n}\n\nexport interface CodeFixContext {\n /** Add the given text before the range or pos given. */\n readonly prependText: (location: SourceLocation | FilePos, text: string) => InsertTextCodeFixEdit;\n /** Add the given text after the range or pos given. */\n readonly appendText: (location: SourceLocation | FilePos, text: string) => InsertTextCodeFixEdit;\n /** Replace the text at the given range. */\n readonly replaceText: (location: SourceLocation, newText: string) => ReplaceTextCodeFixEdit;\n}\n\nexport type CodeFixEdit = InsertTextCodeFixEdit | ReplaceTextCodeFixEdit;\n\nexport interface InsertTextCodeFixEdit {\n readonly kind: \"insert-text\";\n readonly text: string;\n readonly pos: number;\n readonly file: SourceFile;\n}\n\nexport interface ReplaceTextCodeFixEdit extends TextRange {\n readonly kind: \"replace-text\";\n readonly text: string;\n readonly file: SourceFile;\n}\n\n/**\n * Return type of accessor functions in TypeSpec.\n * Tuple composed of:\n * - 0: Actual result of an accessor function\n * - 1: List of diagnostics that were emitted while retrieving the data.\n */\nexport type DiagnosticResult<T> = [T, readonly Diagnostic[]];\n\nexport interface DirectiveBase {\n node: DirectiveExpressionNode;\n}\n\nexport type Directive = SuppressDirective | DeprecatedDirective;\n\nexport interface SuppressDirective extends DirectiveBase {\n name: \"suppress\";\n code: string;\n message: string;\n}\n\nexport interface DeprecatedDirective extends DirectiveBase {\n name: \"deprecated\";\n message: string;\n}\n\nexport interface RmOptions {\n /**\n * If `true`, perform a recursive directory removal. In\n * recursive mode, errors are not reported if `path` does not exist, and\n * operations are retried on failure.\n * @default false\n */\n recursive?: boolean;\n}\n\nexport interface SystemHost {\n /** read a file at the given url. */\n readUrl(url: string): Promise<SourceFile>;\n\n /** read a utf-8 or utf-8 with bom encoded file */\n readFile(path: string): Promise<SourceFile>;\n\n /**\n * Write the file.\n * @param path Path to the file.\n * @param content Content of the file.\n */\n writeFile(path: string, content: string): Promise<void>;\n\n /**\n * Read directory.\n * @param path Path to the directory.\n * @returns list of file/directory in the given directory. Returns the name not the full path.\n */\n readDir(path: string): Promise<string[]>;\n\n /**\n * Deletes a directory or file.\n * @param path Path to the directory or file.\n */\n rm(path: string, options?: RmOptions): Promise<void>;\n\n /**\n * create directory recursively.\n * @param path Path to the directory.\n */\n mkdirp(path: string): Promise<string | undefined>;\n\n // get info about a path\n stat(path: string): Promise<{ isDirectory(): boolean; isFile(): boolean }>;\n\n // get the real path of a possibly symlinked path\n realpath(path: string): Promise<string>;\n}\n\nexport interface CompilerHost extends SystemHost {\n /**\n * Optional cache to reuse the results of parsing and binding across programs.\n */\n parseCache?: WeakMap<SourceFile, TypeSpecScriptNode>;\n\n // get the directory TypeSpec is executing from\n getExecutionRoot(): string;\n\n // get the directories we should load standard library files from\n getLibDirs(): string[];\n\n // get a promise for the ESM module shape of a JS module\n getJsImport(path: string): Promise<Record<string, any>>;\n\n getSourceFileKind(path: string): SourceFileKind | undefined;\n\n // convert a file URL to a path in a file system\n fileURLToPath(url: string): string;\n\n // convert a file system path to a URL\n pathToFileURL(path: string): string;\n\n logSink: LogSink;\n}\n\n/**\n * Type of the source file that can be loaded via typespec\n */\nexport type SourceFileKind = \"typespec\" | \"js\";\n\ntype UnionToIntersection<T> = (T extends any ? (k: T) => void : never) extends (k: infer I) => void\n ? I\n : never;\n\nexport enum ListenerFlow {\n /**\n * Do not navigate any containing or referenced type.\n */\n NoRecursion = 1,\n}\n\n/**\n * Listener function. Can return false to stop recursion.\n */\ntype TypeListener<T> = (context: T) => ListenerFlow | undefined | void;\ntype exitListener<T extends string | number | symbol> = T extends string ? `exit${T}` : T;\ntype ListenerForType<T extends Type> = T extends Type\n ? { [k in Uncapitalize<T[\"kind\"]> | exitListener<T[\"kind\"]>]?: TypeListener<T> }\n : never;\n\nexport type TypeListeners = UnionToIntersection<ListenerForType<Type>>;\n\nexport type SemanticNodeListener = {\n root?: (context: Program) => void | undefined;\n} & TypeListeners;\n\nexport type DiagnosticReportWithoutTarget<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> = {\n code: C;\n messageId?: M;\n readonly codefixes?: readonly CodeFix[];\n} & DiagnosticFormat<T, C, M>;\n\nexport type DiagnosticReport<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> = DiagnosticReportWithoutTarget<T, C, M> & { target: DiagnosticTarget | typeof NoTarget };\n\nexport type DiagnosticFormat<\n T extends { [code: string]: DiagnosticMessages },\n C extends keyof T,\n M extends keyof T[C] = \"default\",\n> =\n T[C][M] extends CallableMessage<infer A>\n ? { format: Record<A[number], string> }\n : Record<string, unknown>;\n\n/**\n * Declare a diagnostic that can be reported by the library.\n *\n * @example\n *\n * ```ts\n * unterminated: {\n * severity: \"error\",\n * description: \"Unterminated token.\",\n * url: \"https://example.com/docs/diags/unterminated\",\n * messages: {\n * default: paramMessage`Unterminated ${\"token\"}.`,\n * },\n * },\n * ```\n */\nexport interface DiagnosticDefinition<M extends DiagnosticMessages> {\n /**\n * Diagnostic severity.\n * - `warning` - Suppressable, should be used to represent potential issues but not blocking.\n * - `error` - Non-suppressable, should be used to represent failure to move forward.\n */\n readonly severity: \"warning\" | \"error\";\n /** Messages that can be reported with the diagnostic. */\n readonly messages: M;\n /** Short description of the diagnostic */\n readonly description?: string;\n /** Specifies the URL at which the full documentation can be accessed. */\n readonly url?: string;\n}\n\nexport interface DiagnosticMessages {\n readonly [messageId: string]: string | CallableMessage<string[]>;\n}\n\nexport interface CallableMessage<T extends string[]> {\n keys: T;\n (dict: Record<T[number], string>): string;\n}\n\nexport type DiagnosticMap<T extends { [code: string]: DiagnosticMessages }> = {\n readonly [code in keyof T]: DiagnosticDefinition<T[code]>;\n};\n\nexport interface DiagnosticCreator<T extends { [code: string]: DiagnosticMessages }> {\n readonly type: T;\n readonly diagnostics: DiagnosticMap<T>;\n createDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n diag: DiagnosticReport<T, C, M>,\n ): Diagnostic;\n reportDiagnostic<C extends keyof T, M extends keyof T[C] = \"default\">(\n program: Program,\n diag: DiagnosticReport<T, C, M>,\n ): void;\n}\n\nexport type TypeOfDiagnostics<T extends DiagnosticMap<any>> =\n T extends DiagnosticMap<infer D> ? D : never;\n\nexport type JSONSchemaType<T> = AjvJSONSchemaType<T>;\n\n/**\n * @internal\n */\nexport interface JSONSchemaValidator {\n /**\n * Validate the configuration against its JSON Schema.\n *\n * @param config Configuration to validate.\n * @param target Source file target to use for diagnostics.\n * @returns Diagnostics produced by schema validation of the configuration.\n */\n validate(\n config: unknown,\n target: YamlScript | YamlPathTarget | SourceFile | typeof NoTarget,\n ): Diagnostic[];\n}\n\nexport interface StateDef {\n /**\n * Description for this state.\n */\n readonly description?: string;\n}\n\nexport interface TypeSpecLibraryCapabilities {\n /** Only applicable for emitters. Specify that this emitter will respect the dryRun flag and run, report diagnostic but not write any output. */\n readonly dryRun?: boolean;\n}\n\nexport interface TypeSpecLibraryDef<\n T extends { [code: string]: DiagnosticMessages },\n E extends Record<string, any> = Record<string, never>,\n State extends string = never,\n> {\n /**\n * Library name. MUST match package.json name.\n */\n readonly name: string;\n\n /** Optional registration of capabilities the library/emitter provides */\n readonly capabilities?: TypeSpecLibraryCapabilities;\n\n /**\n * Map of potential diagnostics that can be emitted in this library where the key is the diagnostic code.\n */\n readonly diagnostics: DiagnosticMap<T>;\n\n /**\n * List of other library that should be imported when this is used as an emitter.\n * Compiler will emit an error if the libraries are not explicitly imported.\n */\n readonly requireImports?: readonly string[];\n\n /**\n * Emitter configuration if library is an emitter.\n */\n readonly emitter?: {\n options?: JSONSchemaType<E>;\n };\n\n readonly state?: Record<State, StateDef>;\n}\n\n/**\n * Type for the $decorators export from libraries.\n *\n * @example\n * ```\n * export const $decorators = {\n * \"Azure.Core\": {\n * flags: $flags,\n * \"foo-bar\": fooBarDecorator\n * }\n * }\n * ```\n */\nexport interface DecoratorImplementations {\n readonly [namespace: string]: {\n readonly [name: string]: DecoratorFunction;\n };\n}\n\nexport interface PackageFlags {}\n\nexport interface LinterDefinition {\n rules: LinterRuleDefinition<string, DiagnosticMessages>[];\n ruleSets?: Record<string, LinterRuleSet>;\n}\n\nexport interface LinterResolvedDefinition {\n readonly rules: LinterRule<string, DiagnosticMessages>[];\n readonly ruleSets: {\n [name: string]: LinterRuleSet;\n };\n}\n\ninterface LinterRuleDefinitionBase<N extends string, DM extends DiagnosticMessages> {\n /** Rule name (without the library name) */\n name: N;\n /** Rule default severity. */\n severity: \"warning\";\n /** Short description of the rule */\n description: string;\n /** Specifies the URL at which the full documentation can be accessed. */\n url?: string;\n /** Messages that can be reported with the diagnostic. */\n messages: DM;\n}\n\ninterface LinterRuleDefinitionSync<\n N extends string,\n DM extends DiagnosticMessages,\n> extends LinterRuleDefinitionBase<N, DM> {\n /** Whether this is an async rule. Default is false */\n async?: false;\n /** Creator */\n create(\n context: LinterRuleContext<DM>,\n ): SemanticNodeListener & { exit?: (context: Program) => void | undefined };\n}\n\ninterface LinterRuleDefinitionAsync<\n N extends string,\n DM extends DiagnosticMessages,\n> extends LinterRuleDefinitionBase<N, DM> {\n /** Whether this is an async rule. Default is false */\n async: true;\n /** Creator */\n create(\n context: LinterRuleContext<DM>,\n ): SemanticNodeListener & { exit?: (context: Program) => Promise<void | undefined> };\n}\n\nexport type LinterRuleDefinition<N extends string, DM extends DiagnosticMessages> =\n | LinterRuleDefinitionSync<N, DM>\n | LinterRuleDefinitionAsync<N, DM>;\n\n/** Resolved instance of a linter rule that will run. */\nexport type LinterRule<N extends string, DM extends DiagnosticMessages> = LinterRuleDefinition<\n N,\n DM\n> & {\n /** Expanded rule id in format `<library-name>:<rule-name>` */\n id: string;\n};\n\n/** Reference to a rule. In this format `<library name>:<rule/ruleset name>` */\nexport type RuleRef = `${string}/${string}`;\nexport interface LinterRuleSet {\n /** Other ruleset this ruleset extends */\n extends?: RuleRef[];\n\n /** Rules to enable/configure */\n enable?: Record<RuleRef, boolean>;\n\n /** Rules to disable. A rule CANNOT be in enable and disable map. */\n disable?: Record<RuleRef, string>;\n}\n\nexport interface LinterRuleContext<DM extends DiagnosticMessages> {\n readonly program: Program;\n reportDiagnostic<M extends keyof DM>(diag: LinterRuleDiagnosticReport<DM, M>): void;\n}\n\nexport type LinterRuleDiagnosticFormat<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> =\n T[M] extends CallableMessage<infer A>\n ? { format: Record<A[number], string> }\n : Record<string, unknown>;\n\nexport type LinterRuleDiagnosticReportWithoutTarget<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> = {\n messageId?: M;\n codefixes?: CodeFix[];\n} & LinterRuleDiagnosticFormat<T, M>;\n\nexport type LinterRuleDiagnosticReport<\n T extends DiagnosticMessages,\n M extends keyof T = \"default\",\n> = LinterRuleDiagnosticReportWithoutTarget<T, M> & { target: DiagnosticTarget | typeof NoTarget };\n\nexport interface TypeSpecLibrary<\n T extends { [code: string]: DiagnosticMessages },\n E extends Record<string, any> = Record<string, never>,\n State extends string = never,\n> extends TypeSpecLibraryDef<T, E, State> {\n /** Library name */\n readonly name: string;\n\n /**\n * JSON Schema validator for emitter options\n * @internal\n */\n readonly emitterOptionValidator?: JSONSchemaValidator;\n\n reportDiagnostic<C extends keyof T, M extends keyof T[C]>(\n program: Program,\n diag: DiagnosticReport<T, C, M>,\n ): void;\n createDiagnostic<C extends keyof T, M extends keyof T[C]>(\n diag: DiagnosticReport<T, C, M>,\n ): Diagnostic;\n\n /**\n * Get or create a symbol with the given name unique for that library.\n * @param name Symbol name scoped with the library name.\n */\n createStateSymbol(name: string): symbol;\n\n /**\n * Returns a tracer scopped to the current library.\n * All trace area logged via this tracer will be prefixed with the library name.\n */\n getTracer(program: Program): Tracer;\n\n readonly stateKeys: Record<State, symbol>;\n}\n\n/**\n * Get the options for the onEmit of this library.\n */\nexport type EmitOptionsFor<C> = C extends TypeSpecLibrary<infer _T, infer E> ? E : never;\n\nexport interface DecoratorContext {\n program: Program;\n\n /**\n * Point to the decorator target\n */\n decoratorTarget: DiagnosticTarget;\n\n /**\n * Function that can be used to retrieve the target for a parameter at the given index.\n * @param paramIndex Parameter index in the typespec\n * @example @foo(\"bar\", 123) -> $foo(context, target, arg0: string, arg1: number);\n * getArgumentTarget(0) -> target for arg0\n * getArgumentTarget(1) -> target for arg1\n */\n getArgumentTarget(paramIndex: number): DiagnosticTarget | undefined;\n\n /**\n * Helper to call out to another decorator\n * @param decorator Other decorator function\n * @param args Args to pass to other decorator function\n */\n call<T extends Type, A extends any[], R>(\n decorator: (context: DecoratorContext, target: T, ...args: A) => R,\n target: T,\n ...args: A\n ): R;\n}\n\nexport interface EmitContext<TOptions extends object = Record<string, never>> {\n /**\n * TypeSpec Program.\n */\n program: Program;\n\n /**\n * Configured output dir for the emitter. Emitter should emit all output under that directory.\n */\n emitterOutputDir: string;\n\n /**\n * Emitter custom options defined in createTypeSpecLibrary\n */\n options: TOptions;\n\n /**\n * Performance measurement utilities.\n * Use this to report performance of areas of your emitter.\n * The information will be displayed when the compiler is run with `--stats` flag.\n */\n readonly perf: PerfReporter;\n}\n\nexport interface Timer {\n end: () => number;\n}\n\nexport interface PerfReporter {\n /**\n * Start timer for the given label.\n *\n * @example\n * ```ts\n * const timer = emitContext.perf.startTimer(\"my-emitter-task\");\n * // ... do work\n * const elapsed = timer.end(); // my-emitter-task automatically reported to the compiler\n * ```\n */\n startTimer(label: string): Timer;\n /** Report a sync function elapsed time. */\n time<T>(label: string, callback: () => T): T;\n /** Report an async function elapsed time. */\n timeAsync<T>(label: string, callback: () => Promise<T>): Promise<T>;\n\n /**\n * Report a custom elapsed time for the given label.\n * Can be used with {@link import(\"./perf.js\").perf}\n * @example\n * ```ts\n * import { perf } from \"@typespec/compiler\";\n *\n * // somewhere in your emitter\n * const start = perf.now();\n * await doSomething();\n * const end = perf.now();\n *\n * emitContext.perf.report(\"doSomething\", end - start);\n * ```\n */\n report(label: string, milliseconds: number): void;\n\n /** @internal */\n readonly measures: Readonly<Record<string, number>>;\n}\n\nexport type LogLevel = \"trace\" | \"warning\" | \"error\";\n\nexport interface LogInfo {\n level: LogLevel;\n message: string;\n code?: string;\n target?: DiagnosticTarget | typeof NoTarget;\n}\n\nexport interface ProcessedLog {\n level: LogLevel;\n message: string;\n code?: string;\n /** Documentation for the error code. */\n url?: string;\n\n /** Log location */\n sourceLocation?: SourceLocation;\n\n /** @internal */\n related?: RelatedSourceLocation[];\n}\n\n/** @internal */\nexport interface RelatedSourceLocation {\n readonly message: string;\n readonly location: SourceLocation;\n}\n\n/** @internal */\nexport type TaskStatus = \"success\" | \"failure\" | \"skipped\" | \"warn\";\n\n/** @internal */\nexport interface TrackActionTask {\n message: string;\n readonly isStopped: boolean;\n succeed(message?: string): void;\n fail(message?: string): void;\n warn(message?: string): void;\n skip(message?: string): void;\n stop(status: TaskStatus, message?: string): void;\n}\n\nexport interface LogSink {\n log(log: ProcessedLog): void;\n\n /** @internal */\n getPath?(path: string): string;\n\n /**\n * @internal\n */\n trackAction?<T>(\n message: string,\n finalMessage: string,\n asyncAction: (task: TrackActionTask) => Promise<T>,\n ): Promise<T>;\n}\n\nexport interface Logger {\n trace(message: string): void;\n warn(message: string): void;\n error(message: string): void;\n log(log: LogInfo): void;\n\n /** @internal */\n trackAction<T>(\n message: string,\n finalMessage: string,\n asyncAction: (task: TrackActionTask) => Promise<T>,\n ): Promise<T>;\n}\n\nexport interface TracerOptions {\n filter?: string[];\n}\nexport interface Tracer {\n /**\n * Trace\n * @param area\n * @param message\n */\n trace(area: string, message: string, target?: DiagnosticTarget): void;\n\n /**\n * @param subarea\n */\n sub(subarea: string): Tracer;\n}\n", "import { createDiagnostic } from \"./messages.js\";\nimport type { Program } from \"./program.js\";\nimport { createSourceFile } from \"./source-file.js\";\nimport {\n CodeFix,\n Diagnostic,\n DiagnosticResult,\n DiagnosticTarget,\n LogSink,\n Node,\n NodeFlags,\n NoTarget,\n RelatedSourceLocation,\n SourceLocation,\n SymbolFlags,\n SyntaxKind,\n Type,\n TypeSpecDiagnosticTarget,\n} from \"./types.js\";\n\nexport type WriteLine = (text?: string) => void;\nexport type DiagnosticHandler = (diagnostic: Diagnostic) => void;\n\nexport function logDiagnostics(diagnostics: readonly Diagnostic[], logger: LogSink) {\n for (const diagnostic of diagnostics) {\n logger.log({\n level: diagnostic.severity,\n message: diagnostic.message,\n code: diagnostic.code,\n url: diagnostic.url,\n sourceLocation: getSourceLocation(diagnostic.target, { locateId: true }),\n related: getRelatedLocations(diagnostic),\n });\n }\n}\n\n/** @internal */\nexport function getRelatedLocations(diagnostic: Diagnostic): RelatedSourceLocation[] {\n return getDiagnosticTemplateInstantitationTrace(diagnostic.target).map((x) => {\n return {\n message: \"occurred while instantiating template\",\n location: getSourceLocation(x),\n };\n });\n}\n\n/**\n * Find the syntax node for a TypeSpec diagnostic target.\n *\n * This function extracts the AST node from various types of diagnostic targets:\n * - For template instance targets: returns the node of the template declaration\n * - For symbols: returns the first declaration node (or symbol source for using symbols)\n * - For AST nodes: returns the node itself\n * - For types: returns the node associated with the type\n *\n * @param target The diagnostic target to extract a node from. Can be a template instance,\n * symbol, AST node, or type.\n * @returns The AST node associated with the target, or undefined if the target is a type\n * or symbol that doesn't have an associated node.\n */\nexport function getNodeForTarget(target: TypeSpecDiagnosticTarget): Node | undefined {\n if (!(\"kind\" in target) && !(\"entityKind\" in target)) {\n // TemplateInstanceTarget\n if (!(\"declarations\" in target)) {\n return target.node;\n }\n\n // symbol\n if (target.flags & SymbolFlags.Using) {\n target = target.symbolSource!;\n }\n\n return target.declarations[0];\n } else if (\"kind\" in target && typeof target.kind === \"number\") {\n // node\n return target as Node;\n } else {\n // type\n return (target as Type).node;\n }\n}\n\nexport interface SourceLocationOptions {\n /**\n * If trying to resolve the location of a type with an ID, show the location of the ID node instead of the entire type.\n * This makes sure that the location range is not too large and hard to read.\n */\n locateId?: boolean;\n}\nexport function getSourceLocation(\n target: DiagnosticTarget,\n options?: SourceLocationOptions,\n): SourceLocation;\nexport function getSourceLocation(\n target: typeof NoTarget | undefined,\n options?: SourceLocationOptions,\n): undefined;\nexport function getSourceLocation(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n options?: SourceLocationOptions,\n): SourceLocation | undefined;\nexport function getSourceLocation(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n options: SourceLocationOptions = {},\n): SourceLocation | undefined {\n if (target === NoTarget || target === undefined) {\n return undefined;\n }\n\n if (\"file\" in target) {\n return target;\n }\n\n const node = getNodeForTarget(target);\n return node ? getSourceLocationOfNode(node, options) : createSyntheticSourceLocation();\n}\n\n/**\n * @internal\n */\nexport function getDiagnosticTemplateInstantitationTrace(\n target: DiagnosticTarget | typeof NoTarget | undefined,\n): Node[] {\n if (typeof target !== \"object\" || !(\"templateMapper\" in target)) {\n return [];\n }\n\n const result = [];\n let current = target.templateMapper;\n while (current) {\n result.push(current.source.node);\n current = current.source.mapper;\n }\n return result;\n}\n\nfunction createSyntheticSourceLocation(loc = \"<unknown location>\") {\n return {\n file: createSourceFile(\"\", loc),\n pos: 0,\n end: 0,\n isSynthetic: true,\n };\n}\n\nfunction getSourceLocationOfNode(node: Node, options: SourceLocationOptions): SourceLocation {\n let root = node;\n\n while (root.parent !== undefined) {\n root = root.parent;\n }\n\n if (root.kind !== SyntaxKind.TypeSpecScript && root.kind !== SyntaxKind.JsSourceFile) {\n return createSyntheticSourceLocation(\n node.flags & NodeFlags.Synthetic\n ? undefined\n : \"<unknown location - cannot obtain source location of unbound node - file bug at https://github.com/microsoft/typespec>\",\n );\n }\n\n if (options.locateId && \"id\" in node && node.id !== undefined) {\n node = node.id;\n }\n\n return {\n file: root.file,\n pos: node.pos,\n end: node.end,\n };\n}\n\n/**\n * Verbose output is enabled by default for runs in mocha explorer in VS Code,\n * where the output is nicely associated with the individual test, and disabled\n * by default for command line runs where we don't want to spam the console.\n *\n * If the steps taken to produce the message are expensive, pass a callback\n * instead of producing the message then passing it here only to be dropped\n * when verbose output is disabled.\n */\nexport function logVerboseTestOutput(\n messageOrCallback: string | ((log: (message: string) => void) => void),\n) {\n if (process.env.TYPESPEC_VERBOSE_TEST_OUTPUT) {\n if (typeof messageOrCallback === \"string\") {\n // eslint-disable-next-line no-console\n console.log(messageOrCallback);\n } else {\n // eslint-disable-next-line no-console\n messageOrCallback(console.log);\n }\n }\n}\n\n/**\n * Use this to report bugs in the compiler, and not errors in the source code\n * being compiled.\n *\n * @param condition Throw if this is not true.\n *\n * @param message Error message.\n *\n * @param target Optional location in source code that might give a clue about\n * what got the compiler off track.\n */\nexport function compilerAssert(\n condition: any,\n message: string,\n target?: DiagnosticTarget,\n): asserts condition {\n if (condition) {\n return;\n }\n\n if (target) {\n let location: SourceLocation | undefined;\n try {\n location = getSourceLocation(target);\n } catch (err: any) {}\n\n if (location) {\n const pos = location.file.getLineAndCharacterOfPosition(location.pos);\n const file = location.file.path;\n const line = pos.line + 1;\n const col = pos.character + 1;\n message += `\\nOccurred while compiling code in ${file} near line ${line}, column ${col}`;\n }\n }\n\n throw new Error(message);\n}\n\n/**\n * Assert that the input type has one of the kinds provided\n */\nexport function assertType<TKind extends Type[\"kind\"][]>(\n typeDescription: string,\n t: Type,\n ...kinds: TKind\n): asserts t is Type & { kind: TKind[number] } {\n if (kinds.indexOf(t.kind) === -1) {\n throw new Error(`Expected ${typeDescription} to be type ${kinds.join(\", \")}`);\n }\n}\n\n/**\n * Report a deprecated diagnostic.\n * @param program TypeSpec Program.\n * @param message Message describing the deprecation.\n * @param target Target of the deprecation.\n * @param reportFunc Optional custom report function.\n */\nexport function reportDeprecated(\n program: Program,\n message: string,\n target: DiagnosticTarget | typeof NoTarget,\n reportFunc?: (diagnostic: Diagnostic) => void,\n): void {\n if (program.compilerOptions.ignoreDeprecated !== true) {\n const report = reportFunc ?? program.reportDiagnostic.bind(program);\n report(\n createDiagnostic({\n code: \"deprecated\",\n format: {\n message,\n },\n target,\n }),\n );\n }\n}\n\n/**\n * Helper object to collect diagnostics from function following the diagnostics accessor pattern(foo() => [T, Diagnostic[]])\n */\nexport interface DiagnosticCollector {\n readonly diagnostics: readonly Diagnostic[];\n\n /**\n * Add a diagnostic to the collection\n * @param diagnostic Diagnostic to add.\n */\n add(diagnostic: Diagnostic): void;\n\n /**\n * Unwrap the Diagnostic result, add all the diagnostics and return the data.\n * @param result Accessor diagnostic result\n */\n pipe<T>(result: DiagnosticResult<T>): T;\n\n /**\n * Wrap the given value in a tuple including the diagnostics following the TypeSpec accessor pattern.\n * @param value Accessor value to return\n * @example return diagnostics.wrap(routes);\n */\n wrap<T>(value: T): DiagnosticResult<T>;\n\n /**\n * Join the given result with the diagnostics in this collector.\n * @param result - result to join with the diagnostics\n * @returns - the result with the combined diagnostics\n */\n join<T>(result: DiagnosticResult<T>): DiagnosticResult<T>;\n}\n\n/**\n * Create a new instance of the @see DiagnosticCollector.\n */\nexport function createDiagnosticCollector(): DiagnosticCollector {\n const diagnostics: Diagnostic[] = [];\n\n return {\n diagnostics,\n add,\n pipe,\n wrap,\n join,\n };\n\n function add(diagnostic: Diagnostic) {\n diagnostics.push(diagnostic);\n }\n\n function pipe<T>(result: DiagnosticResult<T>): T {\n const [value, diags] = result;\n for (const diag of diags) {\n diagnostics.push(diag);\n }\n return value;\n }\n\n function wrap<T>(value: T): DiagnosticResult<T> {\n return [value, diagnostics];\n }\n\n function join<T>(result: DiagnosticResult<T>): DiagnosticResult<T> {\n const [value, diags] = result;\n for (const diag of diags) {\n diagnostics.push(diag);\n }\n return [value, diagnostics];\n }\n}\n\n/**\n * Ignore the diagnostics emitted by the diagnostic accessor pattern and just return the actual result.\n * @param result Accessor pattern tuple result including the actual result and the list of diagnostics.\n * @returns Actual result.\n */\nexport function ignoreDiagnostics<T>(result: DiagnosticResult<T>): T {\n return result[0];\n}\n\nexport function defineCodeFix(fix: CodeFix): CodeFix {\n return fix;\n}\n", "//\n// Generated by scripts/regen-nonascii-map.js\n// on node v18.16.0 with unicode 15.0.\n//\n\n/**\n * @internal\n *\n * Map of non-ascii characters that are valid in an identifier. Each pair of\n * numbers represents an inclusive range of code points.\n */\n//prettier-ignore\nexport const nonAsciiIdentifierMap: readonly number[] = [\n 0xa0, 0x377,\n 0x37a, 0x37f,\n 0x384, 0x38a,\n 0x38c, 0x38c,\n 0x38e, 0x3a1,\n 0x3a3, 0x52f,\n 0x531, 0x556,\n 0x559, 0x58a,\n 0x58d, 0x58f,\n 0x591, 0x5c7,\n 0x5d0, 0x5ea,\n 0x5ef, 0x5f4,\n 0x600, 0x70d,\n 0x70f, 0x74a,\n 0x74d, 0x7b1,\n 0x7c0, 0x7fa,\n 0x7fd, 0x82d,\n 0x830, 0x83e,\n 0x840, 0x85b,\n 0x85e, 0x85e,\n 0x860, 0x86a,\n 0x870, 0x88e,\n 0x890, 0x891,\n 0x898, 0x983,\n 0x985, 0x98c,\n 0x98f, 0x990,\n 0x993, 0x9a8,\n 0x9aa, 0x9b0,\n 0x9b2, 0x9b2,\n 0x9b6, 0x9b9,\n 0x9bc, 0x9c4,\n 0x9c7, 0x9c8,\n 0x9cb, 0x9ce,\n 0x9d7, 0x9d7,\n 0x9dc, 0x9dd,\n 0x9df, 0x9e3,\n 0x9e6, 0x9fe,\n 0xa01, 0xa03,\n 0xa05, 0xa0a,\n 0xa0f, 0xa10,\n 0xa13, 0xa28,\n 0xa2a, 0xa30,\n 0xa32, 0xa33,\n 0xa35, 0xa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,\n 0xcb5, 0xcb9,\n 0xcbc, 0xcc4,\n 0xcc6, 0xcc8,\n 0xcca, 0xccd,\n 0xcd5, 0xcd6,\n 0xcdd, 0xcde,\n 0xce0, 0xce3,\n 0xce6, 0xcef,\n 0xcf1, 0xcf3,\n 0xd00, 0xd0c,\n 0xd0e, 0xd10,\n 0xd12, 0xd44,\n 0xd46, 0xd48,\n 0xd4a, 0xd4f,\n 0xd54, 0xd63,\n 0xd66, 0xd7f,\n 0xd81, 0xd83,\n 0xd85, 0xd96,\n 0xd9a, 0xdb1,\n 0xdb3, 0xdbb,\n 0xdbd, 0xdbd,\n 0xdc0, 0xdc6,\n 0xdca, 0xdca,\n 0xdcf, 0xdd4,\n 0xdd6, 0xdd6,\n 0xdd8, 0xddf,\n 0xde6, 0xdef,\n 0xdf2, 0xdf4,\n 0xe01, 0xe3a,\n 0xe3f, 0xe5b,\n 0xe81, 0xe82,\n 0xe84, 0xe84,\n 0xe86, 0xe8a,\n 0xe8c, 0xea3,\n 0xea5, 0xea5,\n 0xea7, 0xebd,\n 0xec0, 0xec4,\n 0xec6, 0xec6,\n 0xec8, 0xece,\n 0xed0, 0xed9,\n 0xedc, 0xedf,\n 0xf00, 0xf47,\n 0xf49, 0xf6c,\n 0xf71, 0xf97,\n 0xf99, 0xfbc,\n 0xfbe, 0xfcc,\n 0xfce, 0xfda,\n 0x1000, 0x10c5,\n 0x10c7, 0x10c7,\n 0x10cd, 0x10cd,\n 0x10d0, 0x1248,\n 0x124a, 0x124d,\n 0x1250, 0x1256,\n 0x1258, 0x1258,\n 0x125a, 0x125d,\n 0x1260, 0x1288,\n 0x128a, 0x128d,\n 0x1290, 0x12b0,\n 0x12b2, 0x12b5,\n 0x12b8, 0x12be,\n 0x12c0, 0x12c0,\n 0x12c2, 0x12c5,\n 0x12c8, 0x12d6,\n 0x12d8, 0x1310,\n 0x1312, 0x1315,\n 0x1318, 0x135a,\n 0x135d, 0x137c,\n 0x1380, 0x1399,\n 0x13a0, 0x13f5,\n 0x13f8, 0x13fd,\n 0x1400, 0x169c,\n 0x16a0, 0x16f8,\n 0x1700, 0x1715,\n 0x171f, 0x1736,\n 0x1740, 0x1753,\n 0x1760, 0x176c,\n 0x176e, 0x1770,\n 0x1772, 0x1773,\n 0x1780, 0x17dd,\n 0x17e0, 0x17e9,\n 0x17f0, 0x17f9,\n 0x1800, 0x1819,\n 0x1820, 0x1878,\n 0x1880, 0x18aa,\n 0x18b0, 0x18f5,\n 0x1900, 0x191e,\n 0x1920, 0x192b,\n 0x1930, 0x193b,\n 0x1940, 0x1940,\n 0x1944, 0x196d,\n 0x1970, 0x1974,\n 0x1980, 0x19ab,\n 0x19b0, 0x19c9,\n 0x19d0, 0x19da,\n 0x19de, 0x1a1b,\n 0x1a1e, 0x1a5e,\n 0x1a60, 0x1a7c,\n 0x1a7f, 0x1a89,\n 0x1a90, 0x1a99,\n 0x1aa0, 0x1aad,\n 0x1ab0, 0x1ace,\n 0x1b00, 0x1b4c,\n 0x1b50, 0x1b7e,\n 0x1b80, 0x1bf3,\n 0x1bfc, 0x1c37,\n 0x1c3b, 0x1c49,\n 0x1c4d, 0x1c88,\n 0x1c90, 0x1cba,\n 0x1cbd, 0x1cc7,\n 0x1cd0, 0x1cfa,\n 0x1d00, 0x1f15,\n 0x1f18, 0x1f1d,\n 0x1f20, 0x1f45,\n 0x1f48, 0x1f4d,\n 0x1f50, 0x1f57,\n 0x1f59, 0x1f59,\n 0x1f5b, 0x1f5b,\n 0x1f5d, 0x1f5d,\n 0x1f5f, 0x1f7d,\n 0x1f80, 0x1fb4,\n 0x1fb6, 0x1fc4,\n 0x1fc6, 0x1fd3,\n 0x1fd6, 0x1fdb,\n 0x1fdd, 0x1fef,\n 0x1ff2, 0x1ff4,\n 0x1ff6, 0x1ffe,\n 0x2000, 0x200d,\n 0x2010, 0x2027,\n 0x202a, 0x2064,\n 0x2066, 0x2071,\n 0x2074, 0x208e,\n 0x2090, 0x209c,\n 0x20a0, 0x20c0,\n 0x20d0, 0x20f0,\n 0x2100, 0x218b,\n 0x2190, 0x2426,\n 0x2440, 0x244a,\n 0x2460, 0x2b73,\n 0x2b76, 0x2b95,\n 0x2b97, 0x2cf3,\n 0x2cf9, 0x2d25,\n 0x2d27, 0x2d27,\n 0x2d2d, 0x2d2d,\n 0x2d30, 0x2d67,\n 0x2d6f, 0x2d70,\n 0x2d7f, 0x2d96,\n 0x2da0, 0x2da6,\n 0x2da8, 0x2dae,\n 0x2db0, 0x2db6,\n 0x2db8, 0x2dbe,\n 0x2dc0, 0x2dc6,\n 0x2dc8, 0x2dce,\n 0x2dd0, 0x2dd6,\n 0x2dd8, 0x2dde,\n 0x2de0, 0x2e5d,\n 0x2e80, 0x2e99,\n 0x2e9b, 0x2ef3,\n 0x2f00, 0x2fd5,\n 0x2ff0, 0x2ffb,\n 0x3000, 0x303f,\n 0x3041, 0x3096,\n 0x3099, 0x30ff,\n 0x3105, 0x312f,\n 0x3131, 0x318e,\n 0x3190, 0x31e3,\n 0x31f0, 0x321e,\n 0x3220, 0xa48c,\n 0xa490, 0xa4c6,\n 0xa4d0, 0xa62b,\n 0xa640, 0xa6f7,\n 0xa700, 0xa7ca,\n 0xa7d0, 0xa7d1,\n 0xa7d3, 0xa7d3,\n 0xa7d5, 0xa7d9,\n 0xa7f2, 0xa82c,\n 0xa830, 0xa839,\n 0xa840, 0xa877,\n 0xa880, 0xa8c5,\n 0xa8ce, 0xa8d9,\n 0xa8e0, 0xa953,\n 0xa95f, 0xa97c,\n 0xa980, 0xa9cd,\n 0xa9cf, 0xa9d9,\n 0xa9de, 0xa9fe,\n 0xaa00, 0xaa36,\n 0xaa40, 0xaa4d,\n 0xaa50, 0xaa59,\n 0xaa5c, 0xaac2,\n 0xaadb, 0xaaf6,\n 0xab01, 0xab06,\n 0xab09, 0xab0e,\n 0xab11, 0xab16,\n 0xab20, 0xab26,\n 0xab28, 0xab2e,\n 0xab30, 0xab6b,\n 0xab70, 0xabed,\n 0xabf0, 0xabf9,\n 0xac00, 0xd7a3,\n 0xd7b0, 0xd7c6,\n 0xd7cb, 0xd7fb,\n 0xf900, 0xfa6d,\n 0xfa70, 0xfad9,\n 0xfb00, 0xfb06,\n 0xfb13, 0xfb17,\n 0xfb1d, 0xfb36,\n 0xfb38, 0xfb3c,\n 0xfb3e, 0xfb3e,\n 0xfb40, 0xfb41,\n 0xfb43, 0xfb44,\n 0xfb46, 0xfbc2,\n 0xfbd3, 0xfd8f,\n 0xfd92, 0xfdc7,\n 0xfdcf, 0xfdcf,\n 0xfdf0, 0xfe19,\n 0xfe20, 0xfe52,\n 0xfe54, 0xfe66,\n 0xfe68, 0xfe6b,\n 0xfe70, 0xfe74,\n 0xfe76, 0xfefc,\n 0xfeff, 0xfeff,\n 0xff01, 0xffbe,\n 0xffc2, 0xffc7,\n 0xffca, 0xffcf,\n 0xffd2, 0xffd7,\n 0xffda, 0xffdc,\n 0xffe0, 0xffe6,\n 0xffe8, 0xffee,\n 0xfff9, 0xfffc,\n 0x10000, 0x1000b,\n 0x1000d, 0x10026,\n 0x10028, 0x1003a,\n 0x1003c, 0x1003d,\n 0x1003f, 0x1004d,\n 0x10050, 0x1005d,\n 0x10080, 0x100fa,\n 0x10100, 0x10102,\n 0x10107, 0x10133,\n 0x10137, 0x1018e,\n 0x10190, 0x1019c,\n 0x101a0, 0x101a0,\n 0x101d0, 0x101fd,\n 0x10280, 0x1029c,\n 0x102a0, 0x102d0,\n 0x102e0, 0x102fb,\n 0x10300, 0x10323,\n 0x1032d, 0x1034a,\n 0x10350, 0x1037a,\n 0x10380, 0x1039d,\n 0x1039f, 0x103c3,\n 0x103c8, 0x103d5,\n 0x10400, 0x1049d,\n 0x104a0, 0x104a9,\n 0x104b0, 0x104d3,\n 0x104d8, 0x104fb,\n 0x10500, 0x10527,\n 0x10530, 0x10563,\n 0x1056f, 0x1057a,\n 0x1057c, 0x1058a,\n 0x1058c, 0x10592,\n 0x10594, 0x10595,\n 0x10597, 0x105a1,\n 0x105a3, 0x105b1,\n 0x105b3, 0x105b9,\n 0x105bb, 0x105bc,\n 0x10600, 0x10736,\n 0x10740, 0x10755,\n 0x10760, 0x10767,\n 0x10780, 0x10785,\n 0x10787, 0x107b0,\n 0x107b2, 0x107ba,\n 0x10800, 0x10805,\n 0x10808, 0x10808,\n 0x1080a, 0x10835,\n 0x10837, 0x10838,\n 0x1083c, 0x1083c,\n 0x1083f, 0x10855,\n 0x10857, 0x1089e,\n 0x108a7, 0x108af,\n 0x108e0, 0x108f2,\n 0x108f4, 0x108f5,\n 0x108fb, 0x1091b,\n 0x1091f, 0x10939,\n 0x1093f, 0x1093f,\n 0x10980, 0x109b7,\n 0x109bc, 0x109cf,\n 0x109d2, 0x10a03,\n 0x10a05, 0x10a06,\n 0x10a0c, 0x10a13,\n 0x10a15, 0x10a17,\n 0x10a19, 0x10a35,\n 0x10a38, 0x10a3a,\n 0x10a3f, 0x10a48,\n 0x10a50, 0x10a58,\n 0x10a60, 0x10a9f,\n 0x10ac0, 0x10ae6,\n 0x10aeb, 0x10af6,\n 0x10b00, 0x10b35,\n 0x10b39, 0x10b55,\n 0x10b58, 0x10b72,\n 0x10b78, 0x10b91,\n 0x10b99, 0x10b9c,\n 0x10ba9, 0x10baf,\n 0x10c00, 0x10c48,\n 0x10c80, 0x10cb2,\n 0x10cc0, 0x10cf2,\n 0x10cfa, 0x10d27,\n 0x10d30, 0x10d39,\n 0x10e60, 0x10e7e,\n 0x10e80, 0x10ea9,\n 0x10eab, 0x10ead,\n 0x10eb0, 0x10eb1,\n 0x10efd, 0x10f27,\n 0x10f30, 0x10f59,\n 0x10f70, 0x10f89,\n 0x10fb0, 0x10fcb,\n 0x10fe0, 0x10ff6,\n 0x11000, 0x1104d,\n 0x11052, 0x11075,\n 0x1107f, 0x110c2,\n 0x110cd, 0x110cd,\n 0x110d0, 0x110e8,\n 0x110f0, 0x110f9,\n 0x11100, 0x11134,\n 0x11136, 0x11147,\n 0x11150, 0x11176,\n 0x11180, 0x111df,\n 0x111e1, 0x111f4,\n 0x11200, 0x11211,\n 0x11213, 0x11241,\n 0x11280, 0x11286,\n 0x11288, 0x11288,\n 0x1128a, 0x1128d,\n 0x1128f, 0x1129d,\n 0x1129f, 0x112a9,\n 0x112b0, 0x112ea,\n 0x112f0, 0x112f9,\n 0x11300, 0x11303,\n 0x11305, 0x1130c,\n 0x1130f, 0x11310,\n 0x11313, 0x11328,\n 0x1132a, 0x11330,\n 0x11332, 0x11333,\n 0x11335, 0x11339,\n 0x1133b, 0x11344,\n 0x11347, 0x11348,\n 0x1134b, 0x1134d,\n 0x11350, 0x11350,\n 0x11357, 0x11357,\n 0x1135d, 0x11363,\n 0x11366, 0x1136c,\n 0x11370, 0x11374,\n 0x11400, 0x1145b,\n 0x1145d, 0x11461,\n 0x11480, 0x114c7,\n 0x114d0, 0x114d9,\n 0x11580, 0x115b5,\n 0x115b8, 0x115dd,\n 0x11600, 0x11644,\n 0x11650, 0x11659,\n 0x11660, 0x1166c,\n 0x11680, 0x116b9,\n 0x116c0, 0x116c9,\n 0x11700, 0x1171a,\n 0x1171d, 0x1172b,\n 0x11730, 0x11746,\n 0x11800, 0x1183b,\n 0x118a0, 0x118f2,\n 0x118ff, 0x11906,\n 0x11909, 0x11909,\n 0x1190c, 0x11913,\n 0x11915, 0x11916,\n 0x11918, 0x11935,\n 0x11937, 0x11938,\n 0x1193b, 0x11946,\n 0x11950, 0x11959,\n 0x119a0, 0x119a7,\n 0x119aa, 0x119d7,\n 0x119da, 0x119e4,\n 0x11a00, 0x11a47,\n 0x11a50, 0x11aa2,\n 0x11ab0, 0x11af8,\n 0x11b00, 0x11b09,\n 0x11c00, 0x11c08,\n 0x11c0a, 0x11c36,\n 0x11c38, 0x11c45,\n 0x11c50, 0x11c6c,\n 0x11c70, 0x11c8f,\n 0x11c92, 0x11ca7,\n 0x11ca9, 0x11cb6,\n 0x11d00, 0x11d06,\n 0x11d08, 0x11d09,\n 0x11d0b, 0x11d36,\n 0x11d3a, 0x11d3a,\n 0x11d3c, 0x11d3d,\n 0x11d3f, 0x11d47,\n 0x11d50, 0x11d59,\n 0x11d60, 0x11d65,\n 0x11d67, 0x11d68,\n 0x11d6a, 0x11d8e,\n 0x11d90, 0x11d91,\n 0x11d93, 0x11d98,\n 0x11da0, 0x11da9,\n 0x11ee0, 0x11ef8,\n 0x11f00, 0x11f10,\n 0x11f12, 0x11f3a,\n 0x11f3e, 0x11f59,\n 0x11fb0, 0x11fb0,\n 0x11fc0, 0x11ff1,\n 0x11fff, 0x12399,\n 0x12400, 0x1246e,\n 0x12470, 0x12474,\n 0x12480, 0x12543,\n 0x12f90, 0x12ff2,\n 0x13000, 0x13455,\n 0x14400, 0x14646,\n 0x16800, 0x16a38,\n 0x16a40, 0x16a5e,\n 0x16a60, 0x16a69,\n 0x16a6e, 0x16abe,\n 0x16ac0, 0x16ac9,\n 0x16ad0, 0x16aed,\n 0x16af0, 0x16af5,\n 0x16b00, 0x16b45,\n 0x16b50, 0x16b59,\n 0x16b5b, 0x16b61,\n 0x16b63, 0x16b77,\n 0x16b7d, 0x16b8f,\n 0x16e40, 0x16e9a,\n 0x16f00, 0x16f4a,\n 0x16f4f, 0x16f87,\n 0x16f8f, 0x16f9f,\n 0x16fe0, 0x16fe4,\n 0x16ff0, 0x16ff1,\n 0x17000, 0x187f7,\n 0x18800, 0x18cd5,\n 0x18d00, 0x18d08,\n 0x1aff0, 0x1aff3,\n 0x1aff5, 0x1affb,\n 0x1affd, 0x1affe,\n 0x1b000, 0x1b122,\n 0x1b132, 0x1b132,\n 0x1b150, 0x1b152,\n 0x1b155, 0x1b155,\n 0x1b164, 0x1b167,\n 0x1b170, 0x1b2fb,\n 0x1bc00, 0x1bc6a,\n 0x1bc70, 0x1bc7c,\n 0x1bc80, 0x1bc88,\n 0x1bc90, 0x1bc99,\n 0x1bc9c, 0x1bca3,\n 0x1cf00, 0x1cf2d,\n 0x1cf30, 0x1cf46,\n 0x1cf50, 0x1cfc3,\n 0x1d000, 0x1d0f5,\n 0x1d100, 0x1d126,\n 0x1d129, 0x1d1ea,\n 0x1d200, 0x1d245,\n 0x1d2c0, 0x1d2d3,\n 0x1d2e0, 0x1d2f3,\n 0x1d300, 0x1d356,\n 0x1d360, 0x1d378,\n 0x1d400, 0x1d454,\n 0x1d456, 0x1d49c,\n 0x1d49e, 0x1d49f,\n 0x1d4a2, 0x1d4a2,\n 0x1d4a5, 0x1d4a6,\n 0x1d4a9, 0x1d4ac,\n 0x1d4ae, 0x1d4b9,\n 0x1d4bb, 0x1d4bb,\n 0x1d4bd, 0x1d4c3,\n 0x1d4c5, 0x1d505,\n 0x1d507, 0x1d50a,\n 0x1d50d, 0x1d514,\n 0x1d516, 0x1d51c,\n 0x1d51e, 0x1d539,\n 0x1d53b, 0x1d53e,\n 0x1d540, 0x1d544,\n 0x1d546, 0x1d546,\n 0x1d54a, 0x1d550,\n 0x1d552, 0x1d6a5,\n 0x1d6a8, 0x1d7cb,\n 0x1d7ce, 0x1da8b,\n 0x1da9b, 0x1da9f,\n 0x1daa1, 0x1daaf,\n 0x1df00, 0x1df1e,\n 0x1df25, 0x1df2a,\n 0x1e000, 0x1e006,\n 0x1e008, 0x1e018,\n 0x1e01b, 0x1e021,\n 0x1e023, 0x1e024,\n 0x1e026, 0x1e02a,\n 0x1e030, 0x1e06d,\n 0x1e08f, 0x1e08f,\n 0x1e100, 0x1e12c,\n 0x1e130, 0x1e13d,\n 0x1e140, 0x1e149,\n 0x1e14e, 0x1e14f,\n 0x1e290, 0x1e2ae,\n 0x1e2c0, 0x1e2f9,\n 0x1e2ff, 0x1e2ff,\n 0x1e4d0, 0x1e4f9,\n 0x1e7e0, 0x1e7e6,\n 0x1e7e8, 0x1e7eb,\n 0x1e7ed, 0x1e7ee,\n 0x1e7f0, 0x1e7fe,\n 0x1e800, 0x1e8c4,\n 0x1e8c7, 0x1e8d6,\n 0x1e900, 0x1e94b,\n 0x1e950, 0x1e959,\n 0x1e95e, 0x1e95f,\n 0x1ec71, 0x1ecb4,\n 0x1ed01, 0x1ed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 0x1f859,\n 0x1f860, 0x1f887,\n 0x1f890, 0x1f8ad,\n 0x1f8b0, 0x1f8b1,\n 0x1f900, 0x1fa53,\n 0x1fa60, 0x1fa6d,\n 0x1fa70, 0x1fa7c,\n 0x1fa80, 0x1fa88,\n 0x1fa90, 0x1fabd,\n 0x1fabf, 0x1fac5,\n 0x1face, 0x1fadb,\n 0x1fae0, 0x1fae8,\n 0x1faf0, 0x1faf8,\n 0x1fb00, 0x1fb92,\n 0x1fb94, 0x1fbca,\n 0x1fbf0, 0x1fbf9,\n 0x20000, 0x2a6df,\n 0x2a700, 0x2b739,\n 0x2b740, 0x2b81d,\n 0x2b820, 0x2cea1,\n 0x2ceb0, 0x2ebe0,\n 0x2f800, 0x2fa1d,\n 0x30000, 0x3134a,\n 0x31350, 0x323af,\n 0xe0001, 0xe0001,\n 0xe0020, 0xe007f,\n 0xe0100, 0xe01ef,\n];\n", "import { nonAsciiIdentifierMap } from \"./nonascii.js\";\n\nexport const enum CharCode {\n Null = 0x00,\n MaxAscii = 0x7f,\n ByteOrderMark = 0xfeff,\n\n // Line breaks\n LineFeed = 0x0a,\n CarriageReturn = 0x0d,\n\n // ASCII whitespace excluding line breaks\n Space = 0x20,\n Tab = 0x09,\n VerticalTab = 0x0b,\n FormFeed = 0x0c,\n\n // Non-ASCII whitespace excluding line breaks\n NextLine = 0x0085, // not considered a line break\n LeftToRightMark = 0x200e,\n RightToLeftMark = 0x200f,\n LineSeparator = 0x2028,\n ParagraphSeparator = 0x2029,\n\n // ASCII Digits\n _0 = 0x30,\n _1 = 0x31,\n _2 = 0x32,\n _3 = 0x33,\n _4 = 0x34,\n _5 = 0x35,\n _6 = 0x36,\n _7 = 0x37,\n _8 = 0x38,\n _9 = 0x39,\n\n // ASCII lowercase letters\n a = 0x61,\n b = 0x62,\n c = 0x63,\n d = 0x64,\n e = 0x65,\n f = 0x66,\n g = 0x67,\n h = 0x68,\n i = 0x69,\n j = 0x6a,\n k = 0x6b,\n l = 0x6c,\n m = 0x6d,\n n = 0x6e,\n o = 0x6f,\n p = 0x70,\n q = 0x71,\n r = 0x72,\n s = 0x73,\n t = 0x74,\n u = 0x75,\n v = 0x76,\n w = 0x77,\n x = 0x78,\n y = 0x79,\n z = 0x7a,\n\n // ASCII uppercase letters\n A = 0x41,\n B = 0x42,\n C = 0x43,\n D = 0x44,\n E = 0x45,\n F = 0x46,\n G = 0x47,\n H = 0x48,\n I = 0x49,\n J = 0x4a,\n K = 0x4b,\n L = 0x4c,\n M = 0x4d,\n N = 0x4e,\n O = 0x4f,\n P = 0x50,\n Q = 0x51,\n R = 0x52,\n S = 0x53,\n T = 0x54,\n U = 0x55,\n V = 0x56,\n W = 0x57,\n X = 0x58,\n Y = 0x59,\n Z = 0x5a,\n\n // Non-letter, non-digit ASCII characters that are valid in identifiers\n _ = 0x5f,\n $ = 0x24,\n\n // ASCII punctuation\n Ampersand = 0x26,\n Asterisk = 0x2a,\n At = 0x40,\n Backslash = 0x5c,\n Backtick = 0x60,\n Bar = 0x7c,\n Caret = 0x5e,\n CloseBrace = 0x7d,\n CloseBracket = 0x5d,\n CloseParen = 0x29,\n Colon = 0x3a,\n Comma = 0x2c,\n Dot = 0x2e,\n DoubleQuote = 0x22,\n Equals = 0x3d,\n Exclamation = 0x21,\n GreaterThan = 0x3e,\n Hash = 0x23,\n LessThan = 0x3c,\n Minus = 0x2d,\n OpenBrace = 0x7b,\n OpenBracket = 0x5b,\n OpenParen = 0x28,\n Percent = 0x25,\n Plus = 0x2b,\n Question = 0x3f,\n Semicolon = 0x3b,\n SingleQuote = 0x27,\n Slash = 0x2f,\n Tilde = 0x7e,\n}\n\nexport function utf16CodeUnits(codePoint: number) {\n return codePoint >= 0x10000 ? 2 : 1;\n}\n\nexport function isHighSurrogate(ch: number) {\n return ch >= 0xd800 && ch <= 0xdbff;\n}\n\nexport function isLowSurrogate(ch: number) {\n return ch >= 0xdc00 && ch <= 0xdfff;\n}\n\nexport function isLineBreak(ch: number) {\n return ch === CharCode.LineFeed || ch === CharCode.CarriageReturn;\n}\n\nexport function isAsciiWhiteSpaceSingleLine(ch: number) {\n return (\n ch === CharCode.Space ||\n ch === CharCode.Tab ||\n ch === CharCode.VerticalTab ||\n ch === CharCode.FormFeed\n );\n}\n\nexport function isNonAsciiWhiteSpaceSingleLine(ch: number) {\n return (\n ch === CharCode.NextLine || // not considered a line break\n ch === CharCode.LeftToRightMark ||\n ch === CharCode.RightToLeftMark ||\n ch === CharCode.LineSeparator ||\n ch === CharCode.ParagraphSeparator\n );\n}\n\nexport function isWhiteSpace(ch: number) {\n return isWhiteSpaceSingleLine(ch) || isLineBreak(ch);\n}\n\nexport function isWhiteSpaceSingleLine(ch: number) {\n return (\n isAsciiWhiteSpaceSingleLine(ch) ||\n (ch > CharCode.MaxAscii && isNonAsciiWhiteSpaceSingleLine(ch))\n );\n}\n\nexport function trim(str: string): string {\n let start = 0;\n let end = str.length - 1;\n\n if (!isWhiteSpace(str.charCodeAt(start)) && !isWhiteSpace(str.charCodeAt(end))) {\n return str;\n }\n\n while (isWhiteSpace(str.charCodeAt(start))) {\n start++;\n }\n\n while (isWhiteSpace(str.charCodeAt(end))) {\n end--;\n }\n\n return str.substring(start, end + 1);\n}\n\nexport function isDigit(ch: number) {\n return ch >= CharCode._0 && ch <= CharCode._9;\n}\n\nexport function isHexDigit(ch: number) {\n return (\n isDigit(ch) || (ch >= CharCode.A && ch <= CharCode.F) || (ch >= CharCode.a && ch <= CharCode.f)\n );\n}\n\nexport function isBinaryDigit(ch: number) {\n return ch === CharCode._0 || ch === CharCode._1;\n}\n\nexport function isLowercaseAsciiLetter(ch: number) {\n return ch >= CharCode.a && ch <= CharCode.z;\n}\n\nexport function isAsciiIdentifierStart(ch: number) {\n return (\n (ch >= CharCode.A && ch <= CharCode.Z) ||\n (ch >= CharCode.a && ch <= CharCode.z) ||\n ch === CharCode.$ ||\n ch === CharCode._\n );\n}\n\nexport function isAsciiIdentifierContinue(ch: number) {\n return (\n (ch >= CharCode.A && ch <= CharCode.Z) ||\n (ch >= CharCode.a && ch <= CharCode.z) ||\n (ch >= CharCode._0 && ch <= CharCode._9) ||\n ch === CharCode.$ ||\n ch === CharCode._\n );\n}\n\nexport function isIdentifierStart(codePoint: number) {\n return (\n isAsciiIdentifierStart(codePoint) ||\n (codePoint > CharCode.MaxAscii && isNonAsciiIdentifierCharacter(codePoint))\n );\n}\n\nexport function isIdentifierContinue(codePoint: number) {\n return (\n isAsciiIdentifierContinue(codePoint) ||\n (codePoint > CharCode.MaxAscii && isNonAsciiIdentifierCharacter(codePoint))\n );\n}\n\nexport function isNonAsciiIdentifierCharacter(codePoint: number) {\n return lookupInNonAsciiMap(codePoint, nonAsciiIdentifierMap);\n}\n\nexport function codePointBefore(\n text: string,\n pos: number,\n): { char: number | undefined; size: number } {\n if (pos <= 0 || pos > text.length) {\n return { char: undefined, size: 0 };\n }\n\n const ch = text.charCodeAt(pos - 1);\n if (!isLowSurrogate(ch) || !isHighSurrogate(text.charCodeAt(pos - 2))) {\n return { char: ch, size: 1 };\n }\n\n return { char: text.codePointAt(pos - 2), size: 2 };\n}\n\nfunction lookupInNonAsciiMap(codePoint: number, map: readonly number[]) {\n // Perform binary search in one of the Unicode range maps\n let lo = 0;\n let hi: number = map.length;\n let mid: number;\n\n while (lo + 1 < hi) {\n mid = lo + (hi - lo) / 2;\n // mid has to be even to catch a range's beginning\n mid -= mid % 2;\n if (map[mid] <= codePoint && codePoint <= map[mid + 1]) {\n return true;\n }\n\n if (codePoint < map[mid]) {\n hi = mid;\n } else {\n lo = mid + 2;\n }\n }\n\n return false;\n}\n", "import { CharCode, isIdentifierContinue, isIdentifierStart, utf16CodeUnits } from \"../charcode.js\";\nimport { Keywords, ReservedKeywords } from \"../scanner.js\";\nimport { IdentifierNode, MemberExpressionNode, SyntaxKind, TypeReferenceNode } from \"../types.js\";\n\n/**\n * Print a string as a TypeSpec identifier. If the string is a valid identifier, return it as is otherwise wrap it into backticks.\n * @param sv Identifier string value.\n * @returns Identifier string as it would be represented in a TypeSpec file.\n *\n * @example\n * ```ts\n * printIdentifier(\"foo\") // foo\n * printIdentifier(\"foo bar\") // `foo bar`\n * ```\n */\nexport function printIdentifier(\n sv: string,\n /** @internal */ context: \"allow-reserved\" | \"disallow-reserved\" = \"disallow-reserved\",\n) {\n if (needBacktick(sv, context)) {\n const escapedString = sv\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\")\n .replace(/`/g, \"\\\\`\");\n return `\\`${escapedString}\\``;\n } else {\n return sv;\n }\n}\n\nfunction needBacktick(sv: string, context: \"allow-reserved\" | \"disallow-reserved\"): boolean {\n if (sv.length === 0) {\n return false;\n }\n if (context === \"allow-reserved\" && ReservedKeywords.has(sv)) {\n return false;\n }\n if (Keywords.has(sv)) {\n return true;\n }\n let cp = sv.codePointAt(0)!;\n if (!isIdentifierStart(cp)) {\n return true;\n }\n let pos = 0;\n do {\n pos += utf16CodeUnits(cp);\n } while (pos < sv.length && isIdentifierContinue((cp = sv.codePointAt(pos)!)));\n return pos < sv.length;\n}\n\nexport function typeReferenceToString(\n node: TypeReferenceNode | MemberExpressionNode | IdentifierNode,\n): string {\n switch (node.kind) {\n case SyntaxKind.MemberExpression:\n return `${typeReferenceToString(node.base)}${node.selector}${typeReferenceToString(node.id)}`;\n case SyntaxKind.TypeReference:\n return typeReferenceToString(node.target);\n case SyntaxKind.Identifier:\n return node.sv;\n }\n}\n\nexport function splitLines(text: string): string[] {\n const lines = [];\n let start = 0;\n let pos = 0;\n\n while (pos < text.length) {\n const ch = text.charCodeAt(pos);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (text.charCodeAt(pos + 1) === CharCode.LineFeed) {\n lines.push(text.slice(start, pos));\n start = pos + 2;\n pos++;\n } else {\n lines.push(text.slice(start, pos));\n start = pos + 1;\n }\n break;\n case CharCode.LineFeed:\n lines.push(text.slice(start, pos));\n start = pos + 1;\n break;\n }\n pos++;\n }\n\n lines.push(text.slice(start));\n return lines;\n}\n", "import { isWhiteSpaceSingleLine } from \"../charcode.js\";\nimport { defineCodeFix } from \"../diagnostics.js\";\nimport { splitLines } from \"../helpers/syntax-utils.js\";\nimport type { SourceLocation } from \"../types.js\";\n\nexport function createTripleQuoteIndentCodeFix(location: SourceLocation) {\n return defineCodeFix({\n id: \"triple-quote-indent\",\n label: \"Format triple-quote-indent\",\n fix: (context) => {\n const splitStr = \"\\n\";\n const tripleQuote = '\"\"\"';\n const tripleQuoteLen = tripleQuote.length;\n const text = location.file.text.slice(\n location.pos + tripleQuoteLen,\n location.end - tripleQuoteLen,\n );\n\n const lines = splitLines(text);\n if (lines.length === 0) {\n return;\n }\n\n if (lines.length === 1) {\n const indentNumb = getIndentNumbInLine(lines[0]);\n const prefix = \" \".repeat(indentNumb);\n return context.replaceText(\n location,\n [tripleQuote, lines[0], `${prefix}${tripleQuote}`].join(splitStr),\n );\n }\n\n if (lines[0].trim() === \"\") {\n lines.shift();\n }\n\n const lastLine = lines[lines.length - 1];\n if (lastLine.trim() === \"\") {\n lines.pop();\n }\n\n let prefix = \"\";\n const minIndentNumb = Math.min(...lines.map((line) => getIndentNumbInLine(line)));\n const lastLineIndentNumb = getIndentNumbInLine(lastLine);\n if (minIndentNumb < lastLineIndentNumb) {\n const indentDiff = lastLineIndentNumb - minIndentNumb;\n prefix = \" \".repeat(indentDiff);\n }\n\n const middle = lines.map((line) => `${prefix}${line}`).join(splitStr);\n return context.replaceText(\n location,\n `${tripleQuote}${splitStr}${middle}${splitStr}${\" \".repeat(lastLineIndentNumb)}${tripleQuote}`,\n );\n\n function getIndentNumbInLine(lineText: string): number {\n let curStart = 0;\n while (\n curStart < lineText.length &&\n isWhiteSpaceSingleLine(lineText.charCodeAt(curStart))\n ) {\n curStart++;\n }\n return curStart;\n }\n },\n });\n}\n", "import {\n CharCode,\n codePointBefore,\n isAsciiIdentifierContinue,\n isAsciiIdentifierStart,\n isBinaryDigit,\n isDigit,\n isHexDigit,\n isIdentifierContinue,\n isIdentifierStart,\n isLineBreak,\n isLowercaseAsciiLetter,\n isNonAsciiIdentifierCharacter,\n isNonAsciiWhiteSpaceSingleLine,\n isWhiteSpace,\n isWhiteSpaceSingleLine,\n utf16CodeUnits,\n} from \"./charcode.js\";\nimport { createTripleQuoteIndentCodeFix } from \"./compiler-code-fixes/triple-quote-indent.codefix.js\";\nimport { DiagnosticHandler, compilerAssert } from \"./diagnostics.js\";\nimport { CompilerDiagnostics, createDiagnostic } from \"./messages.js\";\nimport { getCommentAtPosition } from \"./parser-utils.js\";\nimport { createSourceFile } from \"./source-file.js\";\nimport { DiagnosticReport, SourceFile, TextRange, TypeSpecScriptNode } from \"./types.js\";\n\n// All conflict markers consist of the same character repeated seven times. If it is\n// a <<<<<<< or >>>>>>> marker then it is also followed by a space.\nconst mergeConflictMarkerLength = 7;\n\nexport enum Token {\n None,\n Invalid,\n EndOfFile,\n Identifier,\n NumericLiteral,\n StringLiteral,\n StringTemplateHead,\n StringTemplateMiddle,\n StringTemplateTail,\n // Add new tokens above if they don't fit any of the categories below\n\n ///////////////////////////////////////////////////////////////\n // Trivia\n /** @internal */ __StartTrivia,\n\n SingleLineComment = __StartTrivia,\n MultiLineComment,\n NewLine,\n Whitespace,\n ConflictMarker,\n // Add new trivia above\n\n /** @internal */ __EndTrivia,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Doc comment content\n /** @internal */ __StartDocComment = __EndTrivia,\n DocText = __StartDocComment,\n DocCodeSpan,\n DocCodeFenceDelimiter,\n /** @internal */ __EndDocComment,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Punctuation\n /** @internal */ __StartPunctuation = __EndDocComment,\n\n OpenBrace = __StartPunctuation,\n CloseBrace,\n OpenParen,\n CloseParen,\n OpenBracket,\n CloseBracket,\n Dot,\n Ellipsis,\n Semicolon,\n Comma,\n LessThan,\n GreaterThan,\n Equals,\n Ampersand,\n Bar,\n Question,\n Colon,\n ColonColon,\n At,\n AtAt,\n Hash,\n HashBrace,\n HashBracket,\n Star,\n ForwardSlash,\n Plus,\n Hyphen,\n Exclamation,\n LessThanEquals,\n GreaterThanEquals,\n AmpsersandAmpersand,\n BarBar,\n EqualsEquals,\n ExclamationEquals,\n EqualsGreaterThan,\n // Add new punctuation above\n\n /** @internal */ __EndPunctuation,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Statement keywords\n /** @internal */ __StartKeyword = __EndPunctuation,\n /** @internal */ __StartStatementKeyword = __StartKeyword,\n\n ImportKeyword = __StartStatementKeyword,\n ModelKeyword,\n ScalarKeyword,\n NamespaceKeyword,\n UsingKeyword,\n OpKeyword,\n EnumKeyword,\n AliasKeyword,\n IsKeyword,\n InterfaceKeyword,\n UnionKeyword,\n ProjectionKeyword,\n ElseKeyword,\n IfKeyword,\n DecKeyword,\n FnKeyword,\n ConstKeyword,\n InitKeyword,\n // Add new statement keyword above\n\n /** @internal */ __EndStatementKeyword,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __StartModifierKeyword = __EndStatementKeyword,\n\n ExternKeyword = __StartModifierKeyword,\n\n /** @internal */ __EndModifierKeyword,\n ///////////////////////////////////////////////////////////////\n\n ///////////////////////////////////////////////////////////////\n // Other keywords\n\n ExtendsKeyword = __EndModifierKeyword,\n TrueKeyword,\n FalseKeyword,\n ReturnKeyword,\n VoidKeyword,\n NeverKeyword,\n UnknownKeyword,\n ValueOfKeyword,\n TypeOfKeyword,\n // Add new non-statement keyword above\n\n /** @internal */ __EndKeyword,\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __StartReservedKeyword = __EndKeyword,\n ///////////////////////////////////////////////////////////////\n // List of keywords that have special meaning in the language but are reserved for future use\n StatemachineKeyword = __StartReservedKeyword,\n MacroKeyword,\n PackageKeyword,\n MetadataKeyword,\n EnvKeyword,\n ArgKeyword,\n DeclareKeyword,\n ArrayKeyword,\n StructKeyword,\n RecordKeyword,\n ModuleKeyword,\n ModKeyword,\n SymKeyword,\n ContextKeyword,\n PropKeyword,\n PropertyKeyword,\n ScenarioKeyword,\n PubKeyword,\n SubKeyword,\n TypeRefKeyword,\n TraitKeyword,\n ThisKeyword,\n SelfKeyword,\n SuperKeyword,\n KeyofKeyword,\n WithKeyword,\n ImplementsKeyword,\n ImplKeyword,\n SatisfiesKeyword,\n FlagKeyword,\n AutoKeyword,\n PartialKeyword,\n PrivateKeyword,\n PublicKeyword,\n ProtectedKeyword,\n InternalKeyword,\n SealedKeyword,\n LocalKeyword,\n AsyncKeyword,\n\n /** @internal */ __EndReservedKeyword,\n ///////////////////////////////////////////////////////////////\n\n /** @internal */ __Count = __EndReservedKeyword,\n}\n\nexport type DocToken =\n | Token.NewLine\n | Token.Whitespace\n | Token.ConflictMarker\n | Token.Star\n | Token.At\n | Token.CloseBrace\n | Token.Identifier\n | Token.Hyphen\n | Token.DocText\n | Token.DocCodeSpan\n | Token.DocCodeFenceDelimiter\n | Token.EndOfFile;\n\nexport type StringTemplateToken =\n | Token.StringTemplateHead\n | Token.StringTemplateMiddle\n | Token.StringTemplateTail;\n\n/** @internal */\nexport const TokenDisplay = getTokenDisplayTable([\n [Token.None, \"none\"],\n [Token.Invalid, \"invalid\"],\n [Token.EndOfFile, \"end of file\"],\n [Token.SingleLineComment, \"single-line comment\"],\n [Token.MultiLineComment, \"multi-line comment\"],\n [Token.ConflictMarker, \"conflict marker\"],\n [Token.NumericLiteral, \"numeric literal\"],\n [Token.StringLiteral, \"string literal\"],\n [Token.StringTemplateHead, \"string template head\"],\n [Token.StringTemplateMiddle, \"string template middle\"],\n [Token.StringTemplateTail, \"string template tail\"],\n [Token.NewLine, \"newline\"],\n [Token.Whitespace, \"whitespace\"],\n [Token.DocCodeFenceDelimiter, \"doc code fence delimiter\"],\n [Token.DocCodeSpan, \"doc code span\"],\n [Token.DocText, \"doc text\"],\n [Token.OpenBrace, \"'{'\"],\n [Token.CloseBrace, \"'}'\"],\n [Token.OpenParen, \"'('\"],\n [Token.CloseParen, \"')'\"],\n [Token.OpenBracket, \"'['\"],\n [Token.CloseBracket, \"']'\"],\n [Token.Dot, \"'.'\"],\n [Token.Ellipsis, \"'...'\"],\n [Token.Semicolon, \"';'\"],\n [Token.Comma, \"','\"],\n [Token.LessThan, \"'<'\"],\n [Token.GreaterThan, \"'>'\"],\n [Token.Equals, \"'='\"],\n [Token.Ampersand, \"'&'\"],\n [Token.Bar, \"'|'\"],\n [Token.Question, \"'?'\"],\n [Token.Colon, \"':'\"],\n [Token.ColonColon, \"'::'\"],\n [Token.At, \"'@'\"],\n [Token.AtAt, \"'@@'\"],\n [Token.Hash, \"'#'\"],\n [Token.HashBrace, \"'#{'\"],\n [Token.HashBracket, \"'#['\"],\n [Token.Star, \"'*'\"],\n [Token.ForwardSlash, \"'/'\"],\n [Token.Plus, \"'+'\"],\n [Token.Hyphen, \"'-'\"],\n [Token.Exclamation, \"'!'\"],\n [Token.LessThanEquals, \"'<='\"],\n [Token.GreaterThanEquals, \"'>='\"],\n [Token.AmpsersandAmpersand, \"'&&'\"],\n [Token.BarBar, \"'||'\"],\n [Token.EqualsEquals, \"'=='\"],\n [Token.ExclamationEquals, \"'!='\"],\n [Token.EqualsGreaterThan, \"'=>'\"],\n [Token.Identifier, \"identifier\"],\n [Token.ImportKeyword, \"'import'\"],\n [Token.ModelKeyword, \"'model'\"],\n [Token.ScalarKeyword, \"'scalar'\"],\n [Token.NamespaceKeyword, \"'namespace'\"],\n [Token.UsingKeyword, \"'using'\"],\n [Token.OpKeyword, \"'op'\"],\n [Token.EnumKeyword, \"'enum'\"],\n [Token.AliasKeyword, \"'alias'\"],\n [Token.IsKeyword, \"'is'\"],\n [Token.InterfaceKeyword, \"'interface'\"],\n [Token.UnionKeyword, \"'union'\"],\n [Token.ProjectionKeyword, \"'projection'\"],\n [Token.ElseKeyword, \"'else'\"],\n [Token.IfKeyword, \"'if'\"],\n [Token.DecKeyword, \"'dec'\"],\n [Token.FnKeyword, \"'fn'\"],\n [Token.ValueOfKeyword, \"'valueof'\"],\n [Token.TypeOfKeyword, \"'typeof'\"],\n [Token.ConstKeyword, \"'const'\"],\n [Token.InitKeyword, \"'init'\"],\n [Token.ExtendsKeyword, \"'extends'\"],\n [Token.TrueKeyword, \"'true'\"],\n [Token.FalseKeyword, \"'false'\"],\n [Token.ReturnKeyword, \"'return'\"],\n [Token.VoidKeyword, \"'void'\"],\n [Token.NeverKeyword, \"'never'\"],\n [Token.UnknownKeyword, \"'unknown'\"],\n [Token.ExternKeyword, \"'extern'\"],\n\n // Reserved keywords\n [Token.StatemachineKeyword, \"'statemachine'\"],\n [Token.MacroKeyword, \"'macro'\"],\n [Token.PackageKeyword, \"'package'\"],\n [Token.MetadataKeyword, \"'metadata'\"],\n [Token.EnvKeyword, \"'env'\"],\n [Token.ArgKeyword, \"'arg'\"],\n [Token.DeclareKeyword, \"'declare'\"],\n [Token.ArrayKeyword, \"'array'\"],\n [Token.StructKeyword, \"'struct'\"],\n [Token.RecordKeyword, \"'record'\"],\n [Token.ModuleKeyword, \"'module'\"],\n [Token.ModKeyword, \"'mod'\"],\n [Token.SymKeyword, \"'sym'\"],\n [Token.ContextKeyword, \"'context'\"],\n [Token.PropKeyword, \"'prop'\"],\n [Token.PropertyKeyword, \"'property'\"],\n [Token.ScenarioKeyword, \"'scenario'\"],\n [Token.PubKeyword, \"'pub'\"],\n [Token.SubKeyword, \"'sub'\"],\n [Token.TypeRefKeyword, \"'typeref'\"],\n [Token.TraitKeyword, \"'trait'\"],\n [Token.ThisKeyword, \"'this'\"],\n [Token.SelfKeyword, \"'self'\"],\n [Token.SuperKeyword, \"'super'\"],\n [Token.KeyofKeyword, \"'keyof'\"],\n [Token.WithKeyword, \"'with'\"],\n [Token.ImplementsKeyword, \"'implements'\"],\n [Token.ImplKeyword, \"'impl'\"],\n [Token.SatisfiesKeyword, \"'satisfies'\"],\n [Token.FlagKeyword, \"'flag'\"],\n [Token.AutoKeyword, \"'auto'\"],\n [Token.PartialKeyword, \"'partial'\"],\n [Token.PrivateKeyword, \"'private'\"],\n [Token.PublicKeyword, \"'public'\"],\n [Token.ProtectedKeyword, \"'protected'\"],\n [Token.InternalKeyword, \"'internal'\"],\n [Token.SealedKeyword, \"'sealed'\"],\n [Token.LocalKeyword, \"'local'\"],\n [Token.AsyncKeyword, \"'async'\"],\n]);\n\n/** @internal */\nexport const Keywords: ReadonlyMap<string, Token> = new Map([\n [\"import\", Token.ImportKeyword],\n [\"model\", Token.ModelKeyword],\n [\"scalar\", Token.ScalarKeyword],\n [\"namespace\", Token.NamespaceKeyword],\n [\"interface\", Token.InterfaceKeyword],\n [\"union\", Token.UnionKeyword],\n [\"if\", Token.IfKeyword],\n [\"else\", Token.ElseKeyword],\n [\"projection\", Token.ProjectionKeyword],\n [\"using\", Token.UsingKeyword],\n [\"op\", Token.OpKeyword],\n [\"extends\", Token.ExtendsKeyword],\n [\"is\", Token.IsKeyword],\n [\"enum\", Token.EnumKeyword],\n [\"alias\", Token.AliasKeyword],\n [\"dec\", Token.DecKeyword],\n [\"fn\", Token.FnKeyword],\n [\"valueof\", Token.ValueOfKeyword],\n [\"typeof\", Token.TypeOfKeyword],\n [\"const\", Token.ConstKeyword],\n [\"init\", Token.InitKeyword],\n [\"true\", Token.TrueKeyword],\n [\"false\", Token.FalseKeyword],\n [\"return\", Token.ReturnKeyword],\n [\"void\", Token.VoidKeyword],\n [\"never\", Token.NeverKeyword],\n [\"unknown\", Token.UnknownKeyword],\n [\"extern\", Token.ExternKeyword],\n\n // Reserved keywords\n [\"statemachine\", Token.StatemachineKeyword],\n [\"macro\", Token.MacroKeyword],\n [\"package\", Token.PackageKeyword],\n [\"metadata\", Token.MetadataKeyword],\n [\"env\", Token.EnvKeyword],\n [\"arg\", Token.ArgKeyword],\n [\"declare\", Token.DeclareKeyword],\n [\"array\", Token.ArrayKeyword],\n [\"struct\", Token.StructKeyword],\n [\"record\", Token.RecordKeyword],\n [\"module\", Token.ModuleKeyword],\n [\"mod\", Token.ModKeyword],\n [\"sym\", Token.SymKeyword],\n [\"context\", Token.ContextKeyword],\n [\"prop\", Token.PropKeyword],\n [\"property\", Token.PropertyKeyword],\n [\"scenario\", Token.ScenarioKeyword],\n [\"pub\", Token.PubKeyword],\n [\"sub\", Token.SubKeyword],\n [\"typeref\", Token.TypeRefKeyword],\n [\"trait\", Token.TraitKeyword],\n [\"this\", Token.ThisKeyword],\n [\"self\", Token.SelfKeyword],\n [\"super\", Token.SuperKeyword],\n [\"keyof\", Token.KeyofKeyword],\n [\"with\", Token.WithKeyword],\n [\"implements\", Token.ImplementsKeyword],\n [\"impl\", Token.ImplKeyword],\n [\"satisfies\", Token.SatisfiesKeyword],\n [\"flag\", Token.FlagKeyword],\n [\"auto\", Token.AutoKeyword],\n [\"partial\", Token.PartialKeyword],\n [\"private\", Token.PrivateKeyword],\n [\"public\", Token.PublicKeyword],\n [\"protected\", Token.ProtectedKeyword],\n [\"internal\", Token.InternalKeyword],\n [\"sealed\", Token.SealedKeyword],\n [\"local\", Token.LocalKeyword],\n [\"async\", Token.AsyncKeyword],\n]);\n/** @internal */\nexport const ReservedKeywords: ReadonlyMap<string, Token> = new Map([\n // Reserved keywords\n [\"statemachine\", Token.StatemachineKeyword],\n [\"macro\", Token.MacroKeyword],\n [\"package\", Token.PackageKeyword],\n [\"metadata\", Token.MetadataKeyword],\n [\"env\", Token.EnvKeyword],\n [\"arg\", Token.ArgKeyword],\n [\"declare\", Token.DeclareKeyword],\n [\"array\", Token.ArrayKeyword],\n [\"struct\", Token.StructKeyword],\n [\"record\", Token.RecordKeyword],\n [\"module\", Token.ModuleKeyword],\n [\"mod\", Token.ModuleKeyword],\n [\"sym\", Token.SymKeyword],\n [\"context\", Token.ContextKeyword],\n [\"prop\", Token.PropKeyword],\n [\"property\", Token.PropertyKeyword],\n [\"scenario\", Token.ScenarioKeyword],\n [\"trait\", Token.TraitKeyword],\n [\"this\", Token.ThisKeyword],\n [\"self\", Token.SelfKeyword],\n [\"super\", Token.SuperKeyword],\n [\"keyof\", Token.KeyofKeyword],\n [\"with\", Token.WithKeyword],\n [\"implements\", Token.ImplementsKeyword],\n [\"impl\", Token.ImplKeyword],\n [\"satisfies\", Token.SatisfiesKeyword],\n [\"flag\", Token.FlagKeyword],\n [\"auto\", Token.AutoKeyword],\n [\"partial\", Token.PartialKeyword],\n [\"private\", Token.PrivateKeyword],\n [\"public\", Token.PublicKeyword],\n [\"protected\", Token.ProtectedKeyword],\n [\"internal\", Token.InternalKeyword],\n [\"sealed\", Token.SealedKeyword],\n [\"local\", Token.LocalKeyword],\n [\"async\", Token.AsyncKeyword],\n]);\n\n/** @internal */\nexport const enum KeywordLimit {\n MinLength = 2,\n MaxLength = 12,\n}\n\nexport interface Scanner {\n /** The source code being scanned. */\n readonly file: SourceFile;\n\n /** The offset in UTF-16 code units to the current position at the start of the next token. */\n readonly position: number;\n\n /** The current token */\n readonly token: Token;\n\n /** The offset in UTF-16 code units to the start of the current token. */\n readonly tokenPosition: number;\n\n /** The flags on the current token. */\n readonly tokenFlags: TokenFlags;\n\n /** Advance one token. */\n scan(): Token;\n\n /** Advance one token inside DocComment. Use inside {@link scanRange} callback over DocComment range. */\n scanDoc(): DocToken;\n\n /**\n * Unconditionally back up and scan a template expression portion.\n * @param tokenFlags Token Flags for head StringTemplateToken\n */\n reScanStringTemplate(tokenFlags: TokenFlags): StringTemplateToken;\n\n /**\n * Finds the indent for the given triple quoted string.\n * @param start\n * @param end\n */\n findTripleQuotedStringIndent(start: number, end: number): [number, number];\n\n /**\n * Unindent and unescape the triple quoted string rawText\n */\n unindentAndUnescapeTripleQuotedString(\n start: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string;\n\n /** Reset the scanner to the given start and end positions, invoke the callback, and then restore scanner state. */\n scanRange<T>(range: TextRange, callback: () => T): T;\n\n /** Determine if the scanner has reached the end of the input. */\n eof(): boolean;\n\n /** The exact spelling of the current token. */\n getTokenText(): string;\n\n /**\n * The value of the current token.\n *\n * String literals are escaped and unquoted, identifiers are normalized,\n * and all other tokens return their exact spelling sames as\n * getTokenText().\n */\n getTokenValue(): string;\n}\n\nexport enum TokenFlags {\n None = 0,\n Escaped = 1 << 0,\n TripleQuoted = 1 << 1,\n Unterminated = 1 << 2,\n NonAscii = 1 << 3,\n DocComment = 1 << 4,\n Backticked = 1 << 5,\n}\n\nexport function isTrivia(token: Token) {\n return token >= Token.__StartTrivia && token < Token.__EndTrivia;\n}\n\nexport function isComment(token: Token): boolean {\n return token === Token.SingleLineComment || token === Token.MultiLineComment;\n}\n\nexport function isKeyword(token: Token) {\n return token >= Token.__StartKeyword && token < Token.__EndKeyword;\n}\n\n/** If is a keyword with no actual use right now but will be in the future. */\nexport function isReservedKeyword(token: Token) {\n return token >= Token.__StartReservedKeyword && token < Token.__EndReservedKeyword;\n}\n\nexport function isPunctuation(token: Token) {\n return token >= Token.__StartPunctuation && token < Token.__EndPunctuation;\n}\n\nexport function isModifier(token: Token) {\n return token >= Token.__StartModifierKeyword && token < Token.__EndModifierKeyword;\n}\n\nexport function isStatementKeyword(token: Token) {\n return token >= Token.__StartStatementKeyword && token < Token.__EndStatementKeyword;\n}\n\nexport function createScanner(\n source: string | SourceFile,\n diagnosticHandler: DiagnosticHandler,\n): Scanner {\n const file = typeof source === \"string\" ? createSourceFile(source, \"<anonymous file>\") : source;\n const input = file.text;\n let position = 0;\n let endPosition = input.length;\n let token = Token.None;\n let tokenPosition = -1;\n let tokenFlags = TokenFlags.None;\n // Skip BOM\n if (position < endPosition && input.charCodeAt(position) === CharCode.ByteOrderMark) {\n position++;\n }\n\n return {\n get position() {\n return position;\n },\n get token() {\n return token;\n },\n get tokenPosition() {\n return tokenPosition;\n },\n get tokenFlags() {\n return tokenFlags;\n },\n file,\n scan,\n scanRange,\n scanDoc,\n reScanStringTemplate,\n findTripleQuotedStringIndent,\n unindentAndUnescapeTripleQuotedString,\n eof,\n getTokenText,\n getTokenValue,\n };\n\n function eof() {\n return position >= endPosition;\n }\n\n function getTokenText() {\n return input.substring(tokenPosition, position);\n }\n\n function getTokenValue() {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateHead:\n case Token.StringTemplateMiddle:\n case Token.StringTemplateTail:\n return getStringTokenValue(token, tokenFlags);\n case Token.Identifier:\n return getIdentifierTokenValue();\n case Token.DocText:\n return getDocTextValue();\n default:\n return getTokenText();\n }\n }\n\n function lookAhead(offset: number) {\n const p = position + offset;\n if (p >= endPosition) {\n return Number.NaN;\n }\n return input.charCodeAt(p);\n }\n\n function scan(): Token {\n tokenPosition = position;\n tokenFlags = TokenFlags.None;\n\n if (!eof()) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (lookAhead(1) === CharCode.LineFeed) {\n position++;\n }\n // fallthrough\n case CharCode.LineFeed:\n return next(Token.NewLine);\n\n case CharCode.Space:\n case CharCode.Tab:\n case CharCode.VerticalTab:\n case CharCode.FormFeed:\n return scanWhitespace();\n\n case CharCode.OpenParen:\n return next(Token.OpenParen);\n\n case CharCode.CloseParen:\n return next(Token.CloseParen);\n\n case CharCode.Comma:\n return next(Token.Comma);\n\n case CharCode.Colon:\n return lookAhead(1) === CharCode.Colon ? next(Token.ColonColon, 2) : next(Token.Colon);\n\n case CharCode.Semicolon:\n return next(Token.Semicolon);\n\n case CharCode.OpenBracket:\n return next(Token.OpenBracket);\n\n case CharCode.CloseBracket:\n return next(Token.CloseBracket);\n\n case CharCode.OpenBrace:\n return next(Token.OpenBrace);\n\n case CharCode.CloseBrace:\n return next(Token.CloseBrace);\n\n case CharCode.At:\n return lookAhead(1) === CharCode.At ? next(Token.AtAt, 2) : next(Token.At);\n\n case CharCode.Hash:\n const ahead = lookAhead(1);\n switch (ahead) {\n case CharCode.OpenBrace:\n return next(Token.HashBrace, 2);\n case CharCode.OpenBracket:\n return next(Token.HashBracket, 2);\n default:\n return next(Token.Hash);\n }\n\n case CharCode.Plus:\n return isDigit(lookAhead(1)) ? scanSignedNumber() : next(Token.Plus);\n\n case CharCode.Minus:\n return isDigit(lookAhead(1)) ? scanSignedNumber() : next(Token.Hyphen);\n\n case CharCode.Asterisk:\n return next(Token.Star);\n\n case CharCode.Question:\n return next(Token.Question);\n\n case CharCode.Ampersand:\n return lookAhead(1) === CharCode.Ampersand\n ? next(Token.AmpsersandAmpersand, 2)\n : next(Token.Ampersand);\n\n case CharCode.Dot:\n return lookAhead(1) === CharCode.Dot && lookAhead(2) === CharCode.Dot\n ? next(Token.Ellipsis, 3)\n : next(Token.Dot);\n\n case CharCode.Slash:\n switch (lookAhead(1)) {\n case CharCode.Slash:\n return scanSingleLineComment();\n case CharCode.Asterisk:\n return scanMultiLineComment();\n }\n\n return next(Token.ForwardSlash);\n\n case CharCode._0:\n switch (lookAhead(1)) {\n case CharCode.x:\n return scanHexNumber();\n case CharCode.b:\n return scanBinaryNumber();\n }\n // fallthrough\n case CharCode._1:\n case CharCode._2:\n case CharCode._3:\n case CharCode._4:\n case CharCode._5:\n case CharCode._6:\n case CharCode._7:\n case CharCode._8:\n case CharCode._9:\n return scanNumber();\n\n case CharCode.LessThan:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Equals\n ? next(Token.LessThanEquals, 2)\n : next(Token.LessThan);\n\n case CharCode.GreaterThan:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Equals\n ? next(Token.GreaterThanEquals, 2)\n : next(Token.GreaterThan);\n\n case CharCode.Equals:\n if (atConflictMarker()) return scanConflictMarker();\n switch (lookAhead(1)) {\n case CharCode.Equals:\n return next(Token.EqualsEquals, 2);\n case CharCode.GreaterThan:\n return next(Token.EqualsGreaterThan, 2);\n }\n return next(Token.Equals);\n\n case CharCode.Bar:\n if (atConflictMarker()) return scanConflictMarker();\n return lookAhead(1) === CharCode.Bar ? next(Token.BarBar, 2) : next(Token.Bar);\n\n case CharCode.DoubleQuote:\n return lookAhead(1) === CharCode.DoubleQuote && lookAhead(2) === CharCode.DoubleQuote\n ? scanString(TokenFlags.TripleQuoted)\n : scanString(TokenFlags.None);\n\n case CharCode.Exclamation:\n return lookAhead(1) === CharCode.Equals\n ? next(Token.ExclamationEquals, 2)\n : next(Token.Exclamation);\n\n case CharCode.Backtick:\n return scanBacktickedIdentifier();\n\n default:\n if (isLowercaseAsciiLetter(ch)) {\n return scanIdentifierOrKeyword();\n }\n if (isAsciiIdentifierStart(ch)) {\n return scanIdentifier();\n }\n if (ch <= CharCode.MaxAscii) {\n return scanInvalidCharacter();\n }\n return scanNonAsciiToken();\n }\n }\n\n return (token = Token.EndOfFile);\n }\n\n function scanDoc(): DocToken {\n tokenPosition = position;\n tokenFlags = TokenFlags.None;\n\n if (!eof()) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.CarriageReturn:\n if (lookAhead(1) === CharCode.LineFeed) {\n position++;\n }\n // fallthrough\n case CharCode.LineFeed:\n return next(Token.NewLine);\n\n case CharCode.Backslash:\n if (lookAhead(1) === CharCode.At) {\n tokenFlags |= TokenFlags.Escaped;\n return next(Token.DocText, 2);\n }\n return next(Token.DocText);\n\n case CharCode.Space:\n case CharCode.Tab:\n case CharCode.VerticalTab:\n case CharCode.FormFeed:\n return scanWhitespace();\n\n case CharCode.CloseBrace:\n return next(Token.CloseBrace);\n\n case CharCode.At:\n return next(Token.At);\n\n case CharCode.Asterisk:\n return next(Token.Star);\n\n case CharCode.Backtick:\n return lookAhead(1) === CharCode.Backtick && lookAhead(2) === CharCode.Backtick\n ? next(Token.DocCodeFenceDelimiter, 3)\n : scanDocCodeSpan();\n\n case CharCode.LessThan:\n case CharCode.GreaterThan:\n case CharCode.Equals:\n case CharCode.Bar:\n if (atConflictMarker()) return scanConflictMarker();\n return next(Token.DocText);\n\n case CharCode.Minus:\n return next(Token.Hyphen);\n }\n\n if (isAsciiIdentifierStart(ch)) {\n return scanIdentifier();\n }\n\n if (ch <= CharCode.MaxAscii) {\n return next(Token.DocText);\n }\n\n const cp = input.codePointAt(position)!;\n if (isIdentifierStart(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n\n return scanUnknown(Token.DocText);\n }\n\n return (token = Token.EndOfFile);\n }\n\n function reScanStringTemplate(lastTokenFlags: TokenFlags): StringTemplateToken {\n position = tokenPosition;\n tokenFlags = TokenFlags.None;\n return scanStringTemplateSpan(lastTokenFlags);\n }\n\n function scanRange<T>(range: TextRange, callback: () => T): T {\n const savedPosition = position;\n const savedEndPosition = endPosition;\n const savedToken = token;\n const savedTokenPosition = tokenPosition;\n const savedTokenFlags = tokenFlags;\n\n position = range.pos;\n endPosition = range.end;\n token = Token.None;\n tokenPosition = -1;\n tokenFlags = TokenFlags.None;\n\n const result = callback();\n\n position = savedPosition;\n endPosition = savedEndPosition;\n token = savedToken;\n tokenPosition = savedTokenPosition;\n tokenFlags = savedTokenFlags;\n\n return result;\n }\n\n function next<T extends Token>(t: T, count = 1): T {\n position += count;\n return (token = t) as T;\n }\n\n function unterminated<T extends Token>(t: T): T {\n tokenFlags |= TokenFlags.Unterminated;\n error({ code: \"unterminated\", format: { token: TokenDisplay[t] } });\n return (token = t) as T;\n }\n\n function scanNonAsciiToken() {\n tokenFlags |= TokenFlags.NonAscii;\n const ch = input.charCodeAt(position);\n\n if (isNonAsciiWhiteSpaceSingleLine(ch)) {\n return scanWhitespace();\n }\n\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n\n return scanInvalidCharacter();\n }\n\n function scanInvalidCharacter(): Token.Invalid {\n token = scanUnknown(Token.Invalid);\n error({ code: \"invalid-character\" });\n return token;\n }\n\n function scanUnknown<T extends Token>(t: T): T {\n const codePoint = input.codePointAt(position)!;\n return (token = next(t, utf16CodeUnits(codePoint)));\n }\n\n function error<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: Omit<DiagnosticReport<CompilerDiagnostics, C, M>, \"target\">,\n pos?: number,\n end?: number,\n ) {\n const diagnostic = createDiagnostic({\n ...report,\n target: { file, pos: pos ?? tokenPosition, end: end ?? position },\n } as any);\n diagnosticHandler(diagnostic);\n }\n\n function scanWhitespace(): Token.Whitespace {\n do {\n position++;\n } while (!eof() && isWhiteSpaceSingleLine(input.charCodeAt(position)));\n\n return (token = Token.Whitespace);\n }\n\n function scanSignedNumber(): Token.NumericLiteral {\n position++; // consume '+/-'\n return scanNumber();\n }\n\n function scanNumber(): Token.NumericLiteral {\n scanKnownDigits();\n if (!eof() && input.charCodeAt(position) === CharCode.Dot) {\n position++;\n scanRequiredDigits();\n }\n if (!eof() && input.charCodeAt(position) === CharCode.e) {\n position++;\n const ch = input.charCodeAt(position);\n if (ch === CharCode.Plus || ch === CharCode.Minus) {\n position++;\n }\n scanRequiredDigits();\n }\n return (token = Token.NumericLiteral);\n }\n\n function scanKnownDigits(): void {\n do {\n position++;\n } while (!eof() && isDigit(input.charCodeAt(position)));\n }\n\n function scanRequiredDigits(): void {\n if (eof() || !isDigit(input.charCodeAt(position))) {\n error({ code: \"digit-expected\" });\n return;\n }\n scanKnownDigits();\n }\n\n function scanHexNumber(): Token.NumericLiteral {\n position += 2; // consume '0x'\n\n if (eof() || !isHexDigit(input.charCodeAt(position))) {\n error({ code: \"hex-digit-expected\" });\n return (token = Token.NumericLiteral);\n }\n do {\n position++;\n } while (!eof() && isHexDigit(input.charCodeAt(position)));\n\n return (token = Token.NumericLiteral);\n }\n\n function scanBinaryNumber(): Token.NumericLiteral {\n position += 2; // consume '0b'\n\n if (eof() || !isBinaryDigit(input.charCodeAt(position))) {\n error({ code: \"binary-digit-expected\" });\n return (token = Token.NumericLiteral);\n }\n do {\n position++;\n } while (!eof() && isBinaryDigit(input.charCodeAt(position)));\n\n return (token = Token.NumericLiteral);\n }\n\n function scanSingleLineComment(): Token.SingleLineComment {\n position = skipSingleLineComment(input, position, endPosition);\n return (token = Token.SingleLineComment);\n }\n\n function scanMultiLineComment(): Token.MultiLineComment {\n token = Token.MultiLineComment;\n if (lookAhead(2) === CharCode.Asterisk) {\n tokenFlags |= TokenFlags.DocComment;\n }\n const [newPosition, terminated] = skipMultiLineComment(input, position);\n position = newPosition;\n return terminated ? token : unterminated(token);\n }\n\n function scanDocCodeSpan(): Token.DocCodeSpan {\n position++; // consume '`'\n\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backtick:\n position++;\n return (token = Token.DocCodeSpan);\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n break loop;\n }\n }\n\n return unterminated(Token.DocCodeSpan);\n }\n\n function scanString(tokenFlags: TokenFlags): Token.StringLiteral | Token.StringTemplateHead {\n if (tokenFlags & TokenFlags.TripleQuoted) {\n position += 3; // consume '\"\"\"'\n } else {\n position++; // consume '\"'\n }\n\n return scanStringLiteralLike(tokenFlags, Token.StringTemplateHead, Token.StringLiteral);\n }\n\n function scanStringTemplateSpan(\n tokenFlags: TokenFlags,\n ): Token.StringTemplateMiddle | Token.StringTemplateTail {\n position++; // consume '{'\n\n return scanStringLiteralLike(tokenFlags, Token.StringTemplateMiddle, Token.StringTemplateTail);\n }\n\n function scanStringLiteralLike<M extends Token, T extends Token>(\n requestedTokenFlags: TokenFlags,\n template: M,\n tail: T,\n ): M | T {\n const multiLine = requestedTokenFlags & TokenFlags.TripleQuoted;\n tokenFlags = requestedTokenFlags;\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backslash:\n tokenFlags |= TokenFlags.Escaped;\n position++;\n if (eof()) {\n break loop;\n }\n continue;\n case CharCode.DoubleQuote:\n if (multiLine) {\n if (lookAhead(1) === CharCode.DoubleQuote && lookAhead(2) === CharCode.DoubleQuote) {\n position += 3;\n token = tail;\n return tail;\n } else {\n continue;\n }\n } else {\n position++;\n token = tail;\n return tail;\n }\n case CharCode.$:\n if (lookAhead(1) === CharCode.OpenBrace) {\n position += 2;\n token = template;\n return template;\n }\n continue;\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n if (multiLine) {\n continue;\n } else {\n break loop;\n }\n }\n }\n\n return unterminated(tail);\n }\n\n function getStringLiteralOffsetStart(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ) {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateHead:\n return tokenFlags & TokenFlags.TripleQuoted ? 3 : 1; // \"\"\" or \"\n default:\n return 1; // {\n }\n }\n\n function getStringLiteralOffsetEnd(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ) {\n switch (token) {\n case Token.StringLiteral:\n case Token.StringTemplateTail:\n return tokenFlags & TokenFlags.TripleQuoted ? 3 : 1; // \"\"\" or \"\n default:\n return 2; // ${\n }\n }\n\n function getStringTokenValue(\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string {\n if (tokenFlags & TokenFlags.TripleQuoted) {\n const start = tokenPosition;\n const end = position;\n const [indentationStart, indentationEnd] = findTripleQuotedStringIndent(start, end);\n return unindentAndUnescapeTripleQuotedString(\n start,\n end,\n indentationStart,\n indentationEnd,\n token,\n tokenFlags,\n );\n }\n\n const startOffset = getStringLiteralOffsetStart(token, tokenFlags);\n const endOffset = getStringLiteralOffsetEnd(token, tokenFlags);\n const start = tokenPosition + startOffset;\n const end = tokenFlags & TokenFlags.Unterminated ? position : position - endOffset;\n\n if (tokenFlags & TokenFlags.Escaped) {\n return unescapeString(start, end);\n }\n\n return input.substring(start, end);\n }\n\n function getIdentifierTokenValue(): string {\n const start = tokenFlags & TokenFlags.Backticked ? tokenPosition + 1 : tokenPosition;\n const end =\n tokenFlags & TokenFlags.Backticked && !(tokenFlags & TokenFlags.Unterminated)\n ? position - 1\n : position;\n\n const text =\n tokenFlags & TokenFlags.Escaped ? unescapeString(start, end) : input.substring(start, end);\n\n if (tokenFlags & TokenFlags.NonAscii) {\n return text.normalize(\"NFC\");\n }\n\n return text;\n }\n\n function getDocTextValue(): string {\n if (tokenFlags & TokenFlags.Escaped) {\n let start = tokenPosition;\n const end = position;\n\n let result = \"\";\n let pos = start;\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n\n if (pos === end - 1) {\n break;\n }\n\n result += input.substring(start, pos);\n switch (input.charCodeAt(pos + 1)) {\n case CharCode.At:\n result += \"@\";\n break;\n default:\n result += input.substring(pos, pos + 2);\n }\n pos += 2;\n start = pos;\n }\n\n result += input.substring(start, end);\n return result;\n } else {\n return input.substring(tokenPosition, position);\n }\n }\n\n function findTripleQuotedStringIndent(start: number, end: number): [number, number] {\n end = end - 3; // Remove the \"\"\"\n // remove whitespace before closing delimiter and record it as required\n // indentation for all lines\n const indentationEnd = end;\n while (end > start && isWhiteSpaceSingleLine(input.charCodeAt(end - 1))) {\n end--;\n }\n const indentationStart = end;\n\n // remove required final line break\n if (isLineBreak(input.charCodeAt(end - 1))) {\n if (isCrlf(end - 2, 0, end)) {\n end--;\n }\n end--;\n }\n\n return [indentationStart, indentationEnd];\n }\n\n function unindentAndUnescapeTripleQuotedString(\n start: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n token: Token.StringLiteral | StringTemplateToken,\n tokenFlags: TokenFlags,\n ): string {\n const startOffset = getStringLiteralOffsetStart(token, tokenFlags);\n const endOffset = getStringLiteralOffsetEnd(token, tokenFlags);\n start = start + startOffset;\n end = tokenFlags & TokenFlags.Unterminated ? end : end - endOffset;\n\n if (token === Token.StringLiteral || token === Token.StringTemplateHead) {\n // ignore leading whitespace before required initial line break\n while (start < end && isWhiteSpaceSingleLine(input.charCodeAt(start))) {\n start++;\n }\n // remove required initial line break\n if (isLineBreak(input.charCodeAt(start))) {\n if (isCrlf(start, start, end)) {\n start++;\n }\n start++;\n } else {\n error({\n code: \"no-new-line-start-triple-quote\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n }\n }\n\n if (token === Token.StringLiteral || token === Token.StringTemplateTail) {\n while (end > start && isWhiteSpaceSingleLine(input.charCodeAt(end - 1))) {\n end--;\n }\n\n // remove required final line break\n if (isLineBreak(input.charCodeAt(end - 1))) {\n if (isCrlf(end - 2, start, end)) {\n end--;\n }\n end--;\n } else {\n error({\n code: \"no-new-line-end-triple-quote\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n }\n }\n\n let skipUnindentOnce = false;\n // We are resuming from the middle of a line so we want to keep text as it is from there.\n if (token === Token.StringTemplateMiddle || token === Token.StringTemplateTail) {\n skipUnindentOnce = true;\n }\n // remove required matching indentation from each line and unescape in the\n // process of doing so\n let result = \"\";\n let pos = start;\n while (pos < end) {\n if (skipUnindentOnce) {\n skipUnindentOnce = false;\n } else {\n // skip indentation at start of line\n start = skipMatchingIndentation(pos, end, indentationStart, indentationEnd);\n }\n let ch;\n\n while (pos < end && !isLineBreak((ch = input.charCodeAt(pos)))) {\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n result += input.substring(start, pos);\n if (pos === end - 1) {\n error({ code: \"invalid-escape-sequence\" }, pos, pos);\n pos++;\n } else {\n result += unescapeOne(pos);\n pos += 2;\n }\n start = pos;\n }\n if (pos < end) {\n if (isCrlf(pos, start, end)) {\n // CRLF in multi-line string is normalized to LF in string value.\n // This keeps program behavior unchanged by line-ending conversion.\n result += input.substring(start, pos);\n result += \"\\n\";\n pos += 2;\n } else {\n pos++; // include non-CRLF newline\n result += input.substring(start, pos);\n }\n start = pos;\n }\n }\n result += input.substring(start, pos);\n return result;\n }\n\n function isCrlf(pos: number, start: number, end: number) {\n return (\n pos >= start &&\n pos < end - 1 &&\n input.charCodeAt(pos) === CharCode.CarriageReturn &&\n input.charCodeAt(pos + 1) === CharCode.LineFeed\n );\n }\n\n function skipMatchingIndentation(\n pos: number,\n end: number,\n indentationStart: number,\n indentationEnd: number,\n ): number {\n let indentationPos = indentationStart;\n end = Math.min(end, pos + (indentationEnd - indentationStart));\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (isLineBreak(ch)) {\n // allow subset of indentation if line has only whitespace\n break;\n }\n if (ch !== input.charCodeAt(indentationPos)) {\n error({\n code: \"triple-quote-indent\",\n codefixes: [createTripleQuoteIndentCodeFix({ file, pos: tokenPosition, end: position })],\n });\n break;\n }\n indentationPos++;\n pos++;\n }\n\n return pos;\n }\n\n function unescapeString(start: number, end: number): string {\n let result = \"\";\n let pos = start;\n\n while (pos < end) {\n const ch = input.charCodeAt(pos);\n if (ch !== CharCode.Backslash) {\n pos++;\n continue;\n }\n\n if (pos === end - 1) {\n error({ code: \"invalid-escape-sequence\" }, pos, pos);\n break;\n }\n\n result += input.substring(start, pos);\n result += unescapeOne(pos);\n pos += 2;\n start = pos;\n }\n\n result += input.substring(start, pos);\n return result;\n }\n\n function unescapeOne(pos: number): string {\n const ch = input.charCodeAt(pos + 1);\n switch (ch) {\n case CharCode.r:\n return \"\\r\";\n case CharCode.n:\n return \"\\n\";\n case CharCode.t:\n return \"\\t\";\n case CharCode.DoubleQuote:\n return '\"';\n case CharCode.Backslash:\n return \"\\\\\";\n case CharCode.$:\n return \"$\";\n case CharCode.At:\n return \"@\";\n case CharCode.Backtick:\n return \"`\";\n default:\n error({ code: \"invalid-escape-sequence\" }, pos, pos + 2);\n return String.fromCharCode(ch);\n }\n }\n\n function scanIdentifierOrKeyword(): Token {\n let count = 0;\n let ch = input.charCodeAt(position);\n\n while (true) {\n position++;\n count++;\n\n if (eof()) {\n break;\n }\n\n ch = input.charCodeAt(position);\n if (count < KeywordLimit.MaxLength && isLowercaseAsciiLetter(ch)) {\n continue;\n }\n\n if (isAsciiIdentifierContinue(ch)) {\n return scanIdentifier();\n }\n\n if (ch > CharCode.MaxAscii) {\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n }\n\n break;\n }\n\n if (count >= KeywordLimit.MinLength && count <= KeywordLimit.MaxLength) {\n const keyword = Keywords.get(getTokenText());\n if (keyword) {\n return (token = keyword);\n }\n }\n\n return (token = Token.Identifier);\n }\n\n function scanIdentifier(): Token.Identifier {\n let ch: number;\n\n do {\n position++;\n if (eof()) {\n return (token = Token.Identifier);\n }\n } while (isAsciiIdentifierContinue((ch = input.charCodeAt(position))));\n\n if (ch > CharCode.MaxAscii) {\n const cp = input.codePointAt(position)!;\n if (isNonAsciiIdentifierCharacter(cp)) {\n return scanNonAsciiIdentifier(cp);\n }\n }\n\n return (token = Token.Identifier);\n }\n\n function scanBacktickedIdentifier(): Token.Identifier {\n position++; // consume '`'\n\n tokenFlags |= TokenFlags.Backticked;\n\n loop: for (; !eof(); position++) {\n const ch = input.charCodeAt(position);\n switch (ch) {\n case CharCode.Backslash:\n position++;\n tokenFlags |= TokenFlags.Escaped;\n continue;\n case CharCode.Backtick:\n position++;\n return (token = Token.Identifier);\n case CharCode.CarriageReturn:\n case CharCode.LineFeed:\n break loop;\n default:\n if (ch > CharCode.MaxAscii) {\n tokenFlags |= TokenFlags.NonAscii;\n }\n }\n }\n\n return unterminated(Token.Identifier);\n }\n\n function scanNonAsciiIdentifier(startCodePoint: number): Token.Identifier {\n tokenFlags |= TokenFlags.NonAscii;\n let cp = startCodePoint;\n do {\n position += utf16CodeUnits(cp);\n } while (!eof() && isIdentifierContinue((cp = input.codePointAt(position)!)));\n\n return (token = Token.Identifier);\n }\n\n function atConflictMarker(): boolean {\n return isConflictMarker(input, position, endPosition);\n }\n\n function scanConflictMarker(): Token.ConflictMarker {\n const marker = input.charCodeAt(position);\n position += mergeConflictMarkerLength;\n error({ code: \"conflict-marker\" });\n\n if (marker === CharCode.LessThan || marker === CharCode.GreaterThan) {\n // Consume everything from >>>>>>> or <<<<<<< to the end of the line.\n while (position < endPosition && !isLineBreak(input.charCodeAt(position))) {\n position++;\n }\n } else {\n // Consume everything from the start of a ||||||| or =======\n // marker to the start of the next ======= or >>>>>>> marker.\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n if (\n (ch === CharCode.Equals || ch === CharCode.GreaterThan) &&\n ch !== marker &&\n isConflictMarker(input, position, endPosition)\n ) {\n break;\n }\n position++;\n }\n }\n\n return (token = Token.ConflictMarker);\n }\n}\n\n/**\n *\n * @param script\n * @param position\n * @param endPosition exclude\n * @returns return === endPosition (or -1) means not found non-trivia until endPosition + 1\n */\nexport function skipTriviaBackward(\n script: TypeSpecScriptNode,\n position: number,\n endPosition = -1,\n): number {\n endPosition = endPosition < -1 ? -1 : endPosition;\n const input = script.file.text;\n if (position === input.length) {\n // it's possible if the pos is at the end of the file, just treat it as trivia\n position--;\n } else if (position > input.length) {\n compilerAssert(false, `position out of range: ${position}, text length: ${input.length}`);\n }\n\n while (position > endPosition) {\n const ch = input.charCodeAt(position);\n\n if (isWhiteSpace(ch)) {\n position--;\n } else {\n const comment = getCommentAtPosition(script, position);\n if (comment) {\n position = comment.pos - 1;\n } else {\n break;\n }\n }\n }\n\n return position;\n}\n\n/**\n *\n * @param input\n * @param position\n * @param endPosition exclude\n * @returns return === endPosition (or input.length) means not found non-trivia until endPosition - 1\n */\nexport function skipTrivia(input: string, position: number, endPosition = input.length): number {\n endPosition = endPosition > input.length ? input.length : endPosition;\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n\n if (isWhiteSpace(ch)) {\n position++;\n continue;\n }\n\n if (ch === CharCode.Slash) {\n switch (input.charCodeAt(position + 1)) {\n case CharCode.Slash:\n position = skipSingleLineComment(input, position, endPosition);\n continue;\n case CharCode.Asterisk:\n position = skipMultiLineComment(input, position, endPosition)[0];\n continue;\n }\n }\n\n break;\n }\n\n return position;\n}\n\nexport function skipWhiteSpace(\n input: string,\n position: number,\n endPosition = input.length,\n): number {\n while (position < endPosition) {\n const ch = input.charCodeAt(position);\n\n if (!isWhiteSpace(ch)) {\n break;\n }\n position++;\n }\n\n return position;\n}\n\nfunction skipSingleLineComment(\n input: string,\n position: number,\n endPosition = input.length,\n): number {\n position += 2; // consume '//'\n\n for (; position < endPosition; position++) {\n if (isLineBreak(input.charCodeAt(position))) {\n break;\n }\n }\n\n return position;\n}\n\nfunction skipMultiLineComment(\n input: string,\n position: number,\n endPosition = input.length,\n): [position: number, terminated: boolean] {\n position += 2; // consume '/*'\n\n for (; position < endPosition; position++) {\n if (\n input.charCodeAt(position) === CharCode.Asterisk &&\n input.charCodeAt(position + 1) === CharCode.Slash\n ) {\n return [position + 2, true];\n }\n }\n\n return [position, false];\n}\n\nexport function skipContinuousIdentifier(input: string, position: number, isBackward = false) {\n let cur = position;\n const direction = isBackward ? -1 : 1;\n const bar = isBackward ? (p: number) => p >= 0 : (p: number) => p < input.length;\n while (bar(cur)) {\n const { char: cp, size } = codePointBefore(input, cur);\n cur += direction * size;\n if (!cp || !isIdentifierContinue(cp)) {\n break;\n }\n }\n return cur;\n}\n\nfunction isConflictMarker(input: string, position: number, endPosition = input.length): boolean {\n // Conflict markers must be at the start of a line.\n const ch = input.charCodeAt(position);\n if (position === 0 || isLineBreak(input.charCodeAt(position - 1))) {\n if (position + mergeConflictMarkerLength < endPosition) {\n for (let i = 0; i < mergeConflictMarkerLength; i++) {\n if (input.charCodeAt(position + i) !== ch) {\n return false;\n }\n }\n return (\n ch === CharCode.Equals ||\n input.charCodeAt(position + mergeConflictMarkerLength) === CharCode.Space\n );\n }\n }\n\n return false;\n}\n\nfunction getTokenDisplayTable(entries: [Token, string][]): readonly string[] {\n const table = new Array<string>(entries.length);\n\n for (const [token, display] of entries) {\n compilerAssert(\n token >= 0 && token < Token.__Count,\n `Invalid entry in token display table, ${token}, ${Token[token]}, ${display}`,\n );\n compilerAssert(\n !table[token],\n `Duplicate entry in token display table for: ${token}, ${Token[token]}, ${display}`,\n );\n table[token] = display;\n }\n\n for (let token = 0; token < Token.__Count; token++) {\n compilerAssert(table[token], `Missing entry in token display table: ${token}, ${Token[token]}`);\n }\n\n return table;\n}\n", "import { isArray, mutate } from \"../utils/misc.js\";\nimport { codePointBefore, isIdentifierContinue, trim } from \"./charcode.js\";\nimport { compilerAssert } from \"./diagnostics.js\";\nimport { CompilerDiagnostics, createDiagnostic } from \"./messages.js\";\nimport {\n createScanner,\n isComment,\n isKeyword,\n isPunctuation,\n isReservedKeyword,\n isStatementKeyword,\n isTrivia,\n skipContinuousIdentifier,\n skipTrivia,\n skipTriviaBackward,\n Token,\n TokenDisplay,\n TokenFlags,\n} from \"./scanner.js\";\nimport {\n AliasStatementNode,\n AnyKeywordNode,\n ArrayLiteralNode,\n AugmentDecoratorStatementNode,\n BlockComment,\n BooleanLiteralNode,\n CallExpressionNode,\n Comment,\n ConstStatementNode,\n DeclarationNode,\n DecoratorDeclarationStatementNode,\n DecoratorExpressionNode,\n Diagnostic,\n DiagnosticReportWithoutTarget,\n DirectiveArgument,\n DirectiveExpressionNode,\n DocContent,\n DocErrorsTagNode,\n DocNode,\n DocParamTagNode,\n DocPropTagNode,\n DocReturnsTagNode,\n DocTag,\n DocTemplateTagNode,\n DocTextNode,\n DocUnknownTagNode,\n EmptyStatementNode,\n EnumMemberNode,\n EnumSpreadMemberNode,\n EnumStatementNode,\n Expression,\n ExternKeywordNode,\n FunctionDeclarationStatementNode,\n FunctionParameterNode,\n IdentifierContext,\n IdentifierKind,\n IdentifierNode,\n ImportStatementNode,\n InterfaceStatementNode,\n InvalidStatementNode,\n LineComment,\n MemberExpressionNode,\n ModelExpressionNode,\n ModelPropertyNode,\n ModelSpreadPropertyNode,\n ModelStatementNode,\n Modifier,\n ModifierFlags,\n NamespaceStatementNode,\n NeverKeywordNode,\n Node,\n NodeFlags,\n NumericLiteralNode,\n ObjectLiteralNode,\n ObjectLiteralPropertyNode,\n ObjectLiteralSpreadPropertyNode,\n OperationSignature,\n OperationStatementNode,\n ParseOptions,\n PositionDetail,\n ScalarConstructorNode,\n ScalarStatementNode,\n SourceFile,\n Statement,\n StringLiteralNode,\n StringTemplateExpressionNode,\n StringTemplateHeadNode,\n StringTemplateMiddleNode,\n StringTemplateSpanNode,\n StringTemplateTailNode,\n Sym,\n SyntaxKind,\n TemplateArgumentNode,\n TemplateParameterDeclarationNode,\n TextRange,\n TupleExpressionNode,\n TypeOfExpressionNode,\n TypeReferenceNode,\n TypeSpecScriptNode,\n UnionStatementNode,\n UnionVariantNode,\n UsingStatementNode,\n ValueOfExpressionNode,\n VoidKeywordNode,\n} from \"./types.js\";\n\n/**\n * Callback to parse each element in a delimited list\n *\n * @param pos The position of the start of the list element before any\n * decorators were parsed.\n *\n * @param decorators The decorators that were applied to the list element and\n * parsed before entering the callback.\n */\ntype ParseListItem<K, T> = K extends UnannotatedListKind\n ? () => T\n : (pos: number, decorators: DecoratorExpressionNode[]) => T;\n\ntype ListDetail<T> = {\n items: T[];\n /**\n * The range of the list items as below as an example\n * model Foo <pos>{ a: string; b: string; }<end>\n *\n * remark: if the start/end token (i.e. { } ) not found, pos/end will be -1\n */\n range: TextRange;\n};\n\ntype OpenToken =\n | Token.OpenBrace\n | Token.OpenParen\n | Token.OpenBracket\n | Token.LessThan\n | Token.HashBrace\n | Token.HashBracket;\ntype CloseToken = Token.CloseBrace | Token.CloseParen | Token.CloseBracket | Token.GreaterThan;\ntype DelimiterToken = Token.Comma | Token.Semicolon;\n\n/**\n * In order to share sensitive error recovery code, all parsing of delimited\n * lists is done using a shared driver routine parameterized by these options.\n */\ninterface ListKind {\n readonly allowEmpty: boolean;\n readonly open: OpenToken | Token.None;\n readonly close: CloseToken | Token.None;\n readonly delimiter: DelimiterToken;\n readonly toleratedDelimiter: DelimiterToken;\n readonly toleratedDelimiterIsValid: boolean;\n readonly invalidAnnotationTarget?: string;\n readonly allowedStatementKeyword: Token;\n}\n\ninterface SurroundedListKind extends ListKind {\n readonly open: OpenToken;\n readonly close: CloseToken;\n}\n\ninterface UnannotatedListKind extends ListKind {\n invalidAnnotationTarget: string;\n}\n\n/**\n * The fixed set of options for each of the kinds of delimited lists in TypeSpec.\n */\n// eslint-disable-next-line @typescript-eslint/no-namespace\nnamespace ListKind {\n const PropertiesBase = {\n allowEmpty: true,\n toleratedDelimiterIsValid: true,\n allowedStatementKeyword: Token.None,\n } as const;\n\n export const OperationParameters = {\n ...PropertiesBase,\n open: Token.OpenParen,\n close: Token.CloseParen,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Semicolon,\n } as const;\n\n export const DecoratorArguments = {\n ...OperationParameters,\n invalidAnnotationTarget: \"expression\",\n } as const;\n\n export const FunctionArguments = {\n ...OperationParameters,\n invalidAnnotationTarget: \"expression\",\n } as const;\n\n export const ModelProperties = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n } as const;\n\n export const ObjectLiteralProperties = {\n ...PropertiesBase,\n open: Token.HashBrace,\n close: Token.CloseBrace,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Comma,\n } as const;\n\n export const InterfaceMembers = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: false,\n allowedStatementKeyword: Token.OpKeyword,\n } as const;\n\n export const ScalarMembers = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: false,\n allowedStatementKeyword: Token.InitKeyword,\n } as const;\n\n export const UnionVariants = {\n ...PropertiesBase,\n open: Token.OpenBrace,\n close: Token.CloseBrace,\n delimiter: Token.Semicolon,\n toleratedDelimiter: Token.Comma,\n toleratedDelimiterIsValid: true,\n } as const;\n\n export const EnumMembers = {\n ...ModelProperties,\n } as const;\n\n const ExpresionsBase = {\n allowEmpty: true,\n delimiter: Token.Comma,\n toleratedDelimiter: Token.Semicolon,\n toleratedDelimiterIsValid: false,\n invalidAnnotationTarget: \"expression\",\n allowedStatementKeyword: Token.None,\n } as const;\n\n export const TemplateParameters = {\n ...ExpresionsBase,\n allowEmpty: false,\n open: Token.LessThan,\n close: Token.GreaterThan,\n invalidAnnotationTarget: \"template parameter\",\n } as const;\n\n export const TemplateArguments = {\n ...TemplateParameters,\n } as const;\n\n export const CallArguments = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenParen,\n close: Token.CloseParen,\n } as const;\n\n export const Heritage = {\n ...ExpresionsBase,\n allowEmpty: false,\n open: Token.None,\n close: Token.None,\n } as const;\n\n export const Tuple = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenBracket,\n close: Token.CloseBracket,\n } as const;\n\n export const ArrayLiteral = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.HashBracket,\n close: Token.CloseBracket,\n } as const;\n\n export const FunctionParameters = {\n ...ExpresionsBase,\n allowEmpty: true,\n open: Token.OpenParen,\n close: Token.CloseParen,\n invalidAnnotationTarget: \"expression\",\n } as const;\n}\n\nconst enum ParseMode {\n Syntax,\n Doc,\n}\n\nexport function parse(code: string | SourceFile, options: ParseOptions = {}): TypeSpecScriptNode {\n const parser = createParser(code, options);\n return parser.parseTypeSpecScript();\n}\n\nexport function parseStandaloneTypeReference(\n code: string | SourceFile,\n): [TypeReferenceNode, readonly Diagnostic[]] {\n const parser = createParser(code);\n const node = parser.parseStandaloneReferenceExpression();\n return [node, parser.parseDiagnostics];\n}\n\ninterface Parser {\n parseDiagnostics: Diagnostic[];\n parseTypeSpecScript(): TypeSpecScriptNode;\n parseStandaloneReferenceExpression(): TypeReferenceNode;\n}\n\ninterface DocRange extends TextRange {\n /** Parsed comment. */\n comment?: BlockComment;\n}\n\nfunction createParser(code: string | SourceFile, options: ParseOptions = {}): Parser {\n let parseErrorInNextFinishedNode = false;\n let previousTokenEnd = -1;\n let realPositionOfLastError = -1;\n let missingIdentifierCounter = 0;\n let treePrintable = true;\n let newLineIsTrivia = true;\n let currentMode = ParseMode.Syntax;\n const parseDiagnostics: Diagnostic[] = [];\n const scanner = createScanner(code, reportDiagnostic);\n const comments: Comment[] = [];\n let docRanges: DocRange[] = [];\n\n nextToken();\n return {\n parseDiagnostics,\n parseTypeSpecScript,\n parseStandaloneReferenceExpression,\n };\n\n function parseTypeSpecScript(): TypeSpecScriptNode {\n const statements = parseTypeSpecScriptItemList();\n return {\n kind: SyntaxKind.TypeSpecScript,\n statements,\n file: scanner.file,\n id: {\n kind: SyntaxKind.Identifier,\n sv: scanner.file.path,\n pos: 0,\n end: 0,\n flags: NodeFlags.Synthetic,\n } as any,\n namespaces: [],\n usings: [],\n locals: undefined!,\n inScopeNamespaces: [],\n parseDiagnostics,\n comments,\n printable: treePrintable,\n parseOptions: options,\n ...finishNode(0),\n };\n }\n\n interface ParseAnnotationsOptions {\n /** If we shouldn't try to parse doc nodes when parsing annotations. */\n skipParsingDocNodes?: boolean;\n }\n\n interface Annotations {\n pos: number;\n docs: DocNode[];\n directives: DirectiveExpressionNode[];\n decorators: DecoratorExpressionNode[];\n }\n\n /** Try to parse doc comments, directives and decorators in any order. */\n function parseAnnotations({ skipParsingDocNodes }: ParseAnnotationsOptions = {}): Annotations {\n const directives: DirectiveExpressionNode[] = [];\n const decorators: DecoratorExpressionNode[] = [];\n const docs: DocNode[] = [];\n let pos = tokenPos();\n if (!skipParsingDocNodes) {\n const [firstPos, addedDocs] = parseDocList();\n pos = firstPos;\n for (const doc of addedDocs) {\n docs.push(doc);\n }\n }\n\n while (token() === Token.Hash || token() === Token.At) {\n if (token() === Token.Hash) {\n directives.push(parseDirectiveExpression());\n } else if (token() === Token.At) {\n decorators.push(parseDecoratorExpression());\n }\n\n if (!skipParsingDocNodes) {\n const [_, addedDocs] = parseDocList();\n\n for (const doc of addedDocs) {\n docs.push(doc);\n }\n }\n }\n\n return { pos, docs, directives, decorators };\n }\n\n function parseTypeSpecScriptItemList(): Statement[] {\n const stmts: Statement[] = [];\n let seenBlocklessNs = false;\n let seenDecl = false;\n let seenUsing = false;\n while (token() !== Token.EndOfFile) {\n const { pos, docs, directives, decorators } = parseAnnotations();\n const tok = token();\n let item: Statement;\n switch (tok) {\n case Token.AtAt:\n reportInvalidDecorators(decorators, \"augment decorator statement\");\n item = parseAugmentDecorator();\n break;\n case Token.ImportKeyword:\n reportInvalidDecorators(decorators, \"import statement\");\n item = parseImportStatement();\n break;\n case Token.ModelKeyword:\n item = parseModelStatement(pos, decorators);\n break;\n case Token.ScalarKeyword:\n item = parseScalarStatement(pos, decorators);\n break;\n case Token.NamespaceKeyword:\n item = parseNamespaceStatement(pos, decorators, docs, directives);\n break;\n case Token.InterfaceKeyword:\n item = parseInterfaceStatement(pos, decorators);\n break;\n case Token.UnionKeyword:\n item = parseUnionStatement(pos, decorators);\n break;\n case Token.OpKeyword:\n item = parseOperationStatement(pos, decorators);\n break;\n case Token.EnumKeyword:\n item = parseEnumStatement(pos, decorators);\n break;\n case Token.AliasKeyword:\n reportInvalidDecorators(decorators, \"alias statement\");\n item = parseAliasStatement(pos);\n break;\n case Token.ConstKeyword:\n reportInvalidDecorators(decorators, \"const statement\");\n item = parseConstStatement(pos);\n break;\n case Token.UsingKeyword:\n reportInvalidDecorators(decorators, \"using statement\");\n item = parseUsingStatement(pos);\n break;\n case Token.Semicolon:\n reportInvalidDecorators(decorators, \"empty statement\");\n item = parseEmptyStatement(pos);\n break;\n // Start of declaration with modifiers\n case Token.ExternKeyword:\n case Token.FnKeyword:\n case Token.DecKeyword:\n item = parseDeclaration(pos);\n break;\n default:\n item = parseInvalidStatement(pos, decorators);\n break;\n }\n\n if (tok !== Token.NamespaceKeyword) {\n mutate(item).directives = directives;\n mutate(item).docs = docs;\n }\n\n if (isBlocklessNamespace(item)) {\n if (seenBlocklessNs) {\n error({ code: \"multiple-blockless-namespace\", target: item });\n }\n if (seenDecl) {\n error({ code: \"blockless-namespace-first\", target: item });\n }\n seenBlocklessNs = true;\n } else if (item.kind === SyntaxKind.ImportStatement) {\n if (seenDecl || seenBlocklessNs || seenUsing) {\n error({ code: \"import-first\", target: item });\n }\n } else if (item.kind === SyntaxKind.UsingStatement) {\n seenUsing = true;\n } else {\n seenDecl = true;\n }\n\n stmts.push(item);\n }\n\n return stmts;\n }\n\n function parseStatementList(): Statement[] {\n const stmts: Statement[] = [];\n\n while (token() !== Token.CloseBrace) {\n const { pos, docs, directives, decorators } = parseAnnotations();\n const tok = token();\n\n let item: Statement;\n switch (tok) {\n case Token.AtAt:\n reportInvalidDecorators(decorators, \"augment decorator statement\");\n item = parseAugmentDecorator();\n break;\n case Token.ImportKeyword:\n reportInvalidDecorators(decorators, \"import statement\");\n item = parseImportStatement();\n error({ code: \"import-first\", messageId: \"topLevel\", target: item });\n break;\n case Token.ModelKeyword:\n item = parseModelStatement(pos, decorators);\n break;\n case Token.ScalarKeyword:\n item = parseScalarStatement(pos, decorators);\n break;\n case Token.NamespaceKeyword:\n const ns = parseNamespaceStatement(pos, decorators, docs, directives);\n\n if (isBlocklessNamespace(ns)) {\n error({ code: \"blockless-namespace-first\", messageId: \"topLevel\", target: ns });\n }\n item = ns;\n break;\n case Token.InterfaceKeyword:\n item = parseInterfaceStatement(pos, decorators);\n break;\n case Token.UnionKeyword:\n item = parseUnionStatement(pos, decorators);\n break;\n case Token.OpKeyword:\n item = parseOperationStatement(pos, decorators);\n break;\n case Token.EnumKeyword:\n item = parseEnumStatement(pos, decorators);\n break;\n case Token.AliasKeyword:\n reportInvalidDecorators(decorators, \"alias statement\");\n item = parseAliasStatement(pos);\n break;\n case Token.ConstKeyword:\n reportInvalidDecorators(decorators, \"const statement\");\n item = parseConstStatement(pos);\n break;\n case Token.UsingKeyword:\n reportInvalidDecorators(decorators, \"using statement\");\n item = parseUsingStatement(pos);\n break;\n case Token.ExternKeyword:\n case Token.FnKeyword:\n case Token.DecKeyword:\n item = parseDeclaration(pos);\n break;\n case Token.EndOfFile:\n parseExpected(Token.CloseBrace);\n return stmts;\n case Token.Semicolon:\n reportInvalidDecorators(decorators, \"empty statement\");\n item = parseEmptyStatement(pos);\n break;\n default:\n item = parseInvalidStatement(pos, decorators);\n break;\n }\n mutate(item).directives = directives;\n if (tok !== Token.NamespaceKeyword) {\n mutate(item).docs = docs;\n }\n stmts.push(item);\n }\n\n return stmts;\n }\n\n function parseDecoratorList() {\n const decorators: DecoratorExpressionNode[] = [];\n\n while (token() === Token.At) {\n decorators.push(parseDecoratorExpression());\n }\n\n return decorators;\n }\n\n function parseDirectiveList(): DirectiveExpressionNode[] {\n const directives: DirectiveExpressionNode[] = [];\n\n while (token() === Token.Hash) {\n directives.push(parseDirectiveExpression());\n }\n\n return directives;\n }\n\n function parseNamespaceStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n docs: DocNode[],\n directives: DirectiveExpressionNode[],\n ): NamespaceStatementNode {\n parseExpected(Token.NamespaceKeyword);\n let currentName = parseIdentifierOrMemberExpression();\n const nsSegments: IdentifierNode[] = [];\n while (currentName.kind !== SyntaxKind.Identifier) {\n nsSegments.push(currentName.id);\n currentName = currentName.base;\n }\n nsSegments.push(currentName);\n\n const nextTok = parseExpectedOneOf(Token.Semicolon, Token.OpenBrace);\n\n let statements: Statement[] | undefined;\n if (nextTok === Token.OpenBrace) {\n statements = parseStatementList();\n parseExpected(Token.CloseBrace);\n }\n\n let outerNs: NamespaceStatementNode = {\n kind: SyntaxKind.NamespaceStatement,\n decorators,\n docs: docs,\n id: nsSegments[0],\n locals: undefined!,\n statements,\n directives: directives,\n ...finishNode(pos),\n };\n\n for (let i = 1; i < nsSegments.length; i++) {\n outerNs = {\n kind: SyntaxKind.NamespaceStatement,\n decorators: [],\n directives: [],\n id: nsSegments[i],\n statements: outerNs,\n locals: undefined!,\n ...finishNode(pos),\n };\n }\n\n return outerNs;\n }\n\n function parseInterfaceStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): InterfaceStatementNode {\n parseExpected(Token.InterfaceKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n let extendList: ListDetail<TypeReferenceNode> = createEmptyList<TypeReferenceNode>();\n if (token() === Token.ExtendsKeyword) {\n nextToken();\n extendList = parseList(ListKind.Heritage, parseReferenceExpression);\n } else if (token() === Token.Identifier) {\n error({ code: \"token-expected\", format: { token: \"'extends' or '{'\" } });\n nextToken();\n }\n\n const { items: operations, range: bodyRange } = parseList(\n ListKind.InterfaceMembers,\n (pos, decorators) => parseOperationStatement(pos, decorators, true),\n );\n\n return {\n kind: SyntaxKind.InterfaceStatement,\n id,\n templateParameters,\n templateParametersRange,\n operations,\n bodyRange,\n extends: extendList.items,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseTemplateParameterList(): ListDetail<TemplateParameterDeclarationNode> {\n const detail = parseOptionalList(ListKind.TemplateParameters, parseTemplateParameter);\n let setDefault = false;\n for (const item of detail.items) {\n if (!item.default && setDefault) {\n error({ code: \"default-required\", target: item });\n continue;\n }\n\n if (item.default) {\n setDefault = true;\n }\n }\n\n return detail;\n }\n\n function parseUnionStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): UnionStatementNode {\n parseExpected(Token.UnionKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n const { items: options } = parseList(ListKind.UnionVariants, parseUnionVariant);\n\n return {\n kind: SyntaxKind.UnionStatement,\n id,\n templateParameters,\n templateParametersRange,\n decorators,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseIdOrValueForVariant(): Expression {\n const nextToken = token();\n\n let id: IdentifierNode | undefined;\n if (isReservedKeyword(nextToken)) {\n id = parseIdentifier({ allowReservedIdentifier: true });\n // If the next token is not a colon this means we tried to use the reserved keyword as a type reference\n if (token() !== Token.Colon) {\n error({ code: \"reserved-identifier\", messageId: \"future\", format: { name: id.sv } });\n }\n return {\n kind: SyntaxKind.TypeReference,\n target: id,\n arguments: [],\n ...finishNode(id.pos),\n };\n } else {\n return parseExpression();\n }\n }\n\n function parseUnionVariant(pos: number, decorators: DecoratorExpressionNode[]): UnionVariantNode {\n const idOrExpr = parseIdOrValueForVariant();\n if (parseOptional(Token.Colon)) {\n let id: IdentifierNode | undefined = undefined;\n\n if (\n idOrExpr.kind !== SyntaxKind.TypeReference &&\n idOrExpr.kind !== SyntaxKind.StringLiteral\n ) {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n } else if (idOrExpr.kind === SyntaxKind.StringLiteral) {\n // convert string literal node to identifier node (back compat for string literal quoted properties)\n id = {\n kind: SyntaxKind.Identifier,\n sv: idOrExpr.value,\n ...finishNode(idOrExpr.pos),\n };\n } else {\n const target = idOrExpr.target;\n if (target.kind === SyntaxKind.Identifier) {\n id = target;\n } else {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n }\n }\n\n const value = parseExpression();\n\n return {\n kind: SyntaxKind.UnionVariant,\n id,\n value,\n decorators,\n ...finishNode(pos),\n };\n }\n\n return {\n kind: SyntaxKind.UnionVariant,\n id: undefined,\n value: idOrExpr,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseUsingStatement(pos: number): UsingStatementNode {\n parseExpected(Token.UsingKeyword);\n const name = parseIdentifierOrMemberExpression();\n parseExpected(Token.Semicolon);\n\n return {\n kind: SyntaxKind.UsingStatement,\n name,\n ...finishNode(pos),\n };\n }\n\n function parseOperationStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n inInterface?: boolean,\n ): OperationStatementNode {\n if (inInterface) {\n parseOptional(Token.OpKeyword);\n } else {\n parseExpected(Token.OpKeyword);\n }\n\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n // Make sure the next token is one that is expected\n const token = expectTokenIsOneOf(Token.OpenParen, Token.IsKeyword);\n\n // Check if we're parsing a declaration or reuse of another operation\n let signature: OperationSignature;\n const signaturePos = tokenPos();\n if (token === Token.OpenParen) {\n const parameters = parseOperationParameters();\n parseExpected(Token.Colon);\n const returnType = parseExpression();\n\n signature = {\n kind: SyntaxKind.OperationSignatureDeclaration,\n parameters,\n returnType,\n ...finishNode(signaturePos),\n };\n } else {\n parseExpected(Token.IsKeyword);\n const opReference = parseReferenceExpression();\n\n signature = {\n kind: SyntaxKind.OperationSignatureReference,\n baseOperation: opReference,\n ...finishNode(signaturePos),\n };\n }\n\n // The interface parser handles semicolon parsing between statements\n if (!inInterface) {\n parseExpected(Token.Semicolon);\n }\n\n return {\n kind: SyntaxKind.OperationStatement,\n id,\n templateParameters,\n templateParametersRange,\n signature,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseOperationParameters(): ModelExpressionNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.OperationParameters,\n parseModelPropertyOrSpread,\n );\n const parameters: ModelExpressionNode = {\n kind: SyntaxKind.ModelExpression,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n return parameters;\n }\n\n function parseModelStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelStatementNode {\n parseExpected(Token.ModelKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n expectTokenIsOneOf(Token.OpenBrace, Token.Equals, Token.ExtendsKeyword, Token.IsKeyword);\n\n const optionalExtends = parseOptionalModelExtends();\n const optionalIs = optionalExtends ? undefined : parseOptionalModelIs();\n\n let propDetail: ListDetail<ModelPropertyNode | ModelSpreadPropertyNode> = createEmptyList<\n ModelPropertyNode | ModelSpreadPropertyNode\n >();\n if (optionalIs) {\n const tok = expectTokenIsOneOf(Token.Semicolon, Token.OpenBrace);\n if (tok === Token.Semicolon) {\n nextToken();\n } else {\n propDetail = parseList(ListKind.ModelProperties, parseModelPropertyOrSpread);\n }\n } else {\n propDetail = parseList(ListKind.ModelProperties, parseModelPropertyOrSpread);\n }\n\n return {\n kind: SyntaxKind.ModelStatement,\n id,\n extends: optionalExtends,\n is: optionalIs,\n templateParameters,\n templateParametersRange,\n decorators,\n properties: propDetail.items,\n bodyRange: propDetail.range,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalModelExtends() {\n if (parseOptional(Token.ExtendsKeyword)) {\n return parseExpression();\n }\n return undefined;\n }\n\n function parseOptionalModelIs() {\n if (parseOptional(Token.IsKeyword)) {\n return parseExpression();\n }\n return;\n }\n\n function parseTemplateParameter(): TemplateParameterDeclarationNode {\n const pos = tokenPos();\n const id = parseIdentifier();\n let constraint: Expression | ValueOfExpressionNode | undefined;\n if (parseOptional(Token.ExtendsKeyword)) {\n constraint = parseMixedParameterConstraint();\n }\n let def: Expression | undefined;\n if (parseOptional(Token.Equals)) {\n def = parseExpression();\n }\n return {\n kind: SyntaxKind.TemplateParameterDeclaration,\n id,\n constraint,\n default: def,\n ...finishNode(pos),\n };\n }\n\n function parseValueOfExpressionOrIntersectionOrHigher() {\n if (token() === Token.ValueOfKeyword) {\n return parseValueOfExpression();\n } else if (parseOptional(Token.OpenParen)) {\n const expr = parseMixedParameterConstraint();\n parseExpected(Token.CloseParen);\n return expr;\n }\n\n return parseIntersectionExpressionOrHigher();\n }\n\n function parseMixedParameterConstraint(): Expression | ValueOfExpressionNode {\n const pos = tokenPos();\n parseOptional(Token.Bar);\n const node: Expression = parseValueOfExpressionOrIntersectionOrHigher();\n\n if (token() !== Token.Bar) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Bar)) {\n const expr = parseValueOfExpressionOrIntersectionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.UnionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseModelPropertyOrSpread(pos: number, decorators: DecoratorExpressionNode[]) {\n return token() === Token.Ellipsis\n ? parseModelSpreadProperty(pos, decorators)\n : parseModelProperty(pos, decorators);\n }\n\n function parseModelSpreadProperty(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelSpreadPropertyNode {\n parseExpected(Token.Ellipsis);\n\n reportInvalidDecorators(decorators, \"spread property\");\n\n // This could be broadened to allow any type expression\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.ModelSpreadProperty,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseModelProperty(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ModelPropertyNode {\n const id = parseIdentifier({\n message: \"property\",\n allowStringLiteral: true,\n allowReservedIdentifier: true,\n });\n\n const optional = parseOptional(Token.Question);\n parseExpected(Token.Colon);\n const value = parseExpression();\n\n const hasDefault = parseOptional(Token.Equals);\n const defaultValue = hasDefault ? parseExpression() : undefined;\n return {\n kind: SyntaxKind.ModelProperty,\n id,\n decorators,\n value,\n optional,\n default: defaultValue,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteralPropertyOrSpread(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ObjectLiteralPropertyNode | ObjectLiteralSpreadPropertyNode {\n reportInvalidDecorators(decorators, \"object literal property\");\n\n return token() === Token.Ellipsis\n ? parseObjectLiteralSpreadProperty(pos)\n : parseObjectLiteralProperty(pos);\n }\n\n function parseObjectLiteralSpreadProperty(pos: number): ObjectLiteralSpreadPropertyNode {\n parseExpected(Token.Ellipsis);\n\n // This could be broadened to allow any type expression\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.ObjectLiteralSpreadProperty,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteralProperty(pos: number): ObjectLiteralPropertyNode {\n const id = parseIdentifier({\n message: \"property\",\n allowReservedIdentifier: true,\n });\n\n parseExpected(Token.Colon);\n const value = parseExpression();\n\n return {\n kind: SyntaxKind.ObjectLiteralProperty,\n id,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseScalarStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ScalarStatementNode {\n parseExpected(Token.ScalarKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n\n const optionalExtends = parseOptionalScalarExtends();\n const { items: members, range: bodyRange } = parseScalarMembers();\n\n return {\n kind: SyntaxKind.ScalarStatement,\n id,\n templateParameters,\n templateParametersRange,\n extends: optionalExtends,\n members,\n bodyRange,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalScalarExtends() {\n if (parseOptional(Token.ExtendsKeyword)) {\n return parseReferenceExpression();\n }\n return undefined;\n }\n\n function parseScalarMembers(): ListDetail<ScalarConstructorNode> {\n if (token() === Token.Semicolon) {\n nextToken();\n return createEmptyList<ScalarConstructorNode>();\n } else {\n return parseList(ListKind.ScalarMembers, parseScalarMember);\n }\n }\n\n function parseScalarMember(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): ScalarConstructorNode {\n reportInvalidDecorators(decorators, \"scalar member\");\n\n parseExpected(Token.InitKeyword);\n const id = parseIdentifier();\n const { items: parameters } = parseFunctionParameters();\n return {\n kind: SyntaxKind.ScalarConstructor,\n id,\n parameters,\n ...finishNode(pos),\n };\n }\n\n function parseEnumStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): EnumStatementNode {\n parseExpected(Token.EnumKeyword);\n const id = parseIdentifier();\n const { items: members } = parseList(ListKind.EnumMembers, parseEnumMemberOrSpread);\n return {\n kind: SyntaxKind.EnumStatement,\n id,\n decorators,\n members,\n ...finishNode(pos),\n };\n }\n\n function parseEnumMemberOrSpread(pos: number, decorators: DecoratorExpressionNode[]) {\n return token() === Token.Ellipsis\n ? parseEnumSpreadMember(pos, decorators)\n : parseEnumMember(pos, decorators);\n }\n\n function parseEnumSpreadMember(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): EnumSpreadMemberNode {\n parseExpected(Token.Ellipsis);\n\n reportInvalidDecorators(decorators, \"spread enum\");\n\n const target = parseReferenceExpression();\n\n return {\n kind: SyntaxKind.EnumSpreadMember,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseEnumMember(pos: number, decorators: DecoratorExpressionNode[]): EnumMemberNode {\n const id = parseIdentifier({\n message: \"enumMember\",\n allowStringLiteral: true,\n allowReservedIdentifier: true,\n });\n\n let value: StringLiteralNode | NumericLiteralNode | undefined;\n if (parseOptional(Token.Colon)) {\n const expr = parseExpression();\n\n if (expr.kind === SyntaxKind.StringLiteral || expr.kind === SyntaxKind.NumericLiteral) {\n value = expr;\n } else if (\n expr.kind === SyntaxKind.TypeReference &&\n expr.target.flags & NodeFlags.ThisNodeHasError\n ) {\n parseErrorInNextFinishedNode = true;\n } else {\n error({ code: \"token-expected\", messageId: \"numericOrStringLiteral\", target: expr });\n }\n }\n\n return {\n kind: SyntaxKind.EnumMember,\n id,\n value,\n decorators,\n ...finishNode(pos),\n };\n }\n\n function parseAliasStatement(pos: number): AliasStatementNode {\n parseExpected(Token.AliasKeyword);\n const id = parseIdentifier();\n const { items: templateParameters, range: templateParametersRange } =\n parseTemplateParameterList();\n parseExpected(Token.Equals);\n const value = parseExpression();\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.AliasStatement,\n id,\n templateParameters,\n templateParametersRange,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseConstStatement(pos: number): ConstStatementNode {\n parseExpected(Token.ConstKeyword);\n const id = parseIdentifier();\n const type = parseOptionalTypeAnnotation();\n parseExpected(Token.Equals);\n const value = parseExpression();\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.ConstStatement,\n id,\n value,\n type,\n ...finishNode(pos),\n };\n }\n\n function parseOptionalTypeAnnotation(): Expression | undefined {\n if (parseOptional(Token.Colon)) {\n return parseExpression();\n }\n return undefined;\n }\n\n function parseExpression(): Expression {\n return parseUnionExpressionOrHigher();\n }\n\n function parseUnionExpressionOrHigher(): Expression {\n const pos = tokenPos();\n parseOptional(Token.Bar);\n const node: Expression = parseIntersectionExpressionOrHigher();\n\n if (token() !== Token.Bar) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Bar)) {\n const expr = parseIntersectionExpressionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.UnionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseIntersectionExpressionOrHigher(): Expression {\n const pos = tokenPos();\n parseOptional(Token.Ampersand);\n const node: Expression = parseArrayExpressionOrHigher();\n\n if (token() !== Token.Ampersand) {\n return node;\n }\n\n const options = [node];\n while (parseOptional(Token.Ampersand)) {\n const expr = parseArrayExpressionOrHigher();\n options.push(expr);\n }\n\n return {\n kind: SyntaxKind.IntersectionExpression,\n options,\n ...finishNode(pos),\n };\n }\n\n function parseArrayExpressionOrHigher(): Expression {\n const pos = tokenPos();\n let expr = parsePrimaryExpression();\n\n while (parseOptional(Token.OpenBracket)) {\n parseExpected(Token.CloseBracket);\n\n expr = {\n kind: SyntaxKind.ArrayExpression,\n elementType: expr,\n ...finishNode(pos),\n };\n }\n\n return expr;\n }\n\n function parseStandaloneReferenceExpression() {\n const expr = parseReferenceExpression();\n if (parseDiagnostics.length === 0 && token() !== Token.EndOfFile) {\n error({ code: \"token-expected\", messageId: \"unexpected\", format: { token: Token[token()] } });\n }\n return expr;\n }\n\n function parseValueOfExpression(): ValueOfExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.ValueOfKeyword);\n const target = parseExpression();\n\n return {\n kind: SyntaxKind.ValueOfExpression,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseTypeOfExpression(): TypeOfExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.TypeOfKeyword);\n const target = parseTypeOfTarget();\n\n return {\n kind: SyntaxKind.TypeOfExpression,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseTypeOfTarget(): Expression {\n while (true) {\n switch (token()) {\n case Token.TypeOfKeyword:\n return parseTypeOfExpression();\n case Token.Identifier:\n return parseCallOrReferenceExpression();\n case Token.StringLiteral:\n return parseStringLiteral();\n case Token.StringTemplateHead:\n return parseStringTemplateExpression();\n case Token.TrueKeyword:\n case Token.FalseKeyword:\n return parseBooleanLiteral();\n case Token.NumericLiteral:\n return parseNumericLiteral();\n case Token.OpenParen:\n parseExpected(Token.OpenParen);\n const target = parseTypeOfTarget();\n parseExpected(Token.CloseParen);\n return target;\n default:\n return parseReferenceExpression(\"typeofTarget\");\n }\n }\n }\n\n function parseReferenceExpression(\n message?: keyof CompilerDiagnostics[\"token-expected\"],\n ): TypeReferenceNode {\n const pos = tokenPos();\n const target = parseIdentifierOrMemberExpression({\n message,\n allowReservedIdentifierInMember: true,\n });\n return parseReferenceExpressionInternal(target, pos);\n }\n\n function parseCallOrReferenceExpression(\n message?: keyof CompilerDiagnostics[\"token-expected\"],\n ): TypeReferenceNode | CallExpressionNode {\n const pos = tokenPos();\n const target = parseIdentifierOrMemberExpression({\n message,\n allowReservedIdentifierInMember: true,\n });\n if (token() === Token.OpenParen) {\n const { items: args } = parseList(ListKind.FunctionArguments, parseExpression);\n return {\n kind: SyntaxKind.CallExpression,\n target,\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n return parseReferenceExpressionInternal(target, pos);\n }\n\n function parseReferenceExpressionInternal(\n target: IdentifierNode | MemberExpressionNode,\n pos: number,\n ): TypeReferenceNode {\n const { items: args } = parseOptionalList(ListKind.TemplateArguments, parseTemplateArgument);\n\n return {\n kind: SyntaxKind.TypeReference,\n target,\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n function parseTemplateArgument(): TemplateArgumentNode {\n const pos = tokenPos();\n\n // Early error recovery for missing identifier followed by eq\n if (token() === Token.Equals) {\n error({ code: \"token-expected\", messageId: \"identifier\" });\n nextToken();\n return {\n kind: SyntaxKind.TemplateArgument,\n name: createMissingIdentifier(),\n argument: parseExpression(),\n ...finishNode(pos),\n };\n }\n\n const expr: Expression = parseExpression();\n\n const eq = parseOptional(Token.Equals);\n\n if (eq) {\n const isBareIdentifier = exprIsBareIdentifier(expr);\n\n if (!isBareIdentifier) {\n error({ code: \"invalid-template-argument-name\", target: expr });\n }\n\n return {\n kind: SyntaxKind.TemplateArgument,\n name: isBareIdentifier ? expr.target : createMissingIdentifier(),\n argument: parseExpression(),\n ...finishNode(pos),\n };\n } else {\n return {\n kind: SyntaxKind.TemplateArgument,\n argument: expr,\n ...finishNode(pos),\n };\n }\n }\n\n function parseAugmentDecorator(): AugmentDecoratorStatementNode {\n const pos = tokenPos();\n parseExpected(Token.AtAt);\n\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier. We want to parse `@ model Foo` as invalid decorator\n // `@<missing identifier>` applied to `model Foo`, and not as `@model`\n // applied to invalid statement `Foo`.\n const target = parseIdentifierOrMemberExpression({\n allowReservedIdentifier: true,\n allowReservedIdentifierInMember: true,\n });\n const { items: args } = parseOptionalList(ListKind.DecoratorArguments, parseExpression);\n if (args.length === 0) {\n error({ code: \"augment-decorator-target\" });\n const emptyList = createEmptyList<TemplateArgumentNode>();\n return {\n kind: SyntaxKind.AugmentDecoratorStatement,\n target,\n targetType: {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: emptyList.items,\n ...finishNode(pos),\n },\n arguments: args,\n ...finishNode(pos),\n };\n }\n let [targetEntity, ...decoratorArgs] = args;\n if (targetEntity.kind !== SyntaxKind.TypeReference) {\n error({ code: \"augment-decorator-target\", target: targetEntity });\n const emptyList = createEmptyList<TemplateArgumentNode>();\n targetEntity = {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: emptyList.items,\n ...finishNode(pos),\n };\n }\n\n parseExpected(Token.Semicolon);\n\n return {\n kind: SyntaxKind.AugmentDecoratorStatement,\n target,\n targetType: targetEntity,\n arguments: decoratorArgs,\n ...finishNode(pos),\n };\n }\n function parseImportStatement(): ImportStatementNode {\n const pos = tokenPos();\n\n parseExpected(Token.ImportKeyword);\n const path = parseStringLiteral();\n\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.ImportStatement,\n path,\n ...finishNode(pos),\n };\n }\n\n function parseDecoratorExpression(): DecoratorExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.At);\n\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier. We want to parse `@ model Foo` as invalid decorator\n // `@<missing identifier>` applied to `model Foo`, and not as `@model`\n // applied to invalid statement `Foo`.\n const target = parseIdentifierOrMemberExpression({\n allowReservedIdentifier: true,\n allowReservedIdentifierInMember: true,\n });\n const { items: args } = parseOptionalList(ListKind.DecoratorArguments, parseExpression);\n return {\n kind: SyntaxKind.DecoratorExpression,\n arguments: args,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseDirectiveExpression(): DirectiveExpressionNode {\n const pos = tokenPos();\n parseExpected(Token.Hash);\n\n const target = parseIdentifier();\n if (target.sv !== \"suppress\" && target.sv !== \"deprecated\") {\n error({\n code: \"unknown-directive\",\n format: { id: target.sv },\n target: { pos, end: pos + target.sv.length },\n printable: true,\n });\n }\n // The newline will mark the end of the directive.\n newLineIsTrivia = false;\n const args = [];\n while (token() !== Token.NewLine && token() !== Token.EndOfFile) {\n const param = parseDirectiveParameter();\n if (param) {\n args.push(param);\n }\n }\n\n newLineIsTrivia = true;\n nextToken();\n return {\n kind: SyntaxKind.DirectiveExpression,\n arguments: args,\n target,\n ...finishNode(pos),\n };\n }\n\n function parseDirectiveParameter(): DirectiveArgument | undefined {\n switch (token()) {\n case Token.Identifier:\n return parseIdentifier();\n case Token.StringLiteral:\n return parseStringLiteral();\n default:\n error({\n code: \"token-expected\",\n messageId: \"unexpected\",\n format: { token: Token[token()] },\n });\n do {\n nextToken();\n } while (\n !isStatementKeyword(token()) &&\n token() !== Token.NewLine &&\n token() !== Token.At &&\n token() !== Token.Semicolon &&\n token() !== Token.EndOfFile\n );\n return undefined;\n }\n }\n\n function parseIdentifierOrMemberExpression(options?: {\n message?: keyof CompilerDiagnostics[\"token-expected\"];\n // Temporary solution see doc on parseIdentifier\n allowReservedIdentifier?: boolean;\n allowReservedIdentifierInMember?: boolean;\n }): IdentifierNode | MemberExpressionNode {\n const pos = tokenPos();\n let base: IdentifierNode | MemberExpressionNode = parseIdentifier({\n message: options?.message,\n allowReservedIdentifier: options?.allowReservedIdentifier,\n });\n while (token() !== Token.EndOfFile) {\n if (parseOptional(Token.Dot)) {\n base = {\n kind: SyntaxKind.MemberExpression,\n base,\n // Error recovery: false arg here means don't treat a keyword as an\n // identifier after `.` in member expression. Otherwise we will\n // parse `@Outer.<missing identifier> model M{}` as having decorator\n // `@Outer.model` applied to invalid statement `M {}` instead of\n // having incomplete decorator `@Outer.` applied to `model M {}`.\n id: parseIdentifier({\n allowReservedIdentifier: options?.allowReservedIdentifierInMember,\n }),\n selector: \".\",\n ...finishNode(pos),\n };\n } else if (parseOptional(Token.ColonColon)) {\n base = {\n kind: SyntaxKind.MemberExpression,\n base,\n id: parseIdentifier(),\n selector: \"::\",\n ...finishNode(pos),\n };\n } else {\n break;\n }\n }\n\n return base;\n }\n\n function parsePrimaryExpression(): Expression {\n while (true) {\n switch (token()) {\n case Token.TypeOfKeyword:\n return parseTypeOfExpression();\n case Token.Identifier:\n return parseCallOrReferenceExpression();\n case Token.StringLiteral:\n return parseStringLiteral();\n case Token.StringTemplateHead:\n return parseStringTemplateExpression();\n case Token.TrueKeyword:\n case Token.FalseKeyword:\n return parseBooleanLiteral();\n case Token.NumericLiteral:\n return parseNumericLiteral();\n case Token.OpenBrace:\n return parseModelExpression();\n case Token.OpenBracket:\n return parseTupleExpression();\n case Token.OpenParen:\n return parseParenthesizedExpression();\n case Token.At:\n const decorators = parseDecoratorList();\n reportInvalidDecorators(decorators, \"expression\");\n continue;\n case Token.Hash:\n const directives = parseDirectiveList();\n reportInvalidDirective(directives, \"expression\");\n continue;\n case Token.HashBrace:\n return parseObjectLiteral();\n case Token.HashBracket:\n return parseArrayLiteral();\n case Token.VoidKeyword:\n return parseVoidKeyword();\n case Token.NeverKeyword:\n return parseNeverKeyword();\n case Token.UnknownKeyword:\n return parseUnknownKeyword();\n default:\n return parseReferenceExpression(\"expression\");\n }\n }\n }\n\n function parseExternKeyword(): ExternKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.ExternKeyword);\n return {\n kind: SyntaxKind.ExternKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseVoidKeyword(): VoidKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.VoidKeyword);\n return {\n kind: SyntaxKind.VoidKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseNeverKeyword(): NeverKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.NeverKeyword);\n return {\n kind: SyntaxKind.NeverKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseUnknownKeyword(): AnyKeywordNode {\n const pos = tokenPos();\n parseExpected(Token.UnknownKeyword);\n return {\n kind: SyntaxKind.UnknownKeyword,\n ...finishNode(pos),\n };\n }\n\n function parseParenthesizedExpression(): Expression {\n const pos = tokenPos();\n parseExpected(Token.OpenParen);\n const expr = parseExpression();\n parseExpected(Token.CloseParen);\n return { ...expr, ...finishNode(pos) };\n }\n\n function parseTupleExpression(): TupleExpressionNode {\n const pos = tokenPos();\n const { items: values } = parseList(ListKind.Tuple, parseExpression);\n return {\n kind: SyntaxKind.TupleExpression,\n values,\n ...finishNode(pos),\n };\n }\n\n function parseModelExpression(): ModelExpressionNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.ModelProperties,\n parseModelPropertyOrSpread,\n );\n return {\n kind: SyntaxKind.ModelExpression,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n }\n\n function parseObjectLiteral(): ObjectLiteralNode {\n const pos = tokenPos();\n const { items: properties, range: bodyRange } = parseList(\n ListKind.ObjectLiteralProperties,\n parseObjectLiteralPropertyOrSpread,\n );\n return {\n kind: SyntaxKind.ObjectLiteral,\n properties,\n bodyRange,\n ...finishNode(pos),\n };\n }\n\n function parseArrayLiteral(): ArrayLiteralNode {\n const pos = tokenPos();\n const { items: values } = parseList(ListKind.ArrayLiteral, parseExpression);\n return {\n kind: SyntaxKind.ArrayLiteral,\n values,\n ...finishNode(pos),\n };\n }\n\n function parseStringLiteral(): StringLiteralNode {\n const pos = tokenPos();\n const value = tokenValue();\n parseExpected(Token.StringLiteral);\n return {\n kind: SyntaxKind.StringLiteral,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateExpression(): StringTemplateExpressionNode {\n const pos = tokenPos();\n const head = parseStringTemplateHead();\n const spans = parseStringTemplateSpans(head.tokenFlags);\n const last = spans[spans.length - 1];\n\n if (head.tokenFlags & TokenFlags.TripleQuoted) {\n const [indentationsStart, indentationEnd] = scanner.findTripleQuotedStringIndent(\n last.literal.pos,\n last.literal.end,\n );\n mutate(head).value = scanner.unindentAndUnescapeTripleQuotedString(\n head.pos,\n head.end,\n indentationsStart,\n indentationEnd,\n Token.StringTemplateHead,\n head.tokenFlags,\n );\n for (const span of spans) {\n mutate(span.literal).value = scanner.unindentAndUnescapeTripleQuotedString(\n span.literal.pos,\n span.literal.end,\n indentationsStart,\n indentationEnd,\n span === last ? Token.StringTemplateTail : Token.StringTemplateMiddle,\n head.tokenFlags,\n );\n }\n }\n return {\n kind: SyntaxKind.StringTemplateExpression,\n head,\n spans,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateHead(): StringTemplateHeadNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n\n parseExpected(Token.StringTemplateHead);\n\n return {\n kind: SyntaxKind.StringTemplateHead,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n\n function parseStringTemplateSpans(tokenFlags: TokenFlags): readonly StringTemplateSpanNode[] {\n const list: StringTemplateSpanNode[] = [];\n let node: StringTemplateSpanNode;\n do {\n node = parseTemplateTypeSpan(tokenFlags);\n list.push(node);\n } while (node.literal.kind === SyntaxKind.StringTemplateMiddle);\n return list;\n }\n\n function parseTemplateTypeSpan(tokenFlags: TokenFlags): StringTemplateSpanNode {\n const pos = tokenPos();\n const expression = parseExpression();\n const literal = parseLiteralOfTemplateSpan(tokenFlags);\n return {\n kind: SyntaxKind.StringTemplateSpan,\n literal,\n expression,\n ...finishNode(pos),\n };\n }\n function parseLiteralOfTemplateSpan(\n headTokenFlags: TokenFlags,\n ): StringTemplateMiddleNode | StringTemplateTailNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n\n if (token() === Token.CloseBrace) {\n nextStringTemplateToken(headTokenFlags);\n return parseTemplateMiddleOrTemplateTail();\n } else {\n parseExpected(Token.StringTemplateTail);\n return {\n kind: SyntaxKind.StringTemplateTail,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n }\n\n function parseTemplateMiddleOrTemplateTail(): StringTemplateMiddleNode | StringTemplateTailNode {\n const pos = tokenPos();\n const flags = tokenFlags();\n const text = flags & TokenFlags.TripleQuoted ? \"\" : tokenValue();\n const kind =\n token() === Token.StringTemplateMiddle\n ? SyntaxKind.StringTemplateMiddle\n : SyntaxKind.StringTemplateTail;\n\n nextToken();\n return {\n kind,\n value: text,\n tokenFlags: flags,\n ...finishNode(pos),\n };\n }\n\n function parseNumericLiteral(): NumericLiteralNode {\n const pos = tokenPos();\n const valueAsString = tokenValue();\n const value = Number(valueAsString);\n\n parseExpected(Token.NumericLiteral);\n return {\n kind: SyntaxKind.NumericLiteral,\n value,\n valueAsString,\n ...finishNode(pos),\n };\n }\n\n function parseBooleanLiteral(): BooleanLiteralNode {\n const pos = tokenPos();\n const token = parseExpectedOneOf(Token.TrueKeyword, Token.FalseKeyword);\n const value = token === Token.TrueKeyword;\n return {\n kind: SyntaxKind.BooleanLiteral,\n value,\n ...finishNode(pos),\n };\n }\n\n function parseIdentifier(options?: {\n message?: keyof CompilerDiagnostics[\"token-expected\"];\n allowStringLiteral?: boolean; // Allow string literals to be used as identifiers for backward-compatibility, but convert to an identifier node.\n\n // Temporary solution to allow reserved keywords as identifiers in certain contexts. This should get expanded to a more general solution per keyword category.\n allowReservedIdentifier?: boolean;\n }): IdentifierNode {\n if (isKeyword(token())) {\n error({ code: \"reserved-identifier\" });\n return createMissingIdentifier();\n } else if (isReservedKeyword(token())) {\n if (!options?.allowReservedIdentifier) {\n error({ code: \"reserved-identifier\", messageId: \"future\", format: { name: tokenValue() } });\n }\n } else if (\n token() !== Token.Identifier &&\n (!options?.allowStringLiteral || token() !== Token.StringLiteral)\n ) {\n // Error recovery: when we fail to parse an identifier or expression,\n // we insert a synthesized identifier with a unique name.\n error({ code: \"token-expected\", messageId: options?.message ?? \"identifier\" });\n return createMissingIdentifier();\n }\n\n const pos = tokenPos();\n const sv = tokenValue();\n nextToken();\n\n return {\n kind: SyntaxKind.Identifier,\n sv,\n ...finishNode(pos),\n };\n }\n\n function parseDeclaration(\n pos: number,\n ): DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode | InvalidStatementNode {\n const modifiers = parseModifiers();\n switch (token()) {\n case Token.DecKeyword:\n return parseDecoratorDeclarationStatement(pos, modifiers);\n case Token.FnKeyword:\n return parseFunctionDeclarationStatement(pos, modifiers);\n }\n return parseInvalidStatement(pos, []);\n }\n\n function parseModifiers(): Modifier[] {\n const modifiers: Modifier[] = [];\n let modifier;\n while ((modifier = parseModifier())) {\n modifiers.push(modifier);\n }\n return modifiers;\n }\n\n function parseModifier(): Modifier | undefined {\n switch (token()) {\n case Token.ExternKeyword:\n return parseExternKeyword();\n default:\n return undefined;\n }\n }\n\n function parseDecoratorDeclarationStatement(\n pos: number,\n modifiers: Modifier[],\n ): DecoratorDeclarationStatementNode {\n const modifierFlags = modifiersToFlags(modifiers);\n parseExpected(Token.DecKeyword);\n const id = parseIdentifier();\n const allParamListDetail = parseFunctionParameters();\n let [target, ...parameters] = allParamListDetail.items;\n if (target === undefined) {\n error({ code: \"decorator-decl-target\", target: { pos, end: previousTokenEnd } });\n target = {\n kind: SyntaxKind.FunctionParameter,\n id: createMissingIdentifier(),\n type: createMissingTypeReference(),\n optional: false,\n rest: false,\n ...finishNode(pos),\n };\n }\n if (target.optional) {\n error({ code: \"decorator-decl-target\", messageId: \"required\" });\n }\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.DecoratorDeclarationStatement,\n modifiers,\n modifierFlags,\n id,\n target,\n parameters,\n ...finishNode(pos),\n };\n }\n\n function parseFunctionDeclarationStatement(\n pos: number,\n modifiers: Modifier[],\n ): FunctionDeclarationStatementNode {\n const modifierFlags = modifiersToFlags(modifiers);\n parseExpected(Token.FnKeyword);\n const id = parseIdentifier();\n const { items: parameters } = parseFunctionParameters();\n let returnType;\n if (parseOptional(Token.Colon)) {\n returnType = parseExpression();\n }\n parseExpected(Token.Semicolon);\n return {\n kind: SyntaxKind.FunctionDeclarationStatement,\n modifiers,\n modifierFlags,\n id,\n parameters,\n returnType,\n ...finishNode(pos),\n };\n }\n\n function parseFunctionParameters(): ListDetail<FunctionParameterNode> {\n const parameters = parseList<typeof ListKind.FunctionParameters, FunctionParameterNode>(\n ListKind.FunctionParameters,\n parseFunctionParameter,\n );\n\n let foundOptional = false;\n for (const [index, item] of parameters.items.entries()) {\n if (!item.optional && foundOptional) {\n error({ code: \"required-parameter-first\", target: item });\n continue;\n }\n\n if (item.optional) {\n foundOptional = true;\n }\n\n if (item.rest && item.optional) {\n error({ code: \"rest-parameter-required\", target: item });\n }\n if (item.rest && index !== parameters.items.length - 1) {\n error({ code: \"rest-parameter-last\", target: item });\n }\n }\n return parameters;\n }\n\n function parseFunctionParameter(): FunctionParameterNode {\n const pos = tokenPos();\n const rest = parseOptional(Token.Ellipsis);\n const id = parseIdentifier({ message: \"property\", allowReservedIdentifier: true });\n\n const optional = parseOptional(Token.Question);\n let type;\n if (parseOptional(Token.Colon)) {\n type = parseMixedParameterConstraint();\n }\n return {\n kind: SyntaxKind.FunctionParameter,\n id,\n type,\n optional,\n rest,\n ...finishNode(pos),\n };\n }\n\n function modifiersToFlags(modifiers: Modifier[]): ModifierFlags {\n let flags = ModifierFlags.None;\n for (const modifier of modifiers) {\n switch (modifier.kind) {\n case SyntaxKind.ExternKeyword:\n flags |= ModifierFlags.Extern;\n break;\n }\n }\n return flags;\n }\n\n function parseRange<T>(mode: ParseMode, range: TextRange, callback: () => T): T {\n const savedMode = currentMode;\n const result = scanner.scanRange(range, () => {\n currentMode = mode;\n nextToken();\n return callback();\n });\n currentMode = savedMode;\n return result;\n }\n\n /** Remove leading slash-star-star and trailing star-slash (if terminated) from doc comment range. */\n function innerDocRange(range: TextRange): TextRange {\n return {\n pos: range.pos + 3,\n end: tokenFlags() & TokenFlags.Unterminated ? range.end : range.end - 2,\n };\n }\n\n function parseDocList(): [pos: number, nodes: DocNode[]] {\n if (docRanges.length === 0 || options.docs === false) {\n return [tokenPos(), []];\n }\n const docs: DocNode[] = [];\n for (const range of docRanges) {\n const doc = parseRange(ParseMode.Doc, innerDocRange(range), () => parseDoc(range));\n docs.push(doc);\n if (range.comment) {\n mutate(range.comment).parsedAsDocs = true;\n }\n }\n\n return [docRanges[0].pos, docs];\n }\n\n function parseDoc(range: TextRange): DocNode {\n const content: DocContent[] = [];\n const tags: DocTag[] = [];\n\n loop: while (true) {\n switch (token()) {\n case Token.EndOfFile:\n break loop;\n case Token.At:\n const tag = parseDocTag();\n tags.push(tag);\n break;\n default:\n content.push(...parseDocContent());\n break;\n }\n }\n\n return {\n kind: SyntaxKind.Doc,\n content,\n tags,\n ...finishNode(range.pos),\n end: range.end,\n };\n }\n\n function parseDocContent(): DocContent[] {\n const parts: string[] = [];\n const source = scanner.file.text;\n const pos = tokenPos();\n\n let start = pos;\n let inCodeFence = false;\n\n loop: while (true) {\n switch (token()) {\n case Token.DocCodeFenceDelimiter:\n inCodeFence = !inCodeFence;\n nextToken();\n break;\n case Token.NewLine:\n parts.push(source.substring(start, tokenPos()));\n parts.push(\"\\n\"); // normalize line endings\n nextToken();\n start = tokenPos();\n while (parseOptional(Token.Whitespace));\n if (!parseOptional(Token.Star)) {\n break;\n }\n if (!inCodeFence) {\n parseOptional(Token.Whitespace);\n start = tokenPos();\n break;\n }\n // If we are in a code fence we want to preserve the leading whitespace\n // except for the first space after the star which is used as indentation.\n const whitespaceStart = tokenPos();\n parseOptional(Token.Whitespace);\n\n // This `min` handles the case when there is no whitespace after the\n // star e.g. a case like this:\n //\n // /**\n // *```\n // *foo-bar\n // *```\n // */\n //\n // Not having space after the star isn't idiomatic, but we support this.\n // `whitespaceStart + 1` strips the first space before `foo-bar` if there\n // is a space after the star (the idiomatic case).\n start = Math.min(whitespaceStart + 1, tokenPos());\n break;\n case Token.EndOfFile:\n break loop;\n case Token.At:\n if (!inCodeFence) {\n break loop;\n }\n nextToken();\n break;\n case Token.DocText:\n parts.push(source.substring(start, tokenPos()));\n parts.push(tokenValue());\n nextToken();\n start = tokenPos();\n break;\n default:\n nextToken();\n break;\n }\n }\n\n parts.push(source.substring(start, tokenPos()));\n const text = trim(parts.join(\"\"));\n\n return [\n {\n kind: SyntaxKind.DocText,\n text,\n ...finishNode(pos),\n },\n ];\n }\n\n type ParamLikeTag = DocTemplateTagNode | DocParamTagNode;\n type SimpleTag = DocReturnsTagNode | DocErrorsTagNode | DocUnknownTagNode;\n\n /**\n * Parses a documentation tag.\n *\n * @see <a href=\"https://typespec.io/docs/language-basics/documentation#doc-comments\">TypeSpec documentation docs</a>\n */\n function parseDocTag(): DocTag {\n const pos = tokenPos();\n parseExpected(Token.At);\n const tagName = parseDocIdentifier(\"tag\");\n switch (tagName.sv) {\n case \"param\":\n return parseDocParamLikeTag(pos, tagName, SyntaxKind.DocParamTag, \"param\");\n case \"template\":\n return parseDocParamLikeTag(pos, tagName, SyntaxKind.DocTemplateTag, \"templateParam\");\n case \"prop\":\n return parseDocPropTag(pos, tagName);\n case \"return\":\n case \"returns\":\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocReturnsTag);\n case \"errors\":\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocErrorsTag);\n default:\n return parseDocSimpleTag(pos, tagName, SyntaxKind.DocUnknownTag);\n }\n }\n\n /**\n * Handles param-like documentation comment tags.\n * For example, `@param` and `@template`.\n */\n function parseDocParamLikeTag(\n pos: number,\n tagName: IdentifierNode,\n kind: ParamLikeTag[\"kind\"],\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): ParamLikeTag {\n const { name, content } = parseDocParamLikeTagInternal(messageId);\n\n return {\n kind,\n tagName,\n paramName: name,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocPropTag(pos: number, tagName: IdentifierNode): DocPropTagNode {\n const { name, content } = parseDocParamLikeTagInternal(\"prop\");\n\n return {\n kind: SyntaxKind.DocPropTag,\n tagName,\n propName: name,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocParamLikeTagInternal(\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): { name: IdentifierNode; content: DocTextNode[] } {\n const name = parseDocIdentifier(messageId);\n parseOptionalHyphenDocParamLikeTag();\n const content = parseDocContent();\n return { name, content };\n }\n\n /**\n * Handles the optional hyphen in param-like documentation comment tags.\n *\n * TypeSpec recommends no hyphen, but supports a hyphen to match TSDoc.\n * (Original design discussion recorded in [2390].)\n *\n * [2390]: https://github.com/microsoft/typespec/issues/2390\n */\n function parseOptionalHyphenDocParamLikeTag() {\n while (parseOptional(Token.Whitespace)); // Skip whitespace\n if (parseOptional(Token.Hyphen)) {\n // The doc content started with a hyphen, so skip subsequent whitespace\n // (The if statement already advanced past the hyphen itself.)\n while (parseOptional(Token.Whitespace));\n }\n }\n\n function parseDocSimpleTag(\n pos: number,\n tagName: IdentifierNode,\n kind: SimpleTag[\"kind\"],\n ): SimpleTag {\n const content = parseDocContent();\n return {\n kind,\n tagName,\n content,\n ...finishNode(pos),\n };\n }\n\n function parseDocIdentifier(\n messageId: keyof CompilerDiagnostics[\"doc-invalid-identifier\"],\n ): IdentifierNode {\n // We don't allow whitespace between @ and tag name, but allow\n // whitespace before all other identifiers.\n if (messageId !== \"tag\") {\n while (parseOptional(Token.Whitespace));\n }\n\n const pos = tokenPos();\n let sv: string;\n\n if (token() === Token.Identifier) {\n sv = tokenValue();\n nextToken();\n } else if (token() === Token.DocCodeSpan) {\n // Support DocCodeSpan as identifier\n sv = tokenValue();\n nextToken();\n } else {\n sv = \"\";\n warning({ code: \"doc-invalid-identifier\", messageId });\n }\n\n return {\n kind: SyntaxKind.Identifier,\n sv,\n ...finishNode(pos),\n };\n }\n\n // utility functions\n function token() {\n return scanner.token;\n }\n\n function tokenFlags() {\n return scanner.tokenFlags;\n }\n\n function tokenValue() {\n return scanner.getTokenValue();\n }\n\n function tokenPos() {\n return scanner.tokenPosition;\n }\n\n function tokenEnd() {\n return scanner.position;\n }\n\n function nextToken() {\n // keep track of the previous token end separately from the current scanner\n // position as these will differ when the previous token had trailing\n // trivia, and we don't want to squiggle the trivia.\n previousTokenEnd = scanner.position;\n return currentMode === ParseMode.Syntax ? nextSyntaxToken() : nextDocToken();\n }\n\n function nextSyntaxToken() {\n docRanges = [];\n\n for (;;) {\n scanner.scan();\n if (isTrivia(token())) {\n if (!newLineIsTrivia && token() === Token.NewLine) {\n break;\n }\n let comment: LineComment | BlockComment | undefined = undefined;\n if (options.comments && isComment(token())) {\n comment = {\n kind:\n token() === Token.SingleLineComment\n ? SyntaxKind.LineComment\n : SyntaxKind.BlockComment,\n pos: tokenPos(),\n end: tokenEnd(),\n };\n comments.push(comment!);\n }\n if (tokenFlags() & TokenFlags.DocComment) {\n docRanges.push({\n pos: tokenPos(),\n end: tokenEnd(),\n comment: comment as BlockComment,\n });\n }\n } else {\n break;\n }\n }\n }\n\n function nextDocToken() {\n // NOTE: trivia tokens are always significant in doc comments.\n scanner.scanDoc();\n }\n\n function nextStringTemplateToken(tokenFlags: TokenFlags) {\n scanner.reScanStringTemplate(tokenFlags);\n }\n\n function createMissingIdentifier(): IdentifierNode {\n const pos = tokenPos();\n previousTokenEnd = pos;\n missingIdentifierCounter++;\n\n return {\n kind: SyntaxKind.Identifier,\n sv: \"<missing identifier>\" + missingIdentifierCounter,\n ...finishNode(pos),\n };\n }\n\n function createMissingTypeReference(): TypeReferenceNode {\n const pos = tokenPos();\n const { items: args } = createEmptyList<TemplateArgumentNode>();\n\n return {\n kind: SyntaxKind.TypeReference,\n target: createMissingIdentifier(),\n arguments: args,\n ...finishNode(pos),\n };\n }\n\n function finishNode(pos: number): TextRange & { flags: NodeFlags; symbol: Sym } {\n const flags = parseErrorInNextFinishedNode ? NodeFlags.ThisNodeHasError : NodeFlags.None;\n parseErrorInNextFinishedNode = false;\n return withSymbol({ pos, end: previousTokenEnd, flags });\n }\n\n // pretend to add as symbol property, likely to a node that is being created.\n function withSymbol<T extends { symbol: Sym }>(obj: Omit<T, \"symbol\">): T {\n return obj as any;\n }\n\n function createEmptyList<T extends Node>(range: TextRange = { pos: -1, end: -1 }): ListDetail<T> {\n return {\n items: [],\n range,\n };\n }\n\n /**\n * Parse a delimited list of elements, including the surrounding open and\n * close punctuation\n *\n * This shared driver function is used to share sensitive error recovery code.\n * In particular, error recovery by inserting tokens deemed missing is\n * susceptible to getting stalled in a loop iteration without making any\n * progress, and we guard against this in a shared place here.\n *\n * Note that statement and decorator lists do not have this issue. We always\n * consume at least a real '@' for a decorator and if the leading token of a\n * statement is not one of our statement keywords, ';', or '@', it is consumed\n * as part of a bad statement. As such, parsing of decorators and statements\n * do not go through here.\n */\n function parseList<K extends ListKind, T extends Node>(\n kind: K,\n parseItem: ParseListItem<K, T>,\n ): ListDetail<T> {\n const r: ListDetail<T> = createEmptyList<T>();\n if (kind.open !== Token.None) {\n const t = tokenPos();\n if (parseExpected(kind.open)) {\n mutate(r.range).pos = t;\n }\n }\n\n if (kind.allowEmpty && parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n return r;\n }\n\n while (true) {\n const startingPos = tokenPos();\n const { pos, docs, directives, decorators } = parseAnnotations({\n skipParsingDocNodes: Boolean(kind.invalidAnnotationTarget),\n });\n if (kind.invalidAnnotationTarget) {\n reportInvalidDecorators(decorators, kind.invalidAnnotationTarget);\n reportInvalidDirective(directives, kind.invalidAnnotationTarget);\n }\n\n if (directives.length === 0 && decorators.length === 0 && atEndOfListWithError(kind)) {\n // Error recovery: end surrounded list at statement keyword or end\n // of file. Note, however, that we must parse a missing element if\n // there were directives or decorators as we cannot drop those from\n // the tree.\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n break;\n }\n\n let item: T;\n if (kind.invalidAnnotationTarget) {\n item = (parseItem as ParseListItem<UnannotatedListKind, T>)();\n } else {\n item = parseItem(pos, decorators);\n mutate(item).docs = docs;\n mutate(item).directives = directives;\n }\n\n r.items.push(item);\n\n if (parseOptionalDelimiter(kind)) {\n // Delimiter found: check if it's trailing.\n if (parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n // It was trailing and we've consumed the close token.\n break;\n }\n // Not trailing. We can safely skip the progress check below here\n // because we know that we consumed a real delimiter.\n continue;\n } else if (kind.close === Token.None) {\n // If a list is *not* surrounded by punctuation, then the list ends when\n // there's no delimiter after an item.\n break;\n } else if (parseOptional(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n // If a list *is* surrounded by punctuation, then the list ends when we\n // reach the close token.\n break;\n } else if (atEndOfListWithError(kind)) {\n // Error recovery: If a list *is* surrounded by punctuation, then\n // the list ends at statement keyword or end-of-file under the\n // assumption that the closing delimiter is missing. This check is\n // duplicated from above to preempt the parseExpected(delimeter)\n // below.\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n break;\n } else {\n // Error recovery: if a list kind *is* surrounded by punctuation and we\n // find neither a delimiter nor a close token after an item, then we\n // assume there is a missing delimiter between items.\n //\n // Example: `model M { a: B <missing semicolon> c: D }\n parseExpected(kind.delimiter);\n }\n\n if (startingPos === tokenPos()) {\n // Error recovery: we've inserted everything during this loop iteration\n // and haven't made any progress. Assume that the current token is a bad\n // representation of the end of the the list that we're trying to get\n // through.\n //\n // Simple repro: `model M { ]` would loop forever without this check.\n //\n if (parseExpected(kind.close)) {\n mutate(r.range).end = previousTokenEnd;\n }\n nextToken();\n\n // remove the item that was entirely inserted by error recovery.\n r.items.pop();\n break;\n }\n }\n return r;\n }\n\n /**\n * Parse a delimited list with surrounding open and close punctuation if the\n * open token is present. Otherwise, return an empty list.\n */\n function parseOptionalList<K extends SurroundedListKind, T extends Node>(\n kind: K,\n parseItem: ParseListItem<K, T>,\n ): ListDetail<T> {\n return token() === kind.open ? parseList(kind, parseItem) : createEmptyList<T>();\n }\n\n function parseOptionalDelimiter(kind: ListKind) {\n if (parseOptional(kind.delimiter)) {\n return true;\n }\n\n if (token() === kind.toleratedDelimiter) {\n if (!kind.toleratedDelimiterIsValid) {\n parseExpected(kind.delimiter);\n }\n nextToken();\n return true;\n }\n\n return false;\n }\n\n function atEndOfListWithError(kind: ListKind) {\n return (\n kind.close !== Token.None &&\n (isStatementKeyword(token()) || token() === Token.EndOfFile) &&\n token() !== kind.allowedStatementKeyword\n );\n }\n\n function parseEmptyStatement(pos: number): EmptyStatementNode {\n parseExpected(Token.Semicolon);\n return { kind: SyntaxKind.EmptyStatement, ...finishNode(pos) };\n }\n\n function parseInvalidStatement(\n pos: number,\n decorators: DecoratorExpressionNode[],\n ): InvalidStatementNode {\n // Error recovery: avoid an avalanche of errors when we get cornered into\n // parsing statements where none exist. Skip until we find a statement\n // keyword or decorator and only report one error for a contiguous range of\n // neither.\n do {\n nextToken();\n } while (\n !isStatementKeyword(token()) &&\n token() !== Token.At &&\n token() !== Token.Semicolon &&\n token() !== Token.EndOfFile\n );\n\n error({\n code: \"token-expected\",\n messageId: \"statement\",\n target: { pos, end: previousTokenEnd },\n });\n return { kind: SyntaxKind.InvalidStatement, decorators, ...finishNode(pos) };\n }\n\n function error<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: DiagnosticReportWithoutTarget<CompilerDiagnostics, C, M> & {\n target?: Partial<TextRange> & { realPos?: number };\n printable?: boolean;\n },\n ) {\n parseErrorInNextFinishedNode = true;\n\n const location = {\n file: scanner.file,\n pos: report.target?.pos ?? tokenPos(),\n end: report.target?.end ?? tokenEnd(),\n };\n\n if (!report.printable) {\n treePrintable = false;\n }\n\n // Error recovery: don't report more than 1 consecutive error at the same\n // position. The code path taken by error recovery after logging an error\n // can otherwise produce redundant and less decipherable errors, which this\n // suppresses.\n const realPos = report.target?.realPos ?? location.pos;\n if (realPositionOfLastError === realPos) {\n return;\n }\n realPositionOfLastError = realPos;\n\n const diagnostic = createDiagnostic({\n ...report,\n target: location,\n } as any);\n\n assert(\n diagnostic.severity === \"error\",\n \"This function is for reporting errors. Use warning() for warnings.\",\n );\n\n parseDiagnostics.push(diagnostic);\n }\n\n function warning<\n C extends keyof CompilerDiagnostics,\n M extends keyof CompilerDiagnostics[C] = \"default\",\n >(\n report: DiagnosticReportWithoutTarget<CompilerDiagnostics, C, M> & {\n target?: Partial<TextRange>;\n },\n ) {\n const location = {\n file: scanner.file,\n pos: report.target?.pos ?? tokenPos(),\n end: report.target?.end ?? tokenEnd(),\n };\n\n const diagnostic = createDiagnostic({\n ...report,\n target: location,\n } as any);\n\n assert(\n diagnostic.severity === \"warning\",\n \"This function is for reporting warnings only. Use error() for errors.\",\n );\n\n parseDiagnostics.push(diagnostic);\n }\n\n function reportDiagnostic(diagnostic: Diagnostic) {\n if (diagnostic.severity === \"error\") {\n parseErrorInNextFinishedNode = true;\n treePrintable = false;\n }\n\n parseDiagnostics.push(diagnostic);\n }\n\n function assert(condition: boolean, message: string): asserts condition {\n const location = {\n file: scanner.file,\n pos: tokenPos(),\n end: tokenEnd(),\n };\n compilerAssert(condition, message, location);\n }\n\n function reportInvalidDecorators(decorators: DecoratorExpressionNode[], nodeName: string) {\n for (const decorator of decorators) {\n error({ code: \"invalid-decorator-location\", format: { nodeName }, target: decorator });\n }\n }\n function reportInvalidDirective(directives: DirectiveExpressionNode[], nodeName: string) {\n for (const directive of directives) {\n error({ code: \"invalid-directive-location\", format: { nodeName }, target: directive });\n }\n }\n\n function parseExpected(expectedToken: Token) {\n if (token() === expectedToken) {\n nextToken();\n return true;\n }\n\n const location = getAdjustedDefaultLocation(expectedToken);\n error({\n code: \"token-expected\",\n format: { token: TokenDisplay[expectedToken] },\n target: location,\n printable: isPunctuation(expectedToken),\n });\n return false;\n }\n\n function expectTokenIsOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const tok = token();\n for (const expected of args) {\n if (expected === Token.None) {\n continue;\n }\n if (tok === expected) {\n return tok;\n }\n }\n errorTokenIsNotOneOf(...args);\n return Token.None;\n }\n\n function parseExpectedOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const tok = expectTokenIsOneOf(...args);\n if (tok !== Token.None) {\n nextToken();\n }\n return tok;\n }\n\n function errorTokenIsNotOneOf(...args: [option1: Token, ...rest: Token[]]) {\n const location = getAdjustedDefaultLocation(args[0]);\n const displayList = args.map((t, i) => {\n if (i === args.length - 1) {\n return `or ${TokenDisplay[t]}`;\n }\n return TokenDisplay[t];\n });\n error({ code: \"token-expected\", format: { token: displayList.join(\", \") }, target: location });\n }\n\n function parseOptional(optionalToken: Token) {\n if (token() === optionalToken) {\n nextToken();\n return true;\n }\n\n return false;\n }\n\n function getAdjustedDefaultLocation(token: Token) {\n // Put the squiggly immediately after prior token when missing punctuation.\n // Avoids saying ';' is expected far away after a long comment, for example.\n // It's also confusing to squiggle the current token even if its nearby\n // in this case.\n return isPunctuation(token)\n ? { pos: previousTokenEnd, end: previousTokenEnd + 1, realPos: tokenPos() }\n : undefined;\n }\n}\n\nexport type NodeCallback<T> = (c: Node) => T;\n\nexport function exprIsBareIdentifier(\n expr: Expression,\n): expr is TypeReferenceNode & { target: IdentifierNode; arguments: [] } {\n return (\n expr.kind === SyntaxKind.TypeReference &&\n expr.target.kind === SyntaxKind.Identifier &&\n expr.arguments.length === 0\n );\n}\n\nexport function visitChildren<T>(node: Node, cb: NodeCallback<T>): T | undefined {\n if (node.directives) {\n const result = visitEach(cb, node.directives);\n if (result) return result;\n }\n if (node.docs) {\n const result = visitEach(cb, node.docs);\n if (result) return result;\n }\n\n switch (node.kind) {\n case SyntaxKind.TypeSpecScript:\n return visitNode(cb, node.id) || visitEach(cb, node.statements);\n case SyntaxKind.ArrayExpression:\n return visitNode(cb, node.elementType);\n case SyntaxKind.AugmentDecoratorStatement:\n return (\n visitNode(cb, node.target) ||\n visitNode(cb, node.targetType) ||\n visitEach(cb, node.arguments)\n );\n case SyntaxKind.DecoratorExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.CallExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.DirectiveExpression:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.ImportStatement:\n return visitNode(cb, node.path);\n case SyntaxKind.OperationStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.signature)\n );\n case SyntaxKind.OperationSignatureDeclaration:\n return visitNode(cb, node.parameters) || visitNode(cb, node.returnType);\n case SyntaxKind.OperationSignatureReference:\n return visitNode(cb, node.baseOperation);\n case SyntaxKind.NamespaceStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n (isArray(node.statements) ? visitEach(cb, node.statements) : visitNode(cb, node.statements))\n );\n case SyntaxKind.InterfaceStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.extends) ||\n visitEach(cb, node.operations)\n );\n case SyntaxKind.UsingStatement:\n return visitNode(cb, node.name);\n case SyntaxKind.IntersectionExpression:\n return visitEach(cb, node.options);\n case SyntaxKind.MemberExpression:\n return visitNode(cb, node.base) || visitNode(cb, node.id);\n case SyntaxKind.ModelExpression:\n return visitEach(cb, node.properties);\n case SyntaxKind.ModelProperty:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitNode(cb, node.value) ||\n visitNode(cb, node.default)\n );\n case SyntaxKind.ModelSpreadProperty:\n return visitNode(cb, node.target);\n\n case SyntaxKind.ModelStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.extends) ||\n visitNode(cb, node.is) ||\n visitEach(cb, node.properties)\n );\n case SyntaxKind.ScalarStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.members) ||\n visitNode(cb, node.extends)\n );\n case SyntaxKind.ScalarConstructor:\n return visitNode(cb, node.id) || visitEach(cb, node.parameters);\n case SyntaxKind.UnionStatement:\n return (\n visitEach(cb, node.decorators) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitEach(cb, node.options)\n );\n case SyntaxKind.UnionVariant:\n return visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.EnumStatement:\n return (\n visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitEach(cb, node.members)\n );\n case SyntaxKind.EnumMember:\n return visitEach(cb, node.decorators) || visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.EnumSpreadMember:\n return visitNode(cb, node.target);\n case SyntaxKind.AliasStatement:\n return (\n visitNode(cb, node.id) ||\n visitEach(cb, node.templateParameters) ||\n visitNode(cb, node.value)\n );\n case SyntaxKind.ConstStatement:\n return visitNode(cb, node.id) || visitNode(cb, node.value) || visitNode(cb, node.type);\n case SyntaxKind.DecoratorDeclarationStatement:\n return (\n visitEach(cb, node.modifiers) ||\n visitNode(cb, node.id) ||\n visitNode(cb, node.target) ||\n visitEach(cb, node.parameters)\n );\n case SyntaxKind.FunctionDeclarationStatement:\n return (\n visitEach(cb, node.modifiers) ||\n visitNode(cb, node.id) ||\n visitEach(cb, node.parameters) ||\n visitNode(cb, node.returnType)\n );\n case SyntaxKind.FunctionParameter:\n return visitNode(cb, node.id) || visitNode(cb, node.type);\n case SyntaxKind.TypeReference:\n return visitNode(cb, node.target) || visitEach(cb, node.arguments);\n case SyntaxKind.ValueOfExpression:\n return visitNode(cb, node.target);\n case SyntaxKind.TypeOfExpression:\n return visitNode(cb, node.target);\n case SyntaxKind.TupleExpression:\n return visitEach(cb, node.values);\n case SyntaxKind.UnionExpression:\n return visitEach(cb, node.options);\n\n case SyntaxKind.InvalidStatement:\n return visitEach(cb, node.decorators);\n case SyntaxKind.TemplateParameterDeclaration:\n return (\n visitNode(cb, node.id) || visitNode(cb, node.constraint) || visitNode(cb, node.default)\n );\n case SyntaxKind.TemplateArgument:\n return (node.name && visitNode(cb, node.name)) || visitNode(cb, node.argument);\n case SyntaxKind.Doc:\n return visitEach(cb, node.content) || visitEach(cb, node.tags);\n case SyntaxKind.DocParamTag:\n case SyntaxKind.DocTemplateTag:\n return (\n visitNode(cb, node.tagName) || visitNode(cb, node.paramName) || visitEach(cb, node.content)\n );\n case SyntaxKind.DocPropTag:\n return (\n visitNode(cb, node.tagName) || visitNode(cb, node.propName) || visitEach(cb, node.content)\n );\n case SyntaxKind.DocReturnsTag:\n case SyntaxKind.DocErrorsTag:\n case SyntaxKind.DocUnknownTag:\n return visitNode(cb, node.tagName) || visitEach(cb, node.content);\n\n case SyntaxKind.StringTemplateExpression:\n return visitNode(cb, node.head) || visitEach(cb, node.spans);\n case SyntaxKind.StringTemplateSpan:\n return visitNode(cb, node.expression) || visitNode(cb, node.literal);\n case SyntaxKind.ObjectLiteral:\n return visitEach(cb, node.properties);\n case SyntaxKind.ObjectLiteralProperty:\n return visitNode(cb, node.id) || visitNode(cb, node.value);\n case SyntaxKind.ObjectLiteralSpreadProperty:\n return visitNode(cb, node.target);\n case SyntaxKind.ArrayLiteral:\n return visitEach(cb, node.values);\n // no children for the rest of these.\n case SyntaxKind.StringTemplateHead:\n case SyntaxKind.StringTemplateMiddle:\n case SyntaxKind.StringTemplateTail:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.BooleanLiteral:\n case SyntaxKind.Identifier:\n case SyntaxKind.EmptyStatement:\n case SyntaxKind.VoidKeyword:\n case SyntaxKind.NeverKeyword:\n case SyntaxKind.ExternKeyword:\n case SyntaxKind.UnknownKeyword:\n case SyntaxKind.JsSourceFile:\n case SyntaxKind.JsNamespaceDeclaration:\n case SyntaxKind.DocText:\n return;\n\n default:\n // Dummy const to ensure we handle all node types.\n // If you get an error here, add a case for the new node type\n // you added..\n const _assertNever: never = node;\n return;\n }\n}\n\nfunction visitNode<T>(cb: NodeCallback<T>, node: Node | undefined): T | undefined {\n return node && cb(node);\n}\n\nfunction visitEach<T>(cb: NodeCallback<T>, nodes: readonly Node[] | undefined): T | undefined {\n if (!nodes) {\n return;\n }\n\n for (const node of nodes) {\n const result = cb(node);\n if (result) {\n return result;\n }\n }\n return;\n}\n\n/**\n * check whether a position belongs to a range (excluding the start and end pos)\n * i.e. <range.pos>{<start to return true>...<end to return true>}<range.end>\n *\n * remark: if range.pos is -1 means no start point found, so return false\n * if range.end is -1 means no end point found, so return true if position is greater than range.pos\n */\nexport function positionInRange(position: number, range: TextRange) {\n return range.pos >= 0 && position > range.pos && (range.end === -1 || position < range.end);\n}\n\nexport function getNodeAtPositionDetail(\n script: TypeSpecScriptNode,\n position: number,\n filter: (node: Node, flag: \"cur\" | \"pre\" | \"post\") => boolean = () => true,\n): PositionDetail {\n const cur = getNodeAtPosition(script, position, (n) => filter(n, \"cur\"));\n\n const input = script.file.text;\n const char = input.charCodeAt(position);\n const preChar = position >= 0 ? input.charCodeAt(position - 1) : NaN;\n const nextChar = position < input.length ? input.charCodeAt(position + 1) : NaN;\n\n let inTrivia = false;\n let triviaStart: number | undefined;\n let triviaEnd: number | undefined;\n if (!cur || cur.kind !== SyntaxKind.StringLiteral) {\n const { char: cp } = codePointBefore(input, position);\n if (!cp || !isIdentifierContinue(cp)) {\n triviaEnd = skipTrivia(input, position);\n triviaStart = skipTriviaBackward(script, position) + 1;\n inTrivia = triviaEnd !== position;\n }\n }\n\n if (!inTrivia) {\n const beforeId = skipContinuousIdentifier(input, position, true /*isBackward*/);\n triviaStart = skipTriviaBackward(script, beforeId) + 1;\n const afterId = skipContinuousIdentifier(input, position, false /*isBackward*/);\n triviaEnd = skipTrivia(input, afterId);\n }\n\n if (triviaStart === undefined || triviaEnd === undefined) {\n compilerAssert(false, \"unexpected, triviaStart and triviaEnd should be defined\");\n }\n\n return {\n node: cur,\n char,\n preChar,\n nextChar,\n position,\n inTrivia,\n triviaStartPosition: triviaStart,\n triviaEndPosition: triviaEnd,\n getPositionDetailBeforeTrivia: () => {\n // getNodeAtPosition will also include the 'node.end' position which is the triviaStart pos\n return getNodeAtPositionDetail(script, triviaStart, (n) => filter(n, \"pre\"));\n },\n getPositionDetailAfterTrivia: () => {\n return getNodeAtPositionDetail(script, triviaEnd, (n) => filter(n, \"post\"));\n },\n };\n}\n\n/**\n * Resolve the node in the syntax tree that that is at the given position.\n * @param script TypeSpec Script node\n * @param position Position\n * @param filter Filter if wanting to return a parent containing node early.\n */\nexport function getNodeAtPosition(\n script: TypeSpecScriptNode,\n position: number,\n filter?: (node: Node) => boolean,\n): Node | undefined;\nexport function getNodeAtPosition<T extends Node>(\n script: TypeSpecScriptNode,\n position: number,\n filter: (node: Node) => node is T,\n): T | undefined;\nexport function getNodeAtPosition(\n script: TypeSpecScriptNode,\n position: number,\n filter = (node: Node) => true,\n): Node | undefined {\n return visit(script);\n\n function visit(node: Node): Node | undefined {\n // We deliberately include the end position here because we need to hit\n // nodes when the cursor is positioned immediately after an identifier.\n // This is especially vital for completion. It's also generally OK\n // because the language doesn't (and should never) have syntax where you\n // could place the cursor ambiguously between two adjacent,\n // non-punctuation, non-trivia tokens that have no punctuation or trivia\n // separating them.\n if (node.pos <= position && position <= node.end) {\n // We only need to recursively visit children of nodes that satisfied\n // the condition above and therefore contain the given position. If a\n // node does not contain a position, then neither do its children.\n const child = visitChildren(node, visit);\n\n // A child match here is better than a self-match below as we want the\n // deepest (most specific) node. In other words, the search is depth\n // first. For example, consider `A<B<C>>`: If the cursor is on `B`,\n // then prefer B<C> over A<B<C>>.\n if (child) {\n return child;\n }\n\n if (filter(node)) {\n return node;\n }\n }\n\n return undefined;\n }\n}\n\nexport function hasParseError(node: Node) {\n if (node.flags & NodeFlags.ThisNodeHasError) {\n return true;\n }\n\n checkForDescendantErrors(node);\n return node.flags & NodeFlags.DescendantHasError;\n}\n\nfunction checkForDescendantErrors(node: Node) {\n if (node.flags & NodeFlags.DescendantErrorsExamined) {\n return;\n }\n mutate(node).flags |= NodeFlags.DescendantErrorsExamined;\n\n visitChildren(node, (child: Node) => {\n if (child.flags & NodeFlags.ThisNodeHasError) {\n mutate(node).flags |= NodeFlags.DescendantHasError | NodeFlags.DescendantErrorsExamined;\n return true;\n }\n checkForDescendantErrors(child);\n\n if (child.flags & NodeFlags.DescendantHasError) {\n mutate(node).flags |= NodeFlags.DescendantHasError | NodeFlags.DescendantErrorsExamined;\n return true;\n }\n mutate(child).flags |= NodeFlags.DescendantErrorsExamined;\n\n return false;\n });\n}\n\nexport function isImportStatement(node: Node): node is ImportStatementNode {\n return node.kind === SyntaxKind.ImportStatement;\n}\n\nfunction isBlocklessNamespace(node: Node) {\n if (node.kind !== SyntaxKind.NamespaceStatement) {\n return false;\n }\n while (!isArray(node.statements) && node.statements) {\n node = node.statements;\n }\n\n return node.statements === undefined;\n}\n\nexport function getFirstAncestor(\n node: Node,\n test: NodeCallback<boolean>,\n includeSelf: boolean = false,\n): Node | undefined {\n if (includeSelf && test(node)) {\n return node;\n }\n for (let n = node.parent; n; n = n.parent) {\n if (test(n)) {\n return n;\n }\n }\n return undefined;\n}\n\nexport function getIdentifierContext(id: IdentifierNode): IdentifierContext {\n const node = getFirstAncestor(id, (n) => n.kind !== SyntaxKind.MemberExpression);\n compilerAssert(node, \"Identifier with no non-member-expression ancestor.\");\n\n let kind: IdentifierKind;\n switch (node.kind) {\n case SyntaxKind.TypeReference:\n kind = IdentifierKind.TypeReference;\n break;\n case SyntaxKind.AugmentDecoratorStatement:\n case SyntaxKind.DecoratorExpression:\n kind = IdentifierKind.Decorator;\n break;\n case SyntaxKind.UsingStatement:\n kind = IdentifierKind.Using;\n break;\n case SyntaxKind.TemplateArgument:\n kind = IdentifierKind.TemplateArgument;\n break;\n case SyntaxKind.ObjectLiteralProperty:\n kind = IdentifierKind.ObjectLiteralProperty;\n break;\n case SyntaxKind.ModelProperty:\n switch (node.parent?.kind) {\n case SyntaxKind.ModelExpression:\n kind = IdentifierKind.ModelExpressionProperty;\n break;\n case SyntaxKind.ModelStatement:\n kind = IdentifierKind.ModelStatementProperty;\n break;\n default:\n compilerAssert(\"false\", \"ModelProperty with unexpected parent kind.\");\n kind =\n (id.parent as DeclarationNode).id === id\n ? IdentifierKind.Declaration\n : IdentifierKind.Other;\n break;\n }\n break;\n default:\n kind =\n (id.parent as DeclarationNode).id === id\n ? IdentifierKind.Declaration\n : IdentifierKind.Other;\n break;\n }\n\n return { node, kind };\n}\n", "import type { ParserOptions } from \"prettier\";\nimport { getSourceLocation } from \"../core/diagnostics.js\";\nimport { parse as typespecParse, visitChildren } from \"../core/parser.js\";\nimport { Diagnostic, Node, SyntaxKind, TypeSpecScriptNode } from \"../core/types.js\";\nimport { mutate } from \"../utils/misc.js\";\n\nexport function parse(text: string, options: ParserOptions<any>): TypeSpecScriptNode {\n const result = typespecParse(text, { comments: true, docs: true });\n\n flattenNamespaces(result);\n\n const errors = result.parseDiagnostics.filter((x) => x.severity === \"error\");\n if (errors.length > 0 && !result.printable) {\n throw new PrettierParserError(errors[0]);\n }\n // Remove doc comments as those are handled directly.\n mutate(result).comments = result.comments.filter(\n (x) => !(x.kind === SyntaxKind.BlockComment && x.parsedAsDocs),\n );\n return result;\n}\n\n/**\n * We are patching the syntax tree to flatten the namespace nodes that are created from namespace Foo.Bar; which have the same pos, end\n * This causes prettier to not know where comments belong.\n * https://github.com/microsoft/typespec/pull/2061\n */\nexport function flattenNamespaces(base: Node) {\n visitChildren(base, (node) => {\n if (node.kind === SyntaxKind.NamespaceStatement) {\n let current = node;\n const ids = [node.id];\n while (current.statements && \"kind\" in current.statements) {\n current = current.statements;\n ids.push(current.id);\n }\n Object.assign(node, current, {\n ids,\n });\n flattenNamespaces(current);\n }\n });\n}\n\nexport class PrettierParserError extends Error {\n public loc: { start: number; end: number };\n public constructor(public readonly error: Diagnostic) {\n super(error.message);\n const location = getSourceLocation(error.target);\n this.loc = {\n start: location?.pos ?? 0,\n end: location?.end ?? 0,\n };\n }\n}\n", "import type { AstPath, Doc, Printer } from \"prettier\";\nimport { builders } from \"prettier/doc\";\nimport { compilerAssert } from \"../../core/diagnostics.js\";\nimport {\n printIdentifier as printIdentifierString,\n splitLines,\n} from \"../../core/helpers/syntax-utils.js\";\nimport {\n AliasStatementNode,\n ArrayExpressionNode,\n ArrayLiteralNode,\n AugmentDecoratorStatementNode,\n BlockComment,\n BooleanLiteralNode,\n CallExpressionNode,\n Comment,\n ConstStatementNode,\n DecoratorDeclarationStatementNode,\n DecoratorExpressionNode,\n DirectiveExpressionNode,\n DocNode,\n EnumMemberNode,\n EnumSpreadMemberNode,\n EnumStatementNode,\n FunctionDeclarationStatementNode,\n FunctionParameterNode,\n IdentifierNode,\n InterfaceStatementNode,\n IntersectionExpressionNode,\n LineComment,\n MemberExpressionNode,\n ModelExpressionNode,\n ModelPropertyNode,\n ModelSpreadPropertyNode,\n ModelStatementNode,\n Node,\n NodeFlags,\n NumericLiteralNode,\n ObjectLiteralNode,\n ObjectLiteralPropertyNode,\n ObjectLiteralSpreadPropertyNode,\n OperationSignatureDeclarationNode,\n OperationSignatureReferenceNode,\n OperationStatementNode,\n ScalarConstructorNode,\n ScalarStatementNode,\n Statement,\n StringLiteralNode,\n StringTemplateExpressionNode,\n StringTemplateSpanNode,\n SyntaxKind,\n TemplateArgumentNode,\n TemplateParameterDeclarationNode,\n TextRange,\n TupleExpressionNode,\n TypeOfExpressionNode,\n TypeReferenceNode,\n TypeSpecScriptNode,\n UnionExpressionNode,\n UnionStatementNode,\n UnionVariantNode,\n UsingStatementNode,\n ValueOfExpressionNode,\n} from \"../../core/types.js\";\nimport { FlattenedNamespaceStatementNode } from \"../types.js\";\nimport { commentHandler } from \"./comment-handler.js\";\nimport { needsParens } from \"./needs-parens.js\";\nimport { DecorableNode, PrettierChildPrint, TypeSpecPrettierOptions } from \"./types.js\";\nimport { util } from \"./util.js\";\n\nconst {\n align,\n breakParent,\n group,\n hardline,\n ifBreak,\n indent,\n join,\n line,\n softline,\n literalline,\n markAsRoot,\n} = builders;\n\nconst { isNextLineEmpty } = util as any;\n\n/**\n * If the decorators for that node should try to be kept inline.\n */\nconst DecoratorsTryInline = {\n modelProperty: true,\n enumMember: true,\n unionVariant: true,\n};\n\nexport const typespecPrinter: Printer<Node> = {\n print: printTypeSpec,\n isBlockComment: (node: any) => isBlockComment(node),\n canAttachComment: canAttachComment,\n printComment: printComment,\n handleComments: commentHandler,\n};\n\nexport function printTypeSpec(\n // Path to the AST node to print\n path: AstPath<Node>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const docs = printDocComments(path, options, print);\n const directives = shouldPrintDirective(node) ? printDirectives(path, options, print) : \"\";\n const printedNode = printNode(path, options, print);\n const value = needsParens(path, options) ? [\"(\", printedNode, \")\"] : printedNode;\n const parts: Doc[] = [docs, directives, value];\n if (node.kind === SyntaxKind.TypeSpecScript) {\n // For TypeSpecScript(root of TypeSpec document) we had a new line at the end.\n // This must be done here so the hardline entry can be the last item of the doc array returned by the printer\n // so the markdown(and other embedded formatter) can omit that extra line.\n parts.push(hardline);\n }\n return parts;\n}\n\nfunction shouldPrintDirective(node: Node) {\n // Model property handle printing directive itself.\n return node.kind !== SyntaxKind.ModelProperty;\n}\n\nexport function printNode(\n // Path to the AST node to print\n path: AstPath<Node>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node: Node = path.node;\n\n switch (node.kind) {\n // Root\n case SyntaxKind.TypeSpecScript:\n return printTypeSpecScript(path as AstPath<TypeSpecScriptNode>, options, print);\n // Statements\n case SyntaxKind.ImportStatement:\n return [`import \"${node.path.value}\";`];\n case SyntaxKind.UsingStatement:\n return [`using `, (path as AstPath<UsingStatementNode>).call(print, \"name\"), `;`];\n case SyntaxKind.OperationStatement:\n return printOperationStatement(path as AstPath<OperationStatementNode>, options, print);\n case SyntaxKind.OperationSignatureDeclaration:\n return printOperationSignatureDeclaration(\n path as AstPath<OperationSignatureDeclarationNode>,\n options,\n print,\n );\n case SyntaxKind.OperationSignatureReference:\n return printOperationSignatureReference(\n path as AstPath<OperationSignatureReferenceNode>,\n options,\n print,\n );\n case SyntaxKind.NamespaceStatement:\n return printNamespaceStatement(\n path as AstPath<FlattenedNamespaceStatementNode>,\n options,\n print,\n );\n case SyntaxKind.ModelStatement:\n return printModelStatement(path as AstPath<ModelStatementNode>, options, print);\n case SyntaxKind.ScalarStatement:\n return printScalarStatement(path as AstPath<ScalarStatementNode>, options, print);\n case SyntaxKind.ScalarConstructor:\n return printScalarConstructor(path as AstPath<ScalarConstructorNode>, options, print);\n case SyntaxKind.AliasStatement:\n return printAliasStatement(path as AstPath<AliasStatementNode>, options, print);\n case SyntaxKind.EnumStatement:\n return printEnumStatement(path as AstPath<EnumStatementNode>, options, print);\n case SyntaxKind.UnionStatement:\n return printUnionStatement(path as AstPath<UnionStatementNode>, options, print);\n case SyntaxKind.InterfaceStatement:\n return printInterfaceStatement(path as AstPath<InterfaceStatementNode>, options, print);\n // Others.\n case SyntaxKind.Identifier:\n return printIdentifier(node);\n case SyntaxKind.StringLiteral:\n return printStringLiteral(path as AstPath<StringLiteralNode>, options);\n case SyntaxKind.NumericLiteral:\n return printNumberLiteral(path as AstPath<NumericLiteralNode>, options);\n case SyntaxKind.BooleanLiteral:\n return printBooleanLiteral(path as AstPath<BooleanLiteralNode>, options);\n case SyntaxKind.ModelExpression:\n return printModelExpression(path as AstPath<ModelExpressionNode>, options, print);\n case SyntaxKind.ModelProperty:\n return printModelProperty(path as AstPath<ModelPropertyNode>, options, print);\n case SyntaxKind.DecoratorExpression:\n return printDecorator(path as AstPath<DecoratorExpressionNode>, options, print);\n case SyntaxKind.AugmentDecoratorStatement:\n return printAugmentDecorator(path as AstPath<AugmentDecoratorStatementNode>, options, print);\n case SyntaxKind.DirectiveExpression:\n return printDirective(path as AstPath<DirectiveExpressionNode>, options, print);\n case SyntaxKind.UnionExpression:\n return printUnion(path as AstPath<UnionExpressionNode>, options, print);\n case SyntaxKind.IntersectionExpression:\n return printIntersection(path as AstPath<IntersectionExpressionNode>, options, print);\n case SyntaxKind.ArrayExpression:\n return printArray(path as AstPath<ArrayExpressionNode>, options, print);\n case SyntaxKind.TupleExpression:\n return printTuple(path as AstPath<TupleExpressionNode>, options, print);\n case SyntaxKind.MemberExpression:\n return printMemberExpression(path as AstPath<MemberExpressionNode>, options, print);\n case SyntaxKind.EnumMember:\n return printEnumMember(path as AstPath<EnumMemberNode>, options, print);\n case SyntaxKind.EnumSpreadMember:\n return printEnumSpreadMember(path as AstPath<EnumSpreadMemberNode>, options, print);\n case SyntaxKind.UnionVariant:\n return printUnionVariant(path as AstPath<UnionVariantNode>, options, print);\n case SyntaxKind.TypeReference:\n return printTypeReference(path as AstPath<TypeReferenceNode>, options, print);\n case SyntaxKind.TemplateArgument:\n return printTemplateArgument(path as AstPath<TemplateArgumentNode>, options, print);\n case SyntaxKind.ValueOfExpression:\n return printValueOfExpression(path as AstPath<ValueOfExpressionNode>, options, print);\n case SyntaxKind.TypeOfExpression:\n return printTypeOfExpression(path as AstPath<TypeOfExpressionNode>, options, print);\n case SyntaxKind.TemplateParameterDeclaration:\n return printTemplateParameterDeclaration(\n path as AstPath<TemplateParameterDeclarationNode>,\n options,\n print,\n );\n case SyntaxKind.ModelSpreadProperty:\n return printModelSpread(path as AstPath<ModelSpreadPropertyNode>, options, print);\n case SyntaxKind.DecoratorDeclarationStatement:\n return printDecoratorDeclarationStatement(\n path as AstPath<DecoratorDeclarationStatementNode>,\n options,\n print,\n );\n case SyntaxKind.FunctionDeclarationStatement:\n return printFunctionDeclarationStatement(\n path as AstPath<FunctionDeclarationStatementNode>,\n options,\n print,\n );\n case SyntaxKind.FunctionParameter:\n return printFunctionParameterDeclaration(\n path as AstPath<FunctionParameterNode>,\n options,\n print,\n );\n case SyntaxKind.ExternKeyword:\n return \"extern\";\n case SyntaxKind.VoidKeyword:\n return \"void\";\n case SyntaxKind.NeverKeyword:\n return \"never\";\n case SyntaxKind.UnknownKeyword:\n return \"unknown\";\n case SyntaxKind.Doc:\n return printDoc(path as AstPath<DocNode>, options, print);\n case SyntaxKind.DocText:\n case SyntaxKind.DocParamTag:\n case SyntaxKind.DocPropTag:\n case SyntaxKind.DocTemplateTag:\n case SyntaxKind.DocReturnsTag:\n case SyntaxKind.DocErrorsTag:\n case SyntaxKind.DocUnknownTag:\n // https://github.com/microsoft/typespec/issues/1319 Tracks pretty-printing doc comments.\n compilerAssert(\n false,\n \"Currently, doc comments are only handled as regular comments and we do not opt in to parsing them so we shouldn't reach here.\",\n );\n return \"\";\n case SyntaxKind.EmptyStatement:\n return \"\";\n case SyntaxKind.StringTemplateExpression:\n return printStringTemplateExpression(\n path as AstPath<StringTemplateExpressionNode>,\n options,\n print,\n );\n case SyntaxKind.ObjectLiteral:\n return printObjectLiteral(path as AstPath<ObjectLiteralNode>, options, print);\n case SyntaxKind.ObjectLiteralProperty:\n return printObjectLiteralProperty(path as AstPath<ObjectLiteralPropertyNode>, options, print);\n case SyntaxKind.ObjectLiteralSpreadProperty:\n return printObjectLiteralSpreadProperty(\n path as AstPath<ObjectLiteralSpreadPropertyNode>,\n options,\n print,\n );\n case SyntaxKind.ArrayLiteral:\n return printArrayLiteral(path as AstPath<ArrayLiteralNode>, options, print);\n case SyntaxKind.ConstStatement:\n return printConstStatement(path as AstPath<ConstStatementNode>, options, print);\n case SyntaxKind.CallExpression:\n return printCallExpression(path as AstPath<CallExpressionNode>, options, print);\n case SyntaxKind.StringTemplateSpan:\n case SyntaxKind.StringTemplateHead:\n case SyntaxKind.StringTemplateMiddle:\n case SyntaxKind.StringTemplateTail:\n case SyntaxKind.JsSourceFile:\n case SyntaxKind.JsNamespaceDeclaration:\n case SyntaxKind.InvalidStatement:\n return getRawText(node, options);\n default:\n // Dummy const to ensure we handle all node types.\n // If you get an error here, add a case for the new node type\n // you added..\n const _assertNever: never = node;\n return getRawText(node, options);\n }\n}\n\nexport function printTypeSpecScript(\n path: AstPath<TypeSpecScriptNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const body = [];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n body.push(printStatementSequence(path, options, print, \"statements\"));\n return body;\n}\n\nexport function printAliasStatement(\n path: AstPath<AliasStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const template = printTemplateParameters(path, options, print, \"templateParameters\");\n return [\"alias \", id, template, \" = \", path.call(print, \"value\"), \";\"];\n}\n\nexport function printConstStatement(\n path: AstPath<ConstStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const type = node.type ? [\": \", path.call(print, \"type\")] : \"\";\n return [\"const \", id, type, \" = \", path.call(print, \"value\"), \";\"];\n}\n\nexport function printCallExpression(\n path: AstPath<CallExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printCallLikeArgs(path, options, print);\n return [path.call(print, \"target\"), args];\n}\n\nfunction printTemplateParameters<T extends Node>(\n path: AstPath<T>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n propertyName: keyof T,\n) {\n const node = path.node;\n const args = node[propertyName] as any as TemplateParameterDeclarationNode[];\n if ((args as any).length === 0) {\n return \"\";\n }\n\n const shouldHug = (args as any).length === 1;\n if (shouldHug) {\n return [\"<\", join(\", \", path.map(print, propertyName as any)), \">\"];\n } else {\n const body = indent([softline, join([\", \", softline], path.map(print, propertyName as any))]);\n return group([\"<\", body, softline, \">\"]);\n }\n}\n\nexport function canAttachComment(node: Node): boolean {\n const kind = node.kind as SyntaxKind;\n return Boolean(\n kind &&\n kind !== SyntaxKind.LineComment &&\n kind !== SyntaxKind.BlockComment &&\n kind !== SyntaxKind.EmptyStatement &&\n kind !== SyntaxKind.DocParamTag &&\n kind !== SyntaxKind.DocReturnsTag &&\n kind !== SyntaxKind.DocTemplateTag &&\n kind !== SyntaxKind.DocText &&\n kind !== SyntaxKind.DocUnknownTag &&\n !(node.flags & NodeFlags.Synthetic),\n );\n}\n\nexport function printComment(\n commentPath: AstPath<Node | Comment>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const comment = commentPath.node;\n (comment as any).printed = true;\n\n switch (comment.kind) {\n case SyntaxKind.BlockComment:\n return printBlockComment(commentPath as AstPath<BlockComment>, options);\n case SyntaxKind.LineComment:\n return `${getRawText(comment, options).trimEnd()}`;\n default:\n throw new Error(`Not a comment: ${JSON.stringify(comment)}`);\n }\n}\n\nfunction printBlockComment(commentPath: AstPath<BlockComment>, options: TypeSpecPrettierOptions) {\n const comment = commentPath.node;\n const rawComment = options.originalText.slice(comment.pos + 2, comment.end - 2);\n\n const printed = isIndentableBlockComment(rawComment)\n ? printIndentableBlockCommentContent(rawComment)\n : rawComment;\n return [\"/*\", printed, \"*/\"];\n}\n\nfunction isIndentableBlockComment(rawComment: string): boolean {\n // If the comment has multiple lines and every line starts with a star\n // we can fix the indentation of each line. The stars in the `/*` and\n // `*/` delimiters are not included in the comment value, so add them\n // back first.\n const lines = `*${rawComment}*`.split(\"\\n\");\n return lines.length > 1 && lines.every((line) => line.trim()[0] === \"*\");\n}\n\nfunction printIndentableBlockCommentContent(rawComment: string): Doc {\n const lines = rawComment.split(\"\\n\");\n\n return [\n join(\n hardline,\n lines.map((line, index) =>\n index === 0\n ? line.trimEnd()\n : \" \" + (index < lines.length - 1 ? line.trim() : line.trimStart()),\n ),\n ),\n ];\n}\n\n/** Print a doc comment. */\nfunction printDoc(\n path: AstPath<DocNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const rawComment = getRawText(node, options).slice(3, -2);\n\n const printed = isIndentableBlockComment(rawComment)\n ? printIndentableBlockCommentContent(rawComment)\n : rawComment.includes(\"\\n\")\n ? rawComment\n : ` ${rawComment.trim()} `;\n return [\"/**\", printed, \"*/\"];\n}\n\nexport function printDecorators(\n path: AstPath<DecorableNode>,\n options: object,\n print: PrettierChildPrint,\n { tryInline }: { tryInline: boolean },\n): { decorators: Doc; multiline: boolean } {\n const node = path.node;\n if (node.decorators.length === 0) {\n return { decorators: \"\", multiline: false };\n }\n\n const shouldBreak = shouldDecoratorBreakLine(path, options, { tryInline });\n const decorators = path.map((x) => [print(x as any), ifBreak(line, \" \")], \"decorators\");\n\n return {\n decorators: group([shouldBreak ? breakParent : \"\", decorators]),\n multiline: shouldBreak,\n };\n}\n\n/** Check if the decorators of the given node should be broken in sparate line */\nfunction shouldDecoratorBreakLine(\n path: AstPath<DecorableNode>,\n options: object,\n { tryInline }: { tryInline: boolean },\n) {\n const node = path.node;\n\n return (\n !tryInline || node.decorators.length >= 3 || hasNewlineBetweenOrAfterDecorators(node, options)\n );\n}\n\n/**\n * Check if there is already new lines in between the decorators of the node.\n */\nfunction hasNewlineBetweenOrAfterDecorators(node: DecorableNode, options: any) {\n return node.decorators.some((decorator) => util.hasNewline(options.originalText, decorator.end));\n}\n\nexport function printDecorator(\n path: AstPath<DecoratorExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printDecoratorArgs(path, options, print);\n const node = path.node;\n const name =\n node.target.kind === SyntaxKind.Identifier\n ? printIdentifier(node.target, \"allow-reserved\")\n : path.call(print, \"target\");\n return [\"@\", name, args];\n}\n\nexport function printAugmentDecorator(\n path: AstPath<AugmentDecoratorStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const target =\n node.target.kind === SyntaxKind.Identifier\n ? printIdentifier(node.target, \"allow-reserved\")\n : path.call(print, \"target\");\n const args = printAugmentDecoratorArgs(path, options, print);\n return [\"@@\", target, args, \";\"];\n}\n\nfunction printAugmentDecoratorArgs(\n path: AstPath<AugmentDecoratorStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\n \"(\",\n group([\n indent(\n join(\", \", [\n path.call(print, \"targetType\"),\n ...path.map((arg) => [softline, print(arg)], \"arguments\"),\n ]),\n ),\n softline,\n ]),\n \")\",\n ];\n}\n\nexport function printDocComments(path: AstPath<Node>, options: object, print: PrettierChildPrint) {\n const node = path.node;\n if (node.docs === undefined || node.docs.length === 0) {\n return \"\";\n }\n\n const docs = path.map((x) => [print(x as any), line], \"docs\");\n return group([...docs, breakParent]);\n}\n\nexport function printDirectives(path: AstPath<Node>, options: object, print: PrettierChildPrint) {\n const node = path.node;\n if (node.directives === undefined || node.directives.length === 0) {\n return \"\";\n }\n\n const directives = path.map((x) => [print(x as any), line], \"directives\");\n\n return group([...directives, breakParent]);\n}\n\nexport function printDirective(\n path: AstPath<DirectiveExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const args = printDirectiveArgs(path, options, print);\n return [\"#\", path.call(print, \"target\"), \" \", args];\n}\n\nfunction printDecoratorArgs(\n path: AstPath<DecoratorExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.arguments.length === 0) {\n return \"\";\n }\n\n return printCallLikeArgs(path, options, print);\n}\n\nfunction printCallLikeArgs(\n path: AstPath<DecoratorExpressionNode | CallExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n\n // So that decorator with single object arguments have ( and { hugging.\n // @deco(#{\n // value: \"foo\"\n // })\n const shouldHug =\n node.arguments.length === 1 &&\n (node.arguments[0].kind === SyntaxKind.ModelExpression ||\n node.arguments[0].kind === SyntaxKind.ObjectLiteral ||\n node.arguments[0].kind === SyntaxKind.ArrayLiteral ||\n node.arguments[0].kind === SyntaxKind.StringLiteral ||\n node.arguments[0].kind === SyntaxKind.StringTemplateExpression);\n\n if (shouldHug) {\n return [\n \"(\",\n join(\n \", \",\n path.map((arg) => [print(arg)], \"arguments\"),\n ),\n \")\",\n ];\n }\n\n return [\n \"(\",\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"arguments\"),\n ),\n ),\n softline,\n ]),\n \")\",\n ];\n}\n\nexport function printDirectiveArgs(\n path: AstPath<DirectiveExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n\n if (node.arguments.length === 0) {\n return \"\";\n }\n\n return join(\n \" \",\n path.map((arg) => [print(arg)], \"arguments\"),\n );\n}\n\nexport function printEnumStatement(\n path: AstPath<EnumStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const id = path.call(print, \"id\");\n return [decorators, \"enum \", id, \" \", printEnumBlock(path, options, print)];\n}\n\nfunction printEnumBlock(\n path: AstPath<EnumStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.members.length === 0) {\n return \"{}\";\n }\n\n const body = joinMembersInBlock(path, \"members\", options, print, \",\", hardline);\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nexport function printEnumMember(\n path: AstPath<EnumMemberNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n const value = node.value ? [\": \", path.call(print, \"value\")] : \"\";\n const { decorators } = printDecorators(path, options, print, {\n tryInline: DecoratorsTryInline.enumMember,\n });\n return [decorators, id, value];\n}\n\nfunction printEnumSpreadMember(\n path: AstPath<EnumSpreadMemberNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n return [\"...\", path.call(print, \"target\")];\n}\n\nexport function printUnionStatement(\n path: AstPath<UnionStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n return [decorators, \"union \", id, generic, \" \", printUnionVariantsBlock(path, options, print)];\n}\n\nexport function printUnionVariantsBlock(\n path: AstPath<UnionStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n if (node.options.length === 0) {\n return \"{}\";\n }\n\n const body = joinMembersInBlock(path, \"options\", options, print, \",\", hardline);\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nexport function printUnionVariant(\n path: AstPath<UnionVariantNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id =\n path.node.id === undefined ? \"\" : [printIdentifier(path.node.id, \"allow-reserved\"), \": \"];\n const { decorators } = printDecorators(path, options, print, {\n tryInline: DecoratorsTryInline.unionVariant,\n });\n return [decorators, id, path.call(print, \"value\")];\n}\n\nexport function printInterfaceStatement(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n const extendList = printInterfaceExtends(path, options, print);\n\n return [\n decorators,\n \"interface \",\n id,\n generic,\n extendList,\n \" \",\n printInterfaceMembers(path, options, print),\n ];\n}\n\nfunction printInterfaceExtends(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n if (node.extends.length === 0) {\n return \"\";\n }\n\n const keyword = \"extends \";\n return [group(indent([line, keyword, indent(join([\",\", line], path.map(print, \"extends\")))]))];\n}\n\nexport function printInterfaceMembers(\n path: AstPath<InterfaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasOperations = node.operations.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasOperations && !nodeHasComments) {\n return \"{}\";\n }\n\n const lastOperation = node.operations[node.operations.length - 1];\n\n const parts: Doc[] = [];\n path.each((operationPath) => {\n const node = operationPath.node as any as OperationStatementNode;\n\n const printed = print(operationPath);\n parts.push(printed);\n\n if (node !== lastOperation) {\n parts.push(hardline);\n\n if (isNextLineEmpty(options.originalText, node, options.locEnd)) {\n parts.push(hardline);\n }\n }\n }, \"operations\");\n\n const body: Doc[] = [hardline, parts];\n\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nfunction printDanglingComments(\n path: AstPath<any>,\n options: TypeSpecPrettierOptions,\n { sameIndent }: { sameIndent: boolean },\n) {\n const node = path.node;\n const parts: Doc[] = [];\n if (!node || !node.comments) {\n return \"\";\n }\n path.each((commentPath) => {\n const comment: any = commentPath.node;\n if (!comment.leading && !comment.trailing) {\n parts.push(printComment(path, options));\n }\n }, \"comments\");\n\n if (parts.length === 0) {\n return \"\";\n }\n\n if (sameIndent) {\n return join(hardline, parts);\n }\n return indent([hardline, join(hardline, parts)]);\n}\n\n/**\n * Handle printing an intersection node.\n * @example `Foo & Bar` or `{foo: string} & {bar: string}`\n *\n * @param path Prettier AST Path.\n * @param options Prettier options\n * @param print Prettier child print callback.\n * @returns Prettier document.\n */\nexport function printIntersection(\n path: AstPath<IntersectionExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const types = path.map(print, \"options\");\n const result: (Doc | string)[] = [];\n let wasIndented = false;\n for (let i = 0; i < types.length; ++i) {\n if (i === 0) {\n result.push(types[i]);\n } else if (isModelNode(node.options[i - 1]) && isModelNode(node.options[i])) {\n // If both are objects, don't indent\n result.push([\" & \", wasIndented ? indent(types[i]) : types[i]]);\n } else if (!isModelNode(node.options[i - 1]) && !isModelNode(node.options[i])) {\n // If no object is involved, go to the next line if it breaks\n result.push(indent([\" &\", line, types[i]]));\n } else {\n // If you go from object to non-object or vis-versa, then inline it\n if (i > 1) {\n wasIndented = true;\n }\n result.push(\" & \", i > 1 ? indent(types[i]) : types[i]);\n }\n }\n return group(result);\n}\n\nfunction isModelNode(node: Node) {\n return node.kind === SyntaxKind.ModelExpression;\n}\n\nexport function printArray(\n path: AstPath<ArrayExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n return [path.call(print, \"elementType\"), \"[]\"];\n}\n\nexport function printTuple(\n path: AstPath<TupleExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n return group([\n \"[\",\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"values\"),\n ),\n ),\n softline,\n \"]\",\n ]);\n}\n\nexport function printMemberExpression(\n path: AstPath<MemberExpressionNode>,\n options: object,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [node.base ? [path.call(print, \"base\"), node.selector] : \"\", id];\n}\n\nexport function printModelExpression(\n path: AstPath<ModelExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const inBlock = isModelExpressionInBlock(path);\n const node = path.node;\n if (inBlock) {\n return group(printModelPropertiesBlock(path, options, print));\n } else {\n const properties =\n node.properties.length === 0\n ? \"\"\n : indent(\n joinMembersInBlock(path, \"properties\", options, print, ifBreak(\",\", \", \"), softline),\n );\n return group([properties, softline]);\n }\n}\n\nexport function printObjectLiteral(\n path: AstPath<ObjectLiteralNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.properties && node.properties.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"#{}\";\n }\n const lineDoc = softline;\n const body: Doc[] = [\n joinMembersInBlock(path, \"properties\", options, print, ifBreak(\",\", \", \"), softline),\n ];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"#{\", ifBreak(\"\", \" \"), indent(body), lineDoc, ifBreak(\"\", \" \"), \"}\"]);\n}\n\nexport function printObjectLiteralProperty(\n path: AstPath<ObjectLiteralPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [printDirectives(path, options, print), id, \": \", path.call(print, \"value\")];\n}\n\nexport function printObjectLiteralSpreadProperty(\n path: AstPath<ObjectLiteralSpreadPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [printDirectives(path, options, print), \"...\", path.call(print, \"target\")];\n}\n\nexport function printArrayLiteral(\n path: AstPath<ArrayLiteralNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return group([\n \"#[\",\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"values\"),\n ),\n ),\n softline,\n \"]\",\n ]);\n}\n\nexport function printModelStatement(\n path: AstPath<ModelStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const heritage = node.extends\n ? [ifBreak(line, \" \"), \"extends \", path.call(print, \"extends\")]\n : \"\";\n const isBase = node.is ? [ifBreak(line, \" \"), \"is \", path.call(print, \"is\")] : \"\";\n const generic = printTemplateParameters(path, options, print, \"templateParameters\");\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const shouldPrintBody = nodeHasComments || !(node.properties.length === 0 && node.is);\n const body = shouldPrintBody ? [\" \", printModelPropertiesBlock(path, options, print)] : \";\";\n return [\n printDecorators(path, options, print, { tryInline: false }).decorators,\n \"model \",\n id,\n generic,\n group(indent([\"\", heritage, isBase])),\n body,\n ];\n}\n\nfunction printModelPropertiesBlock(\n path: AstPath<\n Node & {\n properties?: readonly (ModelPropertyNode | ModelSpreadPropertyNode)[];\n }\n >,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.properties && node.properties.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"{}\";\n }\n const tryInline = path.getParentNode()?.kind === SyntaxKind.TemplateParameterDeclaration;\n const lineDoc = tryInline ? softline : hardline;\n const seperator = isModelAValue(path) ? \",\" : \";\";\n\n const body = [joinMembersInBlock(path, \"properties\", options, print, seperator, lineDoc)];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), lineDoc, \"}\"]);\n}\n\n/**\n * Join members nodes that are in a block by adding extra new lines when needed.(e.g. when there are decorators or doc comments )\n * @param path Prettier AST Path.\n * @param options Prettier options\n * @param print Prettier print callback\n * @param separator Separator\n * @param regularLine What line to use when we should split lines\n * @returns\n */\nfunction joinMembersInBlock<T extends Node>(\n path: AstPath<T>,\n member: keyof T,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n separator: Doc,\n regularLine: Doc = hardline,\n): Doc {\n const doc: Doc[] = [regularLine];\n const propertyContainerNode = path.node;\n\n let newLineBeforeNextProp = false;\n path.each((item, propertyIndex) => {\n const isFirst = propertyIndex === 0;\n const isLast = propertyIndex === (propertyContainerNode[member] as any).length - 1;\n const shouldWrapInNewLines = shouldWrapMemberInNewLines(item as any, options);\n\n if ((newLineBeforeNextProp || shouldWrapInNewLines) && !isFirst) {\n doc.push(hardline);\n newLineBeforeNextProp = false;\n }\n doc.push(print(item));\n if (isLast) {\n doc.push(ifBreak(separator));\n } else {\n doc.push(separator);\n doc.push(regularLine);\n if (shouldWrapInNewLines) {\n newLineBeforeNextProp = true;\n }\n }\n }, member as any);\n return doc;\n}\n\n/**\n * Check if property item (PropertyNode, SpreadProperty) should be wrapped in new lines.\n * It can be wrapped for the following reasons:\n * - has decorators on lines above\n * - has leading comments\n */\nfunction shouldWrapMemberInNewLines(\n path: AstPath<\n | ModelPropertyNode\n | ModelSpreadPropertyNode\n | EnumMemberNode\n | EnumSpreadMemberNode\n | ScalarConstructorNode\n | UnionVariantNode\n | ObjectLiteralPropertyNode\n | ObjectLiteralSpreadPropertyNode\n >,\n options: any,\n): boolean {\n const node = path.node;\n return (\n (node.kind !== SyntaxKind.ModelSpreadProperty &&\n node.kind !== SyntaxKind.EnumSpreadMember &&\n node.kind !== SyntaxKind.ScalarConstructor &&\n node.kind !== SyntaxKind.ObjectLiteralProperty &&\n node.kind !== SyntaxKind.ObjectLiteralSpreadProperty &&\n shouldDecoratorBreakLine(path as any, options, {\n tryInline: DecoratorsTryInline.modelProperty,\n })) ||\n hasComments(node, CommentCheckFlags.Leading) ||\n (node.docs && node.docs?.length > 0)\n );\n}\n\n/**\n * Figure out if this model is being used as a definition or value.\n * @returns true if the model is used as a value(e.g. decorator value), false if it is used as a model definition.\n */\nfunction isModelAValue(path: AstPath<Node>): boolean {\n let count = 0;\n let node: Node | null = path.node;\n do {\n switch (node.kind) {\n case SyntaxKind.ModelStatement:\n case SyntaxKind.AliasStatement:\n case SyntaxKind.OperationStatement:\n return false;\n case SyntaxKind.DecoratorExpression:\n return true;\n }\n } while ((node = path.getParentNode(count++)));\n return true;\n}\n\nexport function printModelProperty(\n path: AstPath<ModelPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const { decorators } = printDecorators(path as AstPath<DecorableNode>, options, print, {\n tryInline: DecoratorsTryInline.modelProperty,\n });\n const id = printIdentifier(node.id, \"allow-reserved\");\n return [\n printDirectives(path, options, print),\n decorators,\n id,\n node.optional ? \"?: \" : \": \",\n path.call(print, \"value\"),\n node.default ? [\" = \", path.call(print, \"default\")] : \"\",\n ];\n}\n\nfunction printIdentifier(\n id: IdentifierNode,\n context: \"allow-reserved\" | \"disallow-reserved\" = \"disallow-reserved\",\n) {\n return printIdentifierString(id.sv, context);\n}\n\nfunction isModelExpressionInBlock(path: AstPath<ModelExpressionNode>) {\n const parent: Node | null = path.getParentNode() as any;\n\n switch (parent?.kind) {\n case SyntaxKind.OperationSignatureDeclaration:\n return parent.parameters !== path.getNode();\n default:\n return true;\n }\n}\n\nfunction printScalarStatement(\n path: AstPath<ScalarStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const id = path.call(print, \"id\");\n const template = printTemplateParameters(path, options, print, \"templateParameters\");\n\n const heritage = node.extends\n ? [ifBreak(line, \" \"), \"extends \", path.call(print, \"extends\")]\n : \"\";\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n const shouldPrintBody = nodeHasComments || !(node.members.length === 0);\n\n const members = shouldPrintBody ? [\" \", printScalarBody(path, options, print)] : \";\";\n return [\n printDecorators(path, options, print, { tryInline: false }).decorators,\n \"scalar \",\n id,\n template,\n group(indent([\"\", heritage])),\n members,\n ];\n}\n\nfunction printScalarBody(\n path: AstPath<ScalarStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const hasProperties = node.members && node.members.length > 0;\n const nodeHasComments = hasComments(node, CommentCheckFlags.Dangling);\n if (!hasProperties && !nodeHasComments) {\n return \"{}\";\n }\n const body = [joinMembersInBlock(path, \"members\", options, print, \";\", hardline)];\n if (nodeHasComments) {\n body.push(printDanglingComments(path, options, { sameIndent: true }));\n }\n return group([\"{\", indent(body), hardline, \"}\"]);\n}\n\nfunction printScalarConstructor(\n path: AstPath<ScalarConstructorNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"parameters\"),\n ),\n ),\n softline,\n ]),\n ];\n return [\"init \", id, \"(\", parameters, \")\"];\n}\n\nexport function printNamespaceStatement(\n path: AstPath<FlattenedNamespaceStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const names = path.map(print, \"ids\");\n const currentNode = path.getNode();\n\n const suffix =\n currentNode?.statements === undefined\n ? \";\"\n : [\n \" {\",\n indent([hardline, printStatementSequence(path, options, print, \"statements\")]),\n hardline,\n \"}\",\n ];\n\n const { decorators } = printDecorators(path, options, print, { tryInline: false });\n return [decorators, `namespace `, join(\".\", names), suffix];\n}\n\nexport function printOperationSignatureDeclaration(\n path: AstPath<OperationSignatureDeclarationNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\"(\", path.call(print, \"parameters\"), \"): \", path.call(print, \"returnType\")];\n}\n\nexport function printOperationSignatureReference(\n path: AstPath<OperationSignatureReferenceNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n return [\" is \", path.call(print, \"baseOperation\")];\n}\n\nexport function printOperationStatement(\n path: AstPath<OperationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const inInterface = (path.getParentNode()?.kind as any) === SyntaxKind.InterfaceStatement;\n const templateParams = printTemplateParameters(path, options, print, \"templateParameters\");\n const { decorators } = printDecorators(path as AstPath<DecorableNode>, options, print, {\n tryInline: true,\n });\n\n return [\n decorators,\n inInterface ? \"\" : \"op \",\n path.call(print, \"id\"),\n templateParams,\n path.call(print, \"signature\"),\n `;`,\n ];\n}\n\nexport function printStatementSequence<T extends Node>(\n path: AstPath<T>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n property: keyof T,\n) {\n const node = path.node;\n const parts: Doc[] = [];\n const lastStatement = getLastStatement(node[property] as any as Statement[]);\n\n path.each((statementPath) => {\n const node = path.node;\n\n if (node.kind === SyntaxKind.EmptyStatement) {\n return;\n }\n\n const printed = print(statementPath);\n parts.push(printed);\n\n if (node !== lastStatement) {\n parts.push(hardline);\n\n if (isNextLineEmpty(options.originalText, node, options.locEnd)) {\n parts.push(hardline);\n }\n }\n }, property as any);\n\n return parts;\n}\n\nfunction getLastStatement(statements: Statement[]): Statement | undefined {\n for (let i = statements.length - 1; i >= 0; i--) {\n const statement = statements[i];\n if (statement.kind !== SyntaxKind.EmptyStatement) {\n return statement;\n }\n }\n return undefined;\n}\n\nexport function printUnion(\n path: AstPath<UnionExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const shouldHug = shouldHugType(node);\n\n const types = path.map((typePath) => {\n let printedType: string | Doc = print(typePath);\n if (!shouldHug) {\n printedType = align(2, printedType);\n }\n return printedType;\n }, \"options\");\n\n if (shouldHug) {\n return join(\" | \", types);\n }\n\n const shouldAddStartLine = true;\n const code = [ifBreak([shouldAddStartLine ? line : \"\", \"| \"], \"\"), join([line, \"| \"], types)];\n return group(indent(code));\n}\n\nfunction shouldHugType(node: Node) {\n if (node.kind === SyntaxKind.UnionExpression || node.kind === SyntaxKind.IntersectionExpression) {\n return node.options.length < 4;\n }\n return false;\n}\n\nexport function printTypeReference(\n path: AstPath<TypeReferenceNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n const template = printTemplateParameters(path, options, print, \"arguments\");\n return [type, template];\n}\n\nexport function printTemplateArgument(\n path: AstPath<TemplateArgumentNode>,\n _options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n if (path.node.name !== undefined) {\n const name = path.call(print, \"name\");\n const argument = path.call(print, \"argument\");\n\n return group([name, \" = \", argument]);\n } else {\n return path.call(print, \"argument\");\n }\n}\n\nexport function printValueOfExpression(\n path: AstPath<ValueOfExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n return [\"valueof \", type];\n}\nexport function printTypeOfExpression(\n path: AstPath<TypeOfExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const type = path.call(print, \"target\");\n return [\"typeof \", type];\n}\n\nfunction printTemplateParameterDeclaration(\n path: AstPath<TemplateParameterDeclarationNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n return [\n path.call(print, \"id\"),\n node.constraint ? [\" extends \", path.call(print, \"constraint\")] : \"\",\n node.default ? [\" = \", path.call(print, \"default\")] : \"\",\n ];\n}\n\nfunction printModelSpread(\n path: AstPath<ModelSpreadPropertyNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n return [\"...\", path.call(print, \"target\")];\n}\n\nfunction printDecoratorDeclarationStatement(\n path: AstPath<DecoratorDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\", \", [\n [softline, path.call(print, \"target\")],\n ...path.map((arg) => [softline, print(arg)], \"parameters\"),\n ]),\n ),\n softline,\n ]),\n ];\n return [printModifiers(path, options, print), \"dec \", id, \"(\", parameters, \")\", \";\"];\n}\n\nfunction printFunctionDeclarationStatement(\n path: AstPath<FunctionDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const id = path.call(print, \"id\");\n const parameters = [\n group([\n indent(\n join(\n \", \",\n path.map((arg) => [softline, print(arg)], \"parameters\"),\n ),\n ),\n softline,\n ]),\n ];\n const returnType = node.returnType ? [\": \", path.call(print, \"returnType\")] : \"\";\n return [printModifiers(path, options, print), \"fn \", id, \"(\", parameters, \")\", returnType, \";\"];\n}\n\nfunction printFunctionParameterDeclaration(\n path: AstPath<FunctionParameterNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n const id = printIdentifier(node.id, \"allow-reserved\");\n\n const type = node.type ? [\": \", path.call(print, \"type\")] : \"\";\n\n return [\n node.rest ? \"...\" : \"\",\n printDirectives(path, options, print),\n id,\n node.optional ? \"?\" : \"\",\n type,\n ];\n}\n\nexport function printModifiers(\n path: AstPath<DecoratorDeclarationStatementNode | FunctionDeclarationStatementNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n): Doc {\n const node = path.node;\n if (node.modifiers.length === 0) {\n return \"\";\n }\n\n return path.map((x) => [print(x as any), \" \"], \"modifiers\");\n}\n\nfunction printStringLiteral(\n path: AstPath<StringLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n const multiline = isMultiline(node, options);\n\n const raw = getRawText(node, options);\n if (multiline) {\n const lines = splitLines(raw.slice(3));\n const whitespaceIndent = lines[lines.length - 1].length - 3;\n const newLines = trimMultilineString(lines, whitespaceIndent);\n return [`\"\"\"`, indent(markAsRoot(newLines))];\n } else {\n return raw;\n }\n}\n\nfunction isMultiline(\n node: StringLiteralNode | StringTemplateExpressionNode,\n options: TypeSpecPrettierOptions,\n) {\n return (\n options.originalText[node.pos] &&\n options.originalText[node.pos + 1] === `\"` &&\n options.originalText[node.pos + 2] === `\"`\n );\n}\n\nfunction printNumberLiteral(\n path: AstPath<NumericLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n return node.valueAsString;\n}\n\nfunction printBooleanLiteral(\n path: AstPath<BooleanLiteralNode>,\n options: TypeSpecPrettierOptions,\n): Doc {\n const node = path.node;\n return node.value ? \"true\" : \"false\";\n}\n\nexport function printStringTemplateExpression(\n path: AstPath<StringTemplateExpressionNode>,\n options: TypeSpecPrettierOptions,\n print: PrettierChildPrint,\n) {\n const node = path.node;\n const multiline = isMultiline(node, options);\n const rawHead = getRawText(node.head, options);\n if (multiline) {\n const lastSpan = node.spans[node.spans.length - 1];\n const lastLines = splitLines(getRawText(lastSpan.literal, options));\n const whitespaceIndent = lastLines[lastLines.length - 1].length - 3;\n const content = [\n trimMultilineString(splitLines(rawHead.slice(3)), whitespaceIndent),\n path.map((span: AstPath<StringTemplateSpanNode>) => {\n const expression = span.call(print, \"expression\");\n const spanRawText = getRawText(span.node.literal, options);\n const spanLines = splitLines(spanRawText);\n return [\n expression,\n spanLines[0],\n literalline,\n trimMultilineString(spanLines.slice(1), whitespaceIndent),\n ];\n }, \"spans\"),\n ];\n\n return [`\"\"\"`, indent(markAsRoot([content]))];\n } else {\n const content = [\n rawHead,\n path.map((span: AstPath<StringTemplateSpanNode>) => {\n const expression = span.call(print, \"expression\");\n return [expression, getRawText(span.node.literal, options)];\n }, \"spans\"),\n ];\n return content;\n }\n}\n\nfunction trimMultilineString(lines: string[], whitespaceIndent: number): Doc[] {\n const newLines = [];\n for (let i = 0; i < lines.length; i++) {\n newLines.push(lines[i].slice(whitespaceIndent));\n if (i < lines.length - 1) {\n newLines.push(literalline);\n }\n }\n return newLines;\n}\n\n/**\n * @param node Node that has postition information.\n * @param options Prettier options\n * @returns Raw text in the file for the given node.\n */\nfunction getRawText(node: TextRange, options: TypeSpecPrettierOptions): string {\n if (\"rawText\" in node) {\n return node.rawText as string;\n }\n return options.originalText.slice(node.pos, node.end);\n}\n\nfunction hasComments(node: any, flags?: CommentCheckFlags) {\n if (!node.comments || node.comments.length === 0) {\n return false;\n }\n const test = getCommentTestFunction(flags);\n return test ? node.comments.some(test) : true;\n}\n\nenum CommentCheckFlags {\n /** Check comment is a leading comment */\n Leading = 1 << 1,\n /** Check comment is a trailing comment */\n Trailing = 1 << 2,\n /** Check comment is a dangling comment */\n Dangling = 1 << 3,\n /** Check comment is a block comment */\n Block = 1 << 4,\n /** Check comment is a line comment */\n Line = 1 << 5,\n /** Check comment is a `prettier-ignore` comment */\n PrettierIgnore = 1 << 6,\n /** Check comment is the first attached comment */\n First = 1 << 7,\n /** Check comment is the last attached comment */\n Last = 1 << 8,\n}\n\ntype CommentTestFn = (comment: any, index: number, comments: any[]) => boolean;\n\nfunction getCommentTestFunction(flags: CommentCheckFlags | undefined): CommentTestFn | undefined {\n if (flags) {\n return (comment: any, index: number, comments: any[]) =>\n !(\n (flags & CommentCheckFlags.Leading && !comment.leading) ||\n (flags & CommentCheckFlags.Trailing && !comment.trailing) ||\n (flags & CommentCheckFlags.Dangling && (comment.leading || comment.trailing)) ||\n (flags & CommentCheckFlags.Block && !isBlockComment(comment)) ||\n (flags & CommentCheckFlags.Line && !isLineComment(comment)) ||\n (flags & CommentCheckFlags.First && index !== 0) ||\n (flags & CommentCheckFlags.Last && index !== comments.length - 1)\n );\n }\n return undefined;\n}\n\nfunction isBlockComment(comment: Comment): comment is BlockComment {\n return comment.kind === SyntaxKind.BlockComment;\n}\n\nfunction isLineComment(comment: Comment): comment is LineComment {\n return comment.kind === SyntaxKind.BlockComment;\n}\n", "// Have to create this file so we don't import any JS code from \"prettier\"\n// itself otherwise it cause all kind of issue when bundling in the browser.\nimport type { util as utilType } from \"prettier\";\nimport * as prettier from \"prettier/standalone\";\n\nexport const util: typeof utilType = (prettier as any).util;\n", "import type { Printer } from \"prettier\";\nimport { Node, SyntaxKind, TextRange, TypeSpecScriptNode } from \"../../core/types.js\";\nimport { util } from \"./util.js\";\n\ninterface CommentNode extends TextRange {\n readonly kind: SyntaxKind.LineComment | SyntaxKind.BlockComment;\n precedingNode?: Node;\n enclosingNode?: Node;\n followingNode?: Node;\n}\n\n/**\n * Override the default behavior to attach comments to syntax node.\n */\nexport const commentHandler: Printer<Node>[\"handleComments\"] = {\n ownLine: (comment, text, options, ast, isLastComment) =>\n [\n addEmptyInterfaceComment,\n addEmptyModelComment,\n addEmptyScalarComment,\n addCommentBetweenAnnotationsAndNode,\n handleOnlyComments,\n ].some((x) => x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment })),\n remaining: (comment, text, options, ast, isLastComment) =>\n [handleOnlyComments].some((x) =>\n x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment }),\n ),\n endOfLine: (comment, text, options, ast, isLastComment) =>\n [handleOnlyComments].some((x) =>\n x({ comment, text, options, ast: ast as TypeSpecScriptNode, isLastComment }),\n ),\n};\n\ninterface CommentContext {\n comment: CommentNode;\n text: string;\n options: any;\n ast: TypeSpecScriptNode;\n isLastComment: boolean;\n}\n/**\n * When a comment is on an empty interface make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * interface Foo {\n * // My comment\n * }\n */\nfunction addEmptyInterfaceComment({ comment, ast }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.InterfaceStatement &&\n enclosingNode.operations.length === 0 &&\n precedingNode &&\n precedingNode.kind === SyntaxKind.Identifier\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is in between a node and its annotations(Decorator, directives, doc comments).\n *\n * @example\n *\n * @foo\n * // My comment\n * @bar\n * model Foo {\n * }\n */\nfunction addCommentBetweenAnnotationsAndNode({ comment }: CommentContext) {\n const { enclosingNode, precedingNode } = comment;\n\n if (\n precedingNode &&\n (precedingNode.kind === SyntaxKind.DecoratorExpression ||\n precedingNode.kind === SyntaxKind.DirectiveExpression ||\n precedingNode.kind === SyntaxKind.Doc) &&\n enclosingNode &&\n (enclosingNode.kind === SyntaxKind.NamespaceStatement ||\n enclosingNode.kind === SyntaxKind.ModelStatement ||\n enclosingNode.kind === SyntaxKind.EnumStatement ||\n enclosingNode.kind === SyntaxKind.OperationStatement ||\n enclosingNode.kind === SyntaxKind.ScalarStatement ||\n enclosingNode.kind === SyntaxKind.InterfaceStatement ||\n enclosingNode.kind === SyntaxKind.ModelProperty ||\n enclosingNode.kind === SyntaxKind.EnumMember ||\n enclosingNode.kind === SyntaxKind.UnionVariant ||\n enclosingNode.kind === SyntaxKind.UnionStatement)\n ) {\n util.addTrailingComment(precedingNode, comment);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is on an empty model make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * model Foo {\n * // My comment\n * }\n */\nfunction addEmptyModelComment({ comment }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.ModelStatement &&\n enclosingNode.properties.length === 0 &&\n precedingNode &&\n (precedingNode === enclosingNode.is ||\n precedingNode === enclosingNode.id ||\n precedingNode === enclosingNode.extends)\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\n/**\n * When a comment is on an empty scalar make sure it gets added as a dangling comment on it and not on the identifier.\n *\n * @example\n *\n * scalar foo {\n * // My comment\n * }\n */\nfunction addEmptyScalarComment({ comment }: CommentContext) {\n const { precedingNode, enclosingNode } = comment;\n\n if (\n enclosingNode &&\n enclosingNode.kind === SyntaxKind.ScalarStatement &&\n enclosingNode.members.length === 0 &&\n precedingNode &&\n (precedingNode === enclosingNode.id || precedingNode === enclosingNode.extends)\n ) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n return true;\n }\n return false;\n}\n\nfunction handleOnlyComments({ comment, ast, isLastComment }: CommentContext) {\n const { enclosingNode } = comment;\n if (ast?.statements?.length === 0) {\n if (isLastComment) {\n util.addDanglingComment(ast, comment, undefined);\n } else {\n util.addLeadingComment(ast, comment);\n }\n return true;\n }\n\n if (\n enclosingNode?.kind === SyntaxKind.TypeSpecScript &&\n enclosingNode.statements.length === 0 &&\n enclosingNode.directives?.length === 0\n ) {\n if (isLastComment) {\n util.addDanglingComment(enclosingNode, comment, undefined);\n } else {\n util.addLeadingComment(enclosingNode, comment);\n }\n return true;\n }\n\n return false;\n}\n", "import type { AstPath } from \"prettier\";\nimport { Node, SyntaxKind } from \"../../core/types.js\";\nimport { TypeSpecPrettierOptions } from \"./types.js\";\n\n/**\n * Check if the current path should be wrapped in parentheses\n * @param path Prettier print path.\n * @param options Prettier options\n */\nexport function needsParens(path: AstPath<Node>, options: TypeSpecPrettierOptions): boolean {\n const parent = path.getParentNode();\n if (!parent) {\n return false;\n }\n\n const node = path.node;\n switch (node.kind) {\n case SyntaxKind.ValueOfExpression:\n return (\n parent.kind === SyntaxKind.UnionExpression ||\n parent.kind === SyntaxKind.ArrayExpression ||\n parent.kind === SyntaxKind.IntersectionExpression\n );\n case SyntaxKind.IntersectionExpression:\n return (\n parent.kind === SyntaxKind.UnionExpression || parent.kind === SyntaxKind.ArrayExpression\n );\n case SyntaxKind.UnionExpression:\n return (\n parent.kind === SyntaxKind.IntersectionExpression ||\n parent.kind === SyntaxKind.ArrayExpression\n );\n default:\n return false;\n }\n}\n", "/**\n * Reexport the bare minimum for rollup to do the tree shaking.\n */\nimport * as TypeSpecPrettierPlugin from \"../formatter/index.js\";\nexport default TypeSpecPrettierPlugin;\n", "/**\n * Reexport the bare minimum for rollup to do the tree shaking.\n */\nimport TypeSpecPrettierPlugin from \"@typespec/compiler/internals/prettier-formatter\";\nexport default TypeSpecPrettierPlugin;\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAEA;;;;;;;;;AC8JM,SAAU,QACd,KAAW;AAEX,SAAO,MAAM,QAAQ,GAAG;AAC1B;AAsMM,SAAU,OAAU,OAAQ;AAChC,SAAO;AACT;;;AC5VM,SAAU,wBACdA,cACA,aAAoB;AAEpB,QAAM,eAAe,cACjB,yDAAyD,WAAW,MACpE;AAEJ,WAASC,kBACP,YAAqC;AAErC,UAAM,gBAAgBD,aAAY,WAAW,IAAI;AAEjD,QAAI,CAAC,eAAe;AAClB,YAAM,UAAU,OAAO,KAAKA,YAAW,EACpC,IAAI,CAAC,MAAM,MAAM,CAAC,EAAE,EACpB,KAAK,IAAI;AACZ,YAAM,OAAO,OAAO,WAAW,IAAI;AACnC,YAAM,IAAI,MACR,+BAA+B,IAAI,MAAM,YAAY;EAAqB,OAAO,EAAE;IAEvF;AAEA,UAAM,UAAU,cAAc,SAAS,WAAW,aAAa,SAAS;AACxE,QAAI,CAAC,SAAS;AACZ,YAAM,UAAU,OAAO,KAAK,cAAc,QAAQ,EAC/C,IAAI,CAAC,MAAM,MAAM,CAAC,EAAE,EACpB,KAAK,IAAI;AACZ,YAAM,YAAY,OAAO,WAAW,SAAS;AAC7C,YAAM,OAAO,OAAO,WAAW,IAAI;AACnC,YAAM,IAAI,MACR,0BAA0B,SAAS,MAAM,YAAY,cAAc,IAAI;EAAsB,OAAO,EAAE;IAE1G;AAEA,UAAM,aAAa,OAAO,YAAY,WAAW,UAAU,QAAS,WAAmB,MAAM;AAE7F,UAAM,SAAqB;MACzB,MAAM,cAAc,GAAG,WAAW,IAAI,OAAO,WAAW,IAAI,CAAC,KAAK,WAAW,K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EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAAO;EACP;EAA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T;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;EAAS;EACT;E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AkB,QAAQ,UAAU,SAAS,SAAS;EAErE;AACA,SAAO;AACT;AAEA,SAAS,eAAe,SAAgB;AACtC,SAAO,QAAQ,SAAS,WAAW;AACrC;AAEA,SAAS,cAAc,SAAgB;AACrC,SAAO,QAAQ,SAAS,WAAW;AACrC;;;AfvoDO,IAAM,iBAAiB,CAAA;AAEvB,IAAM,YAA+B;EAC1C;IACE,MAAM;IACN,SAAS,CAAC,UAAU;IACpB,YAAY,CAAC,MAAM;IACnB,mBAAmB,CAAC,UAAU;;;AAIlC,IAAM,iBAAyB;EAC7B,OAAAC;EACA,WAAW;EACX,SAAS,MAAU;AACjB,WAAO,KAAK;EACd;EACA,OAAO,MAAU;AACf,WAAO,KAAK;EACd;;AAEK,IAAM,UAAU;EACrB,UAAU;;AAGL,IAAM,WAAW;EACtB,mBAAmB;;;;AmB3BrB,IAAA,6BAAe;;;ACAf,IAAO,gBAAQ;",
|
|
6
|
+
"names": ["diagnostics", "createDiagnostic", "reportDiagnostic", "line", "ResolutionResultFlags", "SyntaxKind", "IdentifierKind", "ListenerFlow", "line", "prefix", "line", "Token", "TokenFlags", "tokenFlags", "token", "start", "end", "ListKind", "reportDiagnostic", "pos", "decorators", "options", "nextToken", "token", "tokenFlags", "parse", "util", "util", "util", "printIdentifier", "line", "node", "CommentCheckFlags", "parse"]
|
|
7
7
|
}
|