adrian-thurston / ragel

Ragel State Machine Compiler
MIT License
532 stars 46 forks source link

dash in character class causes infinite loop #55

Open rofl0r opened 4 years ago

rofl0r commented 4 years ago

with 6.10, [-0-9] or [0-9-] cause a parse error, however with latest git the following expression causes ragel to go into infinite loop:

 main :=  [ \t] +( ( ( ( ( (  [0-9]  {1,3}   >A $E ) [.]   >A $E ) {3}  [0-9]  {1,3}   >A $E )( [/] [0-9] +  >A $E ) {0,1}   >A $E )|(((( [0-9a-f:]  {2,39}   >A $E ) >A $E )|(( [0-9a-f:]  {0,29}  [:] ( ( (  [0-9]  {1,3}   >A $E ) [.]   >A $E ) {3}  [0-9]  {1,3}   >A $E ) >A $E ) >A $E ) >A $E )( [/] [0-9] +  >A $E ) {0,1}   >A $E ) >A $E )|( [a-z0-9._-] +  >A $E ) >A $E ) [ \t\n] * ;
adrian-thurston commented 4 years ago

Thanks, will have to fix that.