import type { CompileError , ResourceNode } from '@intlify/message-compiler' ; import { createParser } from '@intlify/message-compiler' ; export function parse ( code ) { const errors = [ ] ; const parser = createParser ( { onError ( error ) { errors . push ( error ) ; } } ) ; const ast = parser . parse ( code ) ; return { ast , errors } ; }