When starting the Phutil lexer in an initial state, push it onto the stack
Summary:
When permissively lexing PHP files, we put the lexer in an initial "php" state (i.e., has see '<?php') if there's no <? in the text. This allows us to correctly highlight PHP diffs which don't include full context.
Previously, under Pygments, we would stick "<?php" on the front and then remove it afterward, but that was messy. Now, we just start the lexer in the right state.
However, we currently set the state to the initial state, rather than pushing it onto the stack. This means a snippet like ?> causes us to pop the state and trigger the "last state was popped" exception.
Instead push the state on to the stack, so if it is popped there's still a 'start' underneath it.
Test Plan: Added a unit test which covers this case. The test fails without this change and passes with it.
Reviewers: vrana, btrahan
Reviewed By: vrana
CC: aran
Maniphest Tasks: T1864
Differential Revision: https://secure.phabricator.com/D3648