congo-cc / congo-parser-generator

The CongoCC Parser Generator, the Next Generation of JavaCC 21, which in turn was the next generation of JavaCC
https://discuss.congocc.org/
Other
36 stars 11 forks source link

Is this a typo? It seems to subtract A - A #90

Closed vsajip closed 9 months ago

vsajip commented 9 months ago

https://github.com/congo-cc/congo-parser-generator/blob/d174dc12c5cf1043be526aac42031bb03d9d87de/src/java/org/congocc/core/nfa/CompositeStateSet.java#L91-L93

revusky commented 9 months ago

Uhh, yeah, it must be a typo! I actually wrote this comparator explicitly so we would have deterministic ordering, I guess. As you surely surmise, it should almost certainly be result = state1.getMoveRanges().size-state2.getMoveRanges().size();