mozilla-spidermonkey / jsparagus

Experimental JS parser-generator project.
Other
447 stars 20 forks source link

Avoid filter states #598

Closed nbp closed 4 years ago

nbp commented 4 years ago

This code prevent us from generating useless FilterStates conditions when there would be only one FilterStates edge generated.

FilterStates list the states which are expected to be at the top of the parser stack, and this list is exhaustifs, and no other state should be present. If there is exactly one FilterStates, then it must contain all the possible top-state of the parser stack, and all would execute the same thing afterward. This code simply do not produce the FilterStates edge in such case.