#62: save the all text after __halt_compiler(); as Meta
This commit is contained in:
parent
4989d31874
commit
b805f0b167
@ -1037,7 +1037,9 @@ func TestParseAndPrintPhp5Goto(t *testing.T) {
|
||||
|
||||
func TestParseAndPrintPhp5HaltCompiler(t *testing.T) {
|
||||
src := `<?php
|
||||
__halt_compiler ( ) ;`
|
||||
__halt_compiler ( ) ;
|
||||
this text is ignored by parser
|
||||
`
|
||||
|
||||
actual := printPhp5(parsePhp5(src))
|
||||
|
||||
|
@ -1146,7 +1146,9 @@ func TestParseAndPrintGroupUse(t *testing.T) {
|
||||
|
||||
func TestParseAndPrintHaltCompiler(t *testing.T) {
|
||||
src := `<?php
|
||||
__halt_compiler ( ) ;`
|
||||
__halt_compiler ( ) ;
|
||||
this text is ignored by parser
|
||||
`
|
||||
|
||||
actual := print(parse(src))
|
||||
|
||||
|
@ -8948,7 +8948,7 @@ yyrule167: // .
|
||||
}
|
||||
yyrule168: // .|[ \t\n\r]
|
||||
{
|
||||
// do nothing
|
||||
l.addMeta(meta.TokenType, l.Token())
|
||||
goto yystate0
|
||||
}
|
||||
panic("unreachable")
|
||||
|
@ -673,7 +673,7 @@ NEW_LINE (\r|\n|\r\n)
|
||||
<STRING_VAR_NAME>{VAR_NAME}[\[\}] l.popState();l.pushState(PHP);lval.Token(l.createToken(l.ungetChars(1))); return int(T_STRING_VARNAME)
|
||||
<STRING_VAR_NAME>. l.ungetChars(1);l.popState();l.pushState(PHP)
|
||||
|
||||
<HALT_COMPILER>.|[ \t\n\r] // do nothing
|
||||
<HALT_COMPILER>.|[ \t\n\r] l.addMeta(meta.TokenType, l.Token())
|
||||
|
||||
%%
|
||||
if _, ok := l.Abort(); ok {
|
||||
|
Loading…
Reference in New Issue
Block a user