Merge branch 'dev' of gitlab.com:ligolang/ligo into rinderknecht@pprint
This commit is contained in:
commit
b97d2d4000
@ -1,7 +1,8 @@
|
|||||||
{ dockerTools, writeShellScriptBin, runCommand, mcpp, bash, coreutils, ligo, name ? "ligo" }:
|
{ dockerTools, writeShellScriptBin, runCommand, mcpp, bash, coreutils, ligo
|
||||||
|
, name ? "ligo", extraContents ? [ ] }:
|
||||||
dockerTools.buildLayeredImage {
|
dockerTools.buildLayeredImage {
|
||||||
inherit name;
|
inherit name;
|
||||||
tag = "latest";
|
tag = "latest";
|
||||||
contents = [ ligo bash ];
|
contents = [ ligo bash ] ++ extraContents;
|
||||||
config.Entrypoint = name;
|
config.Entrypoint = name;
|
||||||
}
|
}
|
||||||
|
@ -20,6 +20,9 @@ let
|
|||||||
pkgs.runCommandNoCC "${pkg.name}-bin" { }
|
pkgs.runCommandNoCC "${pkg.name}-bin" { }
|
||||||
"mkdir -p $out/bin; cp -Lr ${pkg}/ligo $out/bin";
|
"mkdir -p $out/bin; cp -Lr ${pkg}/ligo $out/bin";
|
||||||
|
|
||||||
|
|
||||||
|
tmp = pkgs.runCommandNoCC "tmpdir" { } "mkdir -p $out/tmp";
|
||||||
|
|
||||||
in pkgs.extend (self: super: {
|
in pkgs.extend (self: super: {
|
||||||
inherit (self.ocamlPackages) ligo ligo-out ligo-tests ligo-doc ligo-coverage;
|
inherit (self.ocamlPackages) ligo ligo-out ligo-tests ligo-doc ligo-coverage;
|
||||||
ligo-bin = separateBinary self.ligo-out.bin;
|
ligo-bin = separateBinary self.ligo-out.bin;
|
||||||
@ -29,6 +32,7 @@ in pkgs.extend (self: super: {
|
|||||||
ligo-editor-docker = self.callPackage ./docker.nix {
|
ligo-editor-docker = self.callPackage ./docker.nix {
|
||||||
ligo = self.ligo-editor;
|
ligo = self.ligo-editor;
|
||||||
name = "ligo-editor";
|
name = "ligo-editor";
|
||||||
|
extraContents = [ tmp ];
|
||||||
};
|
};
|
||||||
ligo-website = self.callPackage ./ligo-website.nix {
|
ligo-website = self.callPackage ./ligo-website.nix {
|
||||||
inherit (nix-npm-buildpackage) buildNpmPackage;
|
inherit (nix-npm-buildpackage) buildNpmPackage;
|
||||||
|
@ -338,7 +338,7 @@ let rec compile_expression :
|
|||||||
let (p , loc) = r_split p in
|
let (p , loc) = r_split p in
|
||||||
let var =
|
let var =
|
||||||
let name = Var.of_name p.struct_name.value in
|
let name = Var.of_name p.struct_name.value in
|
||||||
e_variable name in
|
e_variable ~loc name in
|
||||||
let path = p.field_path in
|
let path = p.field_path in
|
||||||
let path' =
|
let path' =
|
||||||
let aux (s:Raw.selection) =
|
let aux (s:Raw.selection) =
|
||||||
@ -532,7 +532,7 @@ let rec compile_expression :
|
|||||||
| EBytes x ->
|
| EBytes x ->
|
||||||
let (x , loc) = r_split x in
|
let (x , loc) = r_split x in
|
||||||
return @@ e_literal ~loc (Literal_bytes (Hex.to_bytes @@ snd x))
|
return @@ e_literal ~loc (Literal_bytes (Hex.to_bytes @@ snd x))
|
||||||
| ETuple tpl -> compile_tuple_expression @@ (npseq_to_list tpl.value)
|
| ETuple tpl -> compile_tuple_expression ~loc:(Location.lift tpl.region) @@ (npseq_to_list tpl.value)
|
||||||
| ERecord r ->
|
| ERecord r ->
|
||||||
let (r , loc) = r_split r in
|
let (r , loc) = r_split r in
|
||||||
let%bind fields = bind_list
|
let%bind fields = bind_list
|
||||||
|
@ -45,14 +45,13 @@ module Errors = struct
|
|||||||
] in
|
] in
|
||||||
error ~data title message ()
|
error ~data title message ()
|
||||||
|
|
||||||
let unbound_variable (e:environment) (n:I.expression_variable) (loc:Location.t) () =
|
let unbound_variable (e:environment) (n:I.expression_variable) () =
|
||||||
let name () = Format.asprintf "%a" I.PP.expression_variable n in
|
let name () = Format.asprintf "%a" I.PP.expression_variable n in
|
||||||
let title = (thunk ("unbound variable "^(name ()))) in
|
let title = (thunk ("unbound variable "^(name ()))) in
|
||||||
let message () = "" in
|
let message () = "" in
|
||||||
let data = [
|
let data = [
|
||||||
("variable" , name) ;
|
("variable" , name) ;
|
||||||
("environment" , fun () -> Format.asprintf "%a" Environment.PP.environment e) ;
|
("environment" , fun () -> Format.asprintf "%a" Environment.PP.environment e) ;
|
||||||
("location" , fun () -> Format.asprintf "%a" Location.pp loc)
|
|
||||||
] in
|
] in
|
||||||
error ~data title message ()
|
error ~data title message ()
|
||||||
|
|
||||||
@ -698,7 +697,7 @@ and type_expression' : environment -> ?tv_opt:O.type_expression -> I.expression
|
|||||||
(* Basic *)
|
(* Basic *)
|
||||||
| E_variable name ->
|
| E_variable name ->
|
||||||
let%bind tv' =
|
let%bind tv' =
|
||||||
trace_option (unbound_variable e name ae.location)
|
trace_option (unbound_variable e name)
|
||||||
@@ Environment.get_opt name e in
|
@@ Environment.get_opt name e in
|
||||||
return (E_variable name) tv'.type_value
|
return (E_variable name) tv'.type_value
|
||||||
| E_literal Literal_unit ->
|
| E_literal Literal_unit ->
|
||||||
|
Loading…
Reference in New Issue
Block a user