Fixed the type for ECall.

This commit is contained in:
Christian Rinderknecht 2019-05-14 16:04:03 +02:00 committed by Georges Dupéron
parent bb5dadca55
commit fdf7704a7c
5 changed files with 7 additions and 6 deletions

View File

@ -203,7 +203,7 @@ and expr =
| ERecord of record_expr
| EProj of projection reg
| EVar of variable
| ECall of (expr * expr list) reg
| ECall of (expr * expr Utils.nseq) reg
| EBytes of (string * Hex.t) reg
| EUnit of the_unit reg
| ETuple of (expr, comma) Utils.nsepseq reg
@ -680,7 +680,7 @@ and print_expr undo = function
| EString e -> print_string_expr undo e
| ECall {value=f,l; _} ->
print_expr undo f; List.iter (print_expr undo) l
print_expr undo f; Utils.nseq_iter (print_expr undo) l
| EVar v -> print_var v
| EProj p -> print_projection p
| EUnit {value=lpar,rpar; _} ->

View File

@ -213,7 +213,7 @@ and expr =
| ERecord of record_expr (* {f1=e1; ... } *)
| EProj of projection reg (* x.y.z M.x.y *)
| EVar of variable (* x *)
| ECall of (expr * expr list) reg (* e e1 ... en *)
| ECall of (expr * expr Utils.nseq) reg (* e e1 ... en *)
| EBytes of (string * Hex.t) reg (* 0xAEFF *)
| EUnit of the_unit reg (* () *)
| ETuple of (expr, comma) Utils.nsepseq reg (* e1, e2, ... *)

View File

@ -375,7 +375,7 @@ match_expr(right_expr):
let open Region in
let cases = Utils.nsepseq_rev $5.value in
let cast = EVar {region=ghost; value="assert_pos"} in
let cast = ECall {region=ghost; value=cast,[$2]} in
let cast = ECall {region=ghost; value=cast,($2,[])} in
{kwd_match = $1; expr = cast; opening = With $3;
lead_vbar = $4; cases = {$5 with value=cases};
closing = End Region.ghost} }
@ -509,7 +509,7 @@ constr_expr:
constr core_expr? { $1,$2 }
call_expr:
core_expr core_expr+ { $1,$2 }
core_expr nseq(core_expr) { $1,$2 }
core_expr:
reg(Int) { EArith (Int $1) }

View File

@ -2,6 +2,7 @@ open Trace
module Pascaligo = Parser_pascaligo
module Camligo = Parser_camligo
module Ligodity = Parser_ligodity
open Parser_pascaligo
module AST_Raw = Parser_pascaligo.AST

View File

@ -129,7 +129,7 @@ let rec simpl_expression :
let (f, args) = x.value in
let%bind f' = simpl_expression f in
let%bind args' = bind_map_list simpl_expression args in
match List.assoc_opt f constants with
match List.assoc_opt f' constants with
| None ->
let%bind arg = simpl_tuple_expression args' in
return @@ E_application (make_e_a @@ E_variable f, arg)