parse throw goto label stmt

This commit is contained in:
vadim 2017-11-29 15:53:44 +02:00
parent 1361679157
commit a14253c7b2
2 changed files with 1173 additions and 1161 deletions

2320
parser.go

File diff suppressed because it is too large Load Diff

View File

@ -355,6 +355,9 @@ statement:
append($5). append($5).
append($6); append($6);
} }
| T_THROW expr ';' { $$ = Node("Throw").append($2) }
| T_GOTO T_STRING ';' { $$ = Node("GoTo").attribute("Label", $2) }
| T_STRING ':' { $$ = Node("Label").attribute("name", $1) }
catch_list: catch_list:
/* empty */ { $$ = Node("CatchList") } /* empty */ { $$ = Node("CatchList") }
@ -749,14 +752,9 @@ simple_variable:
const src = `<?php const src = `<?php
try { throw $exception;
goto test;
} catch(\Exception | RuntimeException $e) { test:
} finally {
}
` `
func main() { func main() {