forked from facebook/hermes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: This diff changes `AlternationNode` so that instead of only holding a left and right branch, it can hold a vector of alternatives. The current implementation of the regex parser constructs a recursive data structure of depth n for an alternation containing n alternatives. With this change, we can eliminate that recursion so that arbitrarily large alternations can be constructed without causing a stack overflow. In addition to avoiding parser stack overflows, this gives us more flexibility in codegen and allows us to generate more efficient bytecode. Reviewed By: avp Differential Revision: D21879548 fbshipit-source-id: 10038bde5e1c659ea843dbab8054b6ec732e52a5
- Loading branch information
1 parent
b7d1fd8
commit f9faefa
Showing
1 changed file
with
61 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters