import Scanner from '../scanner' ; import { ENDElement , ParsedTag , ENDStatement } from '../ast' ; import { InnerStatement , assertExpression } from './utils' ; import { tagBody } from '../tag' ; param scanner param openTag export default function elementStatement ( scanner , openTag , next ) { const elem = { type : 'ENDElement' , name : openTag . name , component : openTag . name . name . includes ( '-' ) , ref : openTag . ref , attributes : openTag . attributes , directives : openTag . directives , body : tagBody ( scanner , openTag , next ) , ... scanner . loc ( openTag . start ) } ; const ctx = elem ; for ( let i = elem . directives . length - 1 ; i >= 0 ; i -- ) { const dir = elem . directives [ i ] ; if ( dir . prefix === 'class' && dir . value !== null ) { assertExpression ( scanner , dir ) ; } } return ctx ; }