function parseTag(context, type, parent) {
      // Tag open.
      const start = getCursor(context);
      const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
      const tag = match[1];
      const ns = context.options.getNamespace(tag, parent);
      advanceBy(context, match[0].length);
      advanceSpaces(context);
      // save current state in case we need to re-parse attributes with v-pre
      const cursor = getCursor(context);
      const currentSource = context.source;
      // Attributes.
      let props = parseAttributes(context, type);
      // check <pre> tag
      if (context.options.isPreTag(tag)) {
          context.inPre = true;
      }
      // check v-pre
      if (!context.inVPre &&
          props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'pre')) {
          context.inVPre = true;
          // reset context
          extend(context, cursor);
          context.source = currentSource;
          // re-parse attrs and filter out v-pre itself
          props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
      }
      // Tag close.
      let isSelfClosing = false;
      if (context.source.length === 0) {
          emitError(context, 9 /* EOF_IN_TAG */);
      }
      else {
          isSelfClosing = startsWith(context.source, '/>');
          if (type === 1 /* End */ && isSelfClosing) {
              emitError(context, 4 /* END_TAG_WITH_TRAILING_SOLIDUS */);
          }
          advanceBy(context, isSelfClosing ? 2 : 1);
      }
      let tagType = 0 /* ELEMENT */;
      const options = context.options;
      if (!context.inVPre && !options.isCustomElement(tag)) {
          const hasVIs = props.some(p => p.type === 7 /* DIRECTIVE */ && p.name === 'is');
          if (options.isNativeTag && !hasVIs) {
              if (!options.isNativeTag(tag))
                  tagType = 1 /* COMPONENT */;
          }
          else if (hasVIs ||
              isCoreComponent(tag) ||
              (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
              /^[A-Z]/.test(tag) ||
              tag === 'component') {
              tagType = 1 /* COMPONENT */;
          }
          if (tag === 'slot') {
              tagType = 2 /* SLOT */;
          }
          else if (tag === 'template' &&
              props.some(p => {
                  return (p.type === 7 /* DIRECTIVE */ && isSpecialTemplateDirective(p.name));
              })) {
              tagType = 3 /* TEMPLATE */;
          }
      }
      return {
          type: 1 /* ELEMENT */,
          ns,
          tag,
          tagType,
          props,
          isSelfClosing,
          children: [],
          loc: getSelection(context, start),
          codegenNode: undefined // to be created during transform phase
      };
  }
/**
   * Parse a tag (E.g. `<div id=a>`) with that type (start tag or end tag).
   */
Parse a tag  with that type (start tag or end tag).
Parse a tag with that type ( start tag or end tag ) .
function parseTag(context, type, parent) {
      const start = getCursor(context);
      const match = /^<\/?([a-z][^\t\r\n\f />]*)/i.exec(context.source);
      const tag = match[1];
      const ns = context.options.getNamespace(tag, parent);
      advanceBy(context, match[0].length);
      advanceSpaces(context);
      const cursor = getCursor(context);
      const currentSource = context.source;
      let props = parseAttributes(context, type);
      if (context.options.isPreTag(tag)) {
          context.inPre = true;
      }
      if (!context.inVPre &&
          props.some(p => p.type === 7  && p.name === 'pre')) {
          context.inVPre = true;
          extend(context, cursor);
          context.source = currentSource;
          props = parseAttributes(context, type).filter(p => p.name !== 'v-pre');
      }
      let isSelfClosing = false;
      if (context.source.length === 0) {
          emitError(context, 9 );
      }
      else {
          isSelfClosing = startsWith(context.source, '/>');
          if (type === 1  && isSelfClosing) {
              emitError(context, 4 );
          }
          advanceBy(context, isSelfClosing ? 2 : 1);
      }
      let tagType = 0 ;
      const options = context.options;
      if (!context.inVPre && !options.isCustomElement(tag)) {
          const hasVIs = props.some(p => p.type === 7  && p.name === 'is');
          if (options.isNativeTag && !hasVIs) {
              if (!options.isNativeTag(tag))
                  tagType = 1 ;
          }
          else if (hasVIs ||
              isCoreComponent(tag) ||
              (options.isBuiltInComponent && options.isBuiltInComponent(tag)) ||
              /^[A-Z]/.test(tag) ||
              tag === 'component') {
              tagType = 1 ;
          }
          if (tag === 'slot') {
              tagType = 2 ;
          }
          else if (tag === 'template' &&
              props.some(p => {
                  return (p.type === 7  && isSpecialTemplateDirective(p.name));
              })) {
              tagType = 3 ;
          }
      }
      return {
          type: 1 ,
          ns,
          tag,
          tagType,
          props,
          isSelfClosing,
          children: [],
          loc: getSelection(context, start),
          codegenNode: undefined 
      };
  }
function parseTag ( context , type , parent ) { const start = getCursor ( context ) ; const match = / ^<\/?([a-z][^\t\r\n\f />]*) / i . exec ( context . source ) ; const tag = match [ 1 ] ; const ns = context . options . getNamespace ( tag , parent ) ; advanceBy ( context , match [ 0 ] . length ) ; advanceSpaces ( context ) ; const cursor = getCursor ( context ) ; const currentSource = context . source ; let props = parseAttributes ( context , type ) ; if ( context . options . isPreTag ( tag ) ) { context . inPre = true ; } if ( ! context . inVPre && props . some ( p => p . type === 7 && p . name === 'pre' ) ) { context . inVPre = true ; extend ( context , cursor ) ; context . source = currentSource ; props = parseAttributes ( context , type ) . filter ( p => p . name !== 'v-pre' ) ; } let isSelfClosing = false ; if ( context . source . length === 0 ) { emitError ( context , 9 ) ; } else { isSelfClosing = startsWith ( context . source , '/>' ) ; if ( type === 1 && isSelfClosing ) { emitError ( context , 4 ) ; } advanceBy ( context , isSelfClosing ? 2 : 1 ) ; } let tagType = 0 ; const options = context . options ; if ( ! context . inVPre && ! options . isCustomElement ( tag ) ) { const hasVIs = props . some ( p => p . type === 7 && p . name === 'is' ) ; if ( options . isNativeTag && ! hasVIs ) { if ( ! options . isNativeTag ( tag ) ) tagType = 1 ; } else if ( hasVIs || isCoreComponent ( tag ) || ( options . isBuiltInComponent && options . isBuiltInComponent ( tag ) ) || / ^[A-Z] / . test ( tag ) || tag === 'component' ) { tagType = 1 ; } if ( tag === 'slot' ) { tagType = 2 ; } else if ( tag === 'template' && props . some ( p => { return ( p . type === 7 && isSpecialTemplateDirective ( p . name ) ) ; } ) ) { tagType = 3 ; } } return { type : 1 , ns , tag , tagType , props , isSelfClosing , children : [ ] , loc : getSelection ( context , start ) , codegenNode : undefined } ; }
Parse a tag (E.g.
Parse a tag ( E . g .
// Tag open.
 // save current state in case we need to re-parse attributes with v-pre
 // Attributes.
 // check <pre> tag
 // check v-pre
 /* DIRECTIVE */ // reset context
 // re-parse attrs and filter out v-pre itself
 // Tag close.
 /* EOF_IN_TAG */ /* End */ /* END_TAG_WITH_TRAILING_SOLIDUS */ /* ELEMENT */ /* DIRECTIVE */ /* COMPONENT */ /* COMPONENT */ /* SLOT */ /* DIRECTIVE */ /* TEMPLATE */ /* ELEMENT */ // to be created during transform phase
