pw374 / glical

glancing at iCal data using OCaml
Other
11 stars 3 forks source link

lexing misses last parameter #6

Open Matafou opened 4 years ago

Matafou commented 4 years ago

Hi, It seems your lexing loses the last parameter of an assoc. It seems to be fixable by this in glical_kernel in the Lexing module (I am too lazy to make a pull request for such a small fix):

let loop ?(dq=dq) ?(p=p) ?(eq=eq) i = loop dq p eq i in
      Format.printf "@.BUFFER = %s" (Buffer.contents b); 
      if i = String.length s then (*parameters end, there may be apending param yet to register*)
        (if p && eq then parameters := (!k, Buffer.contents b) :: !parameters;())
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        else...
pw374 commented 4 years ago

Thank you!

At the moment I'm not able to really understand the issue (because I don't have time to investigate), so I've created the PR with the contents you've suggested (I haven't even tried to compile it).

Hopefully I'll have a deeper look into it very soon.