1. 18 Mar, 2015 1 commit
  2. 16 Feb, 2015 2 commits
    • Kim Nguyễn's avatar
      Correctly flush the toplevel output in case the lexer consumes the · b05e438f
      Kim Nguyễn authored
      "\n" after the ;; token.
      b05e438f
    • Kim Nguyễn's avatar
      Fix the handling of polymorphic variables in the lexer. The solution · 36b83c45
      Kim Nguyễn authored
      to use two lexers (depending on whether we are between square brackets
      or not) is too brittle (it crudely tries to parse
       ``( [whitespace] 'a  [whitespace] )'' as a variable, to force the user
      to write the variable beetween parenthesis. However this does not scale
      to types with two arguments (says [ t ('a, 'b) ]).
      
      We use a simpler heuristic (with look ahead)
      
      (1) try to see if the regular expression
      
      ' (anything but ', \n)* '(anything but the first letter of an identifier)
      
      can be found. If so, we put back the lexeme in the buffer and parse it as as
      a string.
      
      (2) if (1) failed, try to parse it as a variable
      
      (3) if (3) failed, try to parse it again as a string. We are
      guaranteed to fail here but it means we have a malformed string, so we
      parse as a string to get a proper error message.
      
      The only thing this does not cover are cases like
      type t = [ 'abcd'Int ]
      which was tokenized before as [, 'abcd', Int, ]
      and is now tokenized as [, 'abcd, 'Int, ]
      It does not seem to be a problem in practice though (since in the code
      I have seen thus far, people were at least putting a space).
      it is easy to emmit a warning in this case, suggesting the user to add
      a whitespace to get the old behaviour back.
      36b83c45
  3. 09 Sep, 2014 1 commit
    • Pietro Abate's avatar
      New syntax for parametric types · f1235de1
      Pietro Abate authored
      now we can write types as
      type t( 'a) = <a>'a
      
      and patterns can contain type instantiations
      let f = fun (t('a) -> [ t('a)* ]) x -> [ x ];;
      let id = fun (t(Int) -> [ t(Int)* ]) x -> [ x ];;
      
      Note: parametric types must be written as "IDENT(" without space.
      f1235de1
  4. 19 Aug, 2014 1 commit
  5. 23 Jul, 2014 1 commit
  6. 28 Jun, 2014 1 commit
  7. 27 Jun, 2014 2 commits
  8. 26 Jun, 2014 1 commit
  9. 25 Jun, 2014 1 commit
  10. 22 Jun, 2014 1 commit
  11. 19 Jun, 2014 1 commit
  12. 11 Dec, 2013 1 commit
  13. 16 Jul, 2013 3 commits
  14. 12 Jul, 2013 1 commit
  15. 11 Jul, 2013 2 commits
  16. 12 Feb, 2008 1 commit
  17. 29 Jan, 2008 1 commit
  18. 05 Oct, 2007 18 commits