Skip to content

Commit

Permalink
Typer_405 proof of concept
Browse files Browse the repository at this point in the history
  • Loading branch information
let-def committed Feb 28, 2017
1 parent e526ca1 commit 5ff48b1
Show file tree
Hide file tree
Showing 42 changed files with 3,945 additions and 3,712 deletions.
4 changes: 2 additions & 2 deletions Makefile.ocamlmakefile
Expand Up @@ -68,6 +68,8 @@ SOURCES_LIB = \
$(TYPER)/parsing/location.ml \
src/ocaml/support/location_aux.mli \
src/ocaml/support/location_aux.ml \
$(TYPER)/parsing/syntaxerr.mli \
$(TYPER)/parsing/syntaxerr.ml \
$(TYPER)/parsing/attr_helper.mli \
$(TYPER)/parsing/attr_helper.ml \
$(TYPER)/parsing/parsetree.mli \
Expand Down Expand Up @@ -127,8 +129,6 @@ SOURCES_LIB = \
$(TYPER)/typing/tast_mapper.ml \
$(TYPER)/typing/cmt_format.mli \
$(TYPER)/typing/cmt_format.ml \
$(TYPER)/parsing/syntaxerr.mli \
$(TYPER)/parsing/syntaxerr.ml \
src/ocaml/support/cmt_cache.ml \
$(TYPER)/typing/ctype.mli \
$(TYPER)/typing/ctype.ml \
Expand Down
2 changes: 1 addition & 1 deletion src/analysis/destruct.ml
Expand Up @@ -183,7 +183,7 @@ let rec needs_parentheses = function
(* We are after the "in" keyword, we need to look at the parent of the
binding. *)
needs_parentheses ts
| Typedtree.Texp_function (_, cases, _) when List.length cases = 1 ->
| Typedtree.Texp_function {cases; _} when List.length cases = 1 ->
(* The assumption here is that we're not in a [function ... | ...]
situation but either in [fun param] or [let name param]. *)
needs_parentheses ts
Expand Down
4 changes: 2 additions & 2 deletions src/ocaml/typer_405/browse_raw.ml
Expand Up @@ -288,8 +288,8 @@ let of_expression_desc loc = function
| Texp_variant (_,None) | Texp_new _ -> id_fold
| Texp_let (_,vbs,e) ->
of_expression e ** list_fold of_value_binding vbs
| Texp_function (_,cs,_) ->
list_fold of_case cs
| Texp_function { cases; _ } ->
list_fold of_case cases
| Texp_apply (e,ls) ->
of_expression e **
list_fold (function
Expand Down

0 comments on commit 5ff48b1

Please sign in to comment.