fsprojects / FsLexYacc

Lexer and parser generators for F#
http://fsprojects.github.io/FsLexYacc/
MIT License
207 stars 69 forks source link

Reductions table being recreated on each parser invocation #139

Closed dsyme closed 3 years ago

dsyme commented 3 years ago

It looks like the reductions table is now created lazily, to reduce startup cost. But after creation it is not saved in any way (lazy is not used).

e.g.

let tables () : Internal.Utilities.Text.Parsing.Tables<_> = 
  { reductions= _fsyacc_reductions ();
    endOfInputTag = _fsyacc_endOfInputTag;
    ... }
let ilInstrs lexer lexbuf : ILInstr array = Microsoft.FSharp.Core.Operators.unbox ((tables ()).Interpret(lexer, lexbuf, 0))

We should probably save the table after creation.