title: How to return multiple tokens for one fslex rule pattern?
body: <p>Using <strong>fslex</strong> I would like to return multiple tokens for one pattern but I don't see a way how to accomplish that. Even to use another rule function that returns multiple tokens would work for me.</p>
  
  <p>I am trying to use something like this:</p>
  
  <pre><code>let identifier = [ 'a'-'z' 'A'-'Z' ]+
  
  // ...
  
  rule tokenize = parse
  // ...
  | '.' identifier '(' { let value = lexeme lexbuf
                         match operations.TryFind(value) with
                        // TODO: here is the problem:
                        // I would like to return like [DOT; op; LPAREN]
                        | Some op -&gt; op
                        | None    -&gt; ID(value) }
  
  | identifier         { ID (lexeme lexbuf) }
  // ...
  </code></pre>
  
  <p>The problem I am trying to solve here is to match for predefined tokens (see: <code>operations</code> map) only if the <code>identifier</code> is between <code>.</code> and <code>(</code>. Otherwise the match should be returned as an <code>ID</code>.</p>
  
  <p>I am fairly new to fslex so I am happy for any pointers in the right direction.</p>