import { ParserOptions } from './options' import { NO, isArray } from '@vue/shared' import { ErrorCodes, createCompilerError, defaultOnError } from './errors' import { assert, advancePositionWithMutation, advancePositionWithClone, isCoreComponent } from './utils' import { Namespaces, AttributeNode, CommentNode, DirectiveNode, ElementNode, ElementTypes, ExpressionNode, NodeTypes, Position, RootNode, SourceLocation, TextNode, TemplateChildNode, InterpolationNode } from './ast' import { extend } from '@vue/shared' // `isNativeTag` is optional, others are required type OptionalOptions = 'isNativeTag' | 'isBuiltInComponent' type MergedParserOptions = Omit, OptionalOptions> & Pick export const defaultParserOptions: MergedParserOptions = { delimiters: [`{{`, `}}`], getNamespace: () => Namespaces.HTML, getTextMode: () => TextModes.DATA, isVoidTag: NO, isPreTag: NO, isCustomElement: NO, namedCharacterReferences: { 'gt;': '>', 'lt;': '<', 'amp;': '&', 'apos;': "'", 'quot;': '"' }, maxCRNameLength: 5, onError: defaultOnError } export const enum TextModes { // | Elements | Entities | End sign | Inside of DATA, // | ✔ | ✔ | End tags of ancestors | RCDATA, // | ✘ | ✔ | End tag of the parent |