Next: , Previous: Flex is not matching my patterns in the same order that I defined them., Up: FAQ


My actions are executing out of order or sometimes not at all.

Most likely, you have (in error) placed the opening ‘{’ of the action block on a different line than the rule, e.g.,

     ^(foo|bar)
     {  <<<--- WRONG!
     
     }

flex requires that the opening ‘{’ of an action associated with a rule begin on the same line as does the rule. You need instead to write your rules as follows:

     ^(foo|bar)   {  // CORRECT!
     
     }