[SVN] r5204 (OCaml)

William D. Neumann wneumann at cs.unm.edu
Wed Sep 13 21:43:15 UTC 2006


More tweaks:

* Changed the begin/end regexes for meta.type-constraint from
      begin = '(\()(?=(~[a-z][a-zA-Z0-9_]*:|("(\\"|[^"])*")|[^\(\)~"])+(:>|:(?![=:])))';
      end = '(:>|:(?![=:]))(.*?)(\))';
  to
      begin = '(\()(?=(~[a-z][a-zA-Z0-9_]*:|("(\\"|[^"])*")|[^\(\)~"])+([^:>=]:[^:]))';
      end = '([^:>=]:[^:])(.*?)(\))';

  This keeps constructs like (a :: b) from being snagged by the type-constraint scope.

* Did similarly to variable.parameter.type-constrained to keep it from mishandling structures like:
      List.iter (fun (f,i) -> Printf.printf "feh(%d): %s\n" i (string_of_float f)) fi_list
  where the `:` in the string was being picked up by the regexps.

* Added a keyword.operator.prefix.ocaml scope, similar to the keyword.operator.infix.ocaml scope... only for prefix operators.

* Added `->` as punctuation.separator.function-return.ocaml

* Changed the begin regexp for meta.pattern-match.ocaml to
      '\b(with|function)\b|((?<!\|)(\|)(?!\|)(?=.*->))'
  so code like `try f x with Not_found -> []` get scoped properly

* Added constant.character.regexp.escape.ocaml, punctuation.string.ignore-eol.ocaml, and invalid.illegal.character.string.escape patterns to the string.quoted.double.ocaml scope.

* Modified the constant.character.string.escape.ocaml patterns to capture all valid escapes (e.g. \255)

* Made a change that might make you a little itchy if your code is heavy on recursive type definitions (and light on let ... and ... value binding operations).  Changed the begin regexp for meta.type-definition.ocaml such that `and` only matches if it is followed by `type` inside a comment, e.g:

      type t = int*j
      and (*type*) j = string
                                                
 This also required a change to meta.function.ocaml so it would ignore the (* type *) comment and not treat it like the name of a function.  I'd like to find a better solution for this issue, but my brain is tired...

William D. Neumann

Changed:
U   trunk/Bundles/OCaml.tmbundle/Syntaxes/OCaml.plist



More information about the textmate-dev mailing list