import parser from 'php-array-parser' ; import { Parser } from './base' ; export class PhpParser extends Parser { id = 'php' ; readonly = true ; constructor ( ) { super ( [ 'php' ] , 'php' ) ; } async parse ( text ) { const ret = text . indexOf ( 'return' ) + 'return' . length ; text = text . substr ( ret ) ; text = text . replace ( /\?>\s*$/ , '_' ) ; return parser . parse ( text ) ; } async dump ( ) { return '' ; } }