luser-dr00g / xpost

A PostScript interpreter in C
Other
93 stars 12 forks source link

Remove integer automaton from grok() #42

Open luser-dr00g opened 7 years ago

luser-dr00g commented 7 years ago

The floating-point automaton detects integers as well, as a different returned state. Therefore we can call check() once instead of twice and discriminate the two cases by calling the accept functions on the result.

This should speed-up all parsing as the number tests are applied first, contrary to the behavior of FORTH.