From 78c6cbae68ba610502025ddb89b44ebb5175b45e Mon Sep 17 00:00:00 2001 From: Matej Sima Date: Mon, 12 Aug 2019 10:41:53 +0200 Subject: [PATCH 01/25] Add build & packaging scripts for multiplatform ligo binary distribution --- .dockerignore | 6 ++ .gitlab-ci.yml | 79 +++++++++++++------ dist/.gitignore | 4 + .../distribution/debian/distribute.Dockerfile | 0 docker/distribution/debian/package.Dockerfile | 32 ++++++++ .../generic/build.Dockerfile} | 11 +-- scripts/build_docker_image.sh | 3 +- scripts/distribution/generic/build.sh | 11 +++ scripts/distribution/generic/env_variables.sh | 12 +++ scripts/distribution/generic/package.sh | 20 +++++ scripts/distribution/generic/parameters.sh | 32 ++++++++ 11 files changed, 179 insertions(+), 31 deletions(-) create mode 100644 .dockerignore create mode 100644 dist/.gitignore create mode 100644 docker/distribution/debian/distribute.Dockerfile create mode 100644 docker/distribution/debian/package.Dockerfile rename docker/{Dockerfile => distribution/generic/build.Dockerfile} (81%) create mode 100755 scripts/distribution/generic/build.sh create mode 100755 scripts/distribution/generic/env_variables.sh create mode 100755 scripts/distribution/generic/package.sh create mode 100644 scripts/distribution/generic/parameters.sh diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000..ccf03db24 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,6 @@ +dist +_opam +_build +docker +gitlab-pages +Makefile \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 1fa3cd9ec..19e5d7f6a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,12 +1,27 @@ # TODO: remove this as submodules aren't used anymore. variables: GIT_SUBMODULE_STRATEGY: recursive + build_binary_script: "./scripts/distribution/generic/build.sh" + package_binary_script: "./scripts/distribution/generic/package.sh" stages: - build_docker - - build_and_deploy_docker - - build_and_deploy_website - test + - build_and_deploy_docker + - build_and_package_binaries + - build_and_deploy_website + +.build_binary: &build_binary + stage: build_and_package_binaries + script: + - $build_binary_script "$target_os_family" "$target_os" "$target_os_version" + - $package_binary_script "$target_os_family" "$target_os" "$target_os_version" + artifacts: + paths: + - dist/package/**/* + only: + - master + - dev .website_build: &website_build stage: build_and_deploy_website @@ -71,30 +86,12 @@ local-dune-job: - scripts/build_ligo_local.sh - dune build @ligo-test -remote-repo-job: - <<: *before_script - stage: test - script: - # Add repository - - opam repository add ligo-repository https://gitlab.com/ligolang/ligo.git - - eval $(opam config env) - - opam install -y ligo - # Used in the IDE - #- opam install -y user-setup - #- opam install -y merlin - #- opam install -y ocp-indent - #- opam user-setup install - only: - - master - -# TODO: uncomment this - # Run a docker build without publishing to the registry build-current-docker-image: stage: build_docker <<: *docker script: - - docker build -t $LIGO_REGISTRY_IMAGE:next -f ./docker/Dockerfile . + - sh scripts/build_docker_image.sh - sh scripts/test_cli.sh except: - master @@ -106,13 +103,51 @@ build-and-publish-latest-docker-image: stage: build_and_deploy_docker <<: *docker script: - - docker build -t $LIGO_REGISTRY_IMAGE:next -f ./docker/Dockerfile . + - sh scripts/build_docker_image.sh - sh scripts/test_cli.sh - docker login -u $LIGO_REGISTRY_USER -p $LIGO_REGISTRY_PASSWORD - docker push $LIGO_REGISTRY_IMAGE:next only: - dev +# It'd be a good idea to generate those jobs dynamically, +# based on desired targets +build-and-package-debian-9: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "debian" + target_os_version: "9" + <<: *build_binary + +build-and-package-debian-10: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "debian" + target_os_version: "10" + <<: *build_binary + +build-and-package-ubuntu-18-04: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "ubuntu" + target_os_version: "18.04" + <<: *build_binary + +build-and-package-ubuntu-19-04: + <<: *docker + stage: build_and_package_binaries + variables: + target_os_family: "debian" + target_os: "ubuntu" + target_os_version: "19.04" + <<: *build_binary + # Pages are deployed from both master & dev, be careful not to override 'next' # in case something gets merged into 'dev' while releasing. pages: diff --git a/dist/.gitignore b/dist/.gitignore new file mode 100644 index 000000000..86d0cb272 --- /dev/null +++ b/dist/.gitignore @@ -0,0 +1,4 @@ +# Ignore everything in this directory +* +# Except this file +!.gitignore \ No newline at end of file diff --git a/docker/distribution/debian/distribute.Dockerfile b/docker/distribution/debian/distribute.Dockerfile new file mode 100644 index 000000000..e69de29bb diff --git a/docker/distribution/debian/package.Dockerfile b/docker/distribution/debian/package.Dockerfile new file mode 100644 index 000000000..440496521 --- /dev/null +++ b/docker/distribution/debian/package.Dockerfile @@ -0,0 +1,32 @@ +ARG targetBuildImage +FROM ${targetBuildImage} +ARG version + +RUN apt-get update -qq +RUN apt-get -y -qq install \ + dput \ + devscripts + +RUN mkdir /package && mkdir /package/bin && mkdir /package/DEBIAN && mkdir /package/dist +# @TODO: make the binary path configurable +RUN cp /home/opam/.opam/4.07/bin/ligo /package/bin/ligo + +# @TODO: inherit version (and other details) from the ligo opam package definition +# In our case we're using the version field to name our package accordingly, +# however this is most likely not ideal +# Also, the architecture field should not be 'all' but rather specific instead. +RUN echo "Package: ligo\n\ +Version: $version\n\ +Architecture: all\n\ +Maintainer: info@ligolang.org\n\ +Depends: libev-dev, perl, pkg-config, libgmp-dev, libhidapi-dev, m4, libcap-dev, bubblewrap, rsync\n\ +Homepage: http://ligolang.org\n\ +Description: LIGO is a statically typed high-level smart-contract language that compiles down to Michelson." >> /package/DEBIAN/control + +RUN cd /package/dist && dpkg-deb --build /package . + +# Test the package +# Optionally this could/should be done in a more pristine docker environment - in a separate image +RUN apt-get update -qq +RUN apt-get -y -f install "/package/dist/$(ls /package/dist)" +RUN ligo --help \ No newline at end of file diff --git a/docker/Dockerfile b/docker/distribution/generic/build.Dockerfile similarity index 81% rename from docker/Dockerfile rename to docker/distribution/generic/build.Dockerfile index 057bd6436..e183fc683 100644 --- a/docker/Dockerfile +++ b/docker/distribution/generic/build.Dockerfile @@ -1,5 +1,7 @@ -# At the moment, this really means 4.07.1 -FROM ocaml/opam2:4.07 +ARG target +FROM ocaml/opam2:${target} + +RUN opam switch 4.07 && eval $(opam env) USER root @@ -10,7 +12,6 @@ USER root # because the currently checkout out version (from git) will be used # to build the image ADD . /ligo - # Set the current working directory to /ligo for # the upcoming scripts WORKDIR /ligo @@ -18,10 +19,6 @@ WORKDIR /ligo # Install required native dependencies RUN sh scripts/install_native_dependencies.sh -# Install OPAM -# TODO: or scripts/install_build_environment.sh ? -RUN sh scripts/install_opam.sh - # Add tezos repository RUN sh scripts/setup_repos.sh diff --git a/scripts/build_docker_image.sh b/scripts/build_docker_image.sh index 273fa92c6..21e3a2bf5 100755 --- a/scripts/build_docker_image.sh +++ b/scripts/build_docker_image.sh @@ -1,4 +1,3 @@ #!/bin/sh set -e - -docker build -t ligolang/ligo -f docker/Dockerfile . +docker build --build-arg target="4.07" -t "${LIGO_REGISTRY_IMAGE_BUILD:-ligolang/ligo}:next" -f ./docker/distribution/generic/build.Dockerfile . diff --git a/scripts/distribution/generic/build.sh b/scripts/distribution/generic/build.sh new file mode 100755 index 000000000..7f4a89e9a --- /dev/null +++ b/scripts/distribution/generic/build.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +dockerfile_name="build" +# Generic dockerfile +dockerfile="./docker/distribution/generic/build.Dockerfile" +. ./scripts/distribution/generic/parameters.sh + +echo "Building LIGO for $target" +echo "Using Dockerfile: $dockerfile" +echo "Tagging as: $tag_build\n" +docker build --build-arg target="$target" -t "$tag_build" -f "$dockerfile" . \ No newline at end of file diff --git a/scripts/distribution/generic/env_variables.sh b/scripts/distribution/generic/env_variables.sh new file mode 100755 index 000000000..7279e4cbe --- /dev/null +++ b/scripts/distribution/generic/env_variables.sh @@ -0,0 +1,12 @@ +# This file is a substitute for env variables configured in the CI +# in case you want to run the "CI scripts" on your own +# You can load the following variables using: +# source ./scripts/distribution/generic/env_variables.sh + +export LIGO_REGISTRY_IMAGE_BASE_NAME="ligolang/ligo" +# packages build locally are tagget by the 'short' commit hash, +# instead of the build/job/pipeline ID as in the CI to avoid possible confusion +# ligo_incrementing-id_commit-hash +export CI_JOB_ID="0" +export CI_COMMIT_SHORT_SHA="$(git rev-parse --short HEAD)" +export LIGO_DIST_DIR="./dist" diff --git a/scripts/distribution/generic/package.sh b/scripts/distribution/generic/package.sh new file mode 100755 index 000000000..b00b61841 --- /dev/null +++ b/scripts/distribution/generic/package.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +dockerfile_name="package" +dockerfile="" +. ./scripts/distribution/generic/parameters.sh + +if [ -n "$dockerfile" ]; then + echo "Packaging LIGO for $target" + echo "Using Dockerfile: $dockerfile" + echo "Using pre-built image: $tag_build" + echo "Version: $version\n" + + # Build the package + docker build --build-arg targetBuildImage="$tag_build" --build-arg version="$version" -t "$tag_package" -f "$dockerfile" . + # Copy the package to host's (our own) file system + mkdir -p "$PWD/dist/package/$target" + docker run -v $PWD:$PWD "$tag_package" cp -r /package/dist/. "$PWD/dist/package/$target" +else + echo "Dockerfile not found for target: $target" +fi \ No newline at end of file diff --git a/scripts/distribution/generic/parameters.sh b/scripts/distribution/generic/parameters.sh new file mode 100644 index 000000000..436b48bf0 --- /dev/null +++ b/scripts/distribution/generic/parameters.sh @@ -0,0 +1,32 @@ +# This script accepts three arguments, os family, os and it's version, +# which are subsequently used to fetch the respective docker +# image from the ocaml/infrastructure project. +# +# https://github.com/ocaml/infrastructure/wiki/Containers#selecting-linux-distributions +target_os_family=$1 +target_os=$2 +target_os_version=$3 + +# Variables configured at the CI level +dist="$LIGO_DIST_DIR" +version="$(echo $CI_JOB_ID)-$(echo $CI_COMMIT_SHORT_SHA)" +ci_job_id="$CI_JOB_ID" + +# Image names for building & packaging +target="$target_os-$target_os_version" +tag_build="$LIGO_REGISTRY_IMAGE_BASE_NAME-build-$target:$version" +tag_package="$LIGO_REGISTRY_IMAGE_BASE_NAME-package-$target:$version" +tag_package_dockerized="$LIGO_REGISTRY_IMAGE_BASE_NAME-$target:$version" + + +# Check if there's a specific dockerfile override for +# the current target_os_family (e.g. debian-ish distros) or target_os (ubuntu, xubuntu, ...) and use it if there is one +target_os_family_specific_dockerfile="./docker/distribution/$target_os_family/$dockerfile_name.Dockerfile" +if test -f "$target_os_family_specific_dockerfile"; then + dockerfile="$target_os_family_specific_dockerfile" +fi + +target_os_specific_dockerfile="./docker/distribution/$target_os_family/$target_os/$dockerfile_name.Dockerfile" +if test -f "$target_os_specific_dockerfile"; then + dockerfile="$target_os_specific_dockerfile" +fi \ No newline at end of file From 804281b206ee25092a23774554f467666f370a78 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Tue, 1 Oct 2019 09:21:01 -0500 Subject: [PATCH 02/25] Copy debian packages into gitlab-pages --- .gitlab-ci.yml | 3 +++ gitlab-pages/docs/setup/installation.md | 12 +++++++++--- gitlab-pages/website/static/deb/.gitignore | 1 + scripts/distribution/generic/package.sh | 4 ++-- 4 files changed, 15 insertions(+), 5 deletions(-) create mode 100644 gitlab-pages/website/static/deb/.gitignore diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 19e5d7f6a..9589ea238 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -43,6 +43,9 @@ stages: # build with odoc - dune build @doc + # copy .deb packages into website + - find dist -name \*.deb -exec sh -c 'cp {} gitlab-pages/website/static/deb/ligo_$(basename $(dirname {})).deb' \; + # npm - cd gitlab-pages/website - npm install diff --git a/gitlab-pages/docs/setup/installation.md b/gitlab-pages/docs/setup/installation.md index c9b5c5503..e607b3c32 100644 --- a/gitlab-pages/docs/setup/installation.md +++ b/gitlab-pages/docs/setup/installation.md @@ -3,7 +3,7 @@ id: installation title: Installation --- -There are currently two ways to get started with Ligo, both of those will allow you to use the Ligo CLI with your contracts. You can choose to use either a Docker image, or to compile & build the Ligo CLI yourself. +There are currently two ways to get started with Ligo. You can choose to either use a Docker image, or to install packages for your Debian Linux distribution. ## Dockerized installation (recommended) @@ -38,6 +38,12 @@ ligo --help ``` -## Manual installation (advanced) +## Debian Linux package installation + +We have produced .deb packages for a few Debian Linuxes. They will install a global `ligo` executable. You can install them in the usual way. + +- [Ubuntu 18.04](/deb/ligo_ubuntu-18.04.deb) +- [Ubuntu 19.04](/deb/ligo_ubuntu-19.04.deb) +- [Debian 9](/deb/ligo_debian-9.deb) +- [Debian 10](/deb/ligo_debian-10.deb) -For now, please refer to the steps described in the [Dockerfile](https://gitlab.com/ligolang/ligo/blob/master/docker/Dockerfile). \ No newline at end of file diff --git a/gitlab-pages/website/static/deb/.gitignore b/gitlab-pages/website/static/deb/.gitignore new file mode 100644 index 000000000..72e8ffc0d --- /dev/null +++ b/gitlab-pages/website/static/deb/.gitignore @@ -0,0 +1 @@ +* diff --git a/scripts/distribution/generic/package.sh b/scripts/distribution/generic/package.sh index b00b61841..79be37d41 100755 --- a/scripts/distribution/generic/package.sh +++ b/scripts/distribution/generic/package.sh @@ -14,7 +14,7 @@ if [ -n "$dockerfile" ]; then docker build --build-arg targetBuildImage="$tag_build" --build-arg version="$version" -t "$tag_package" -f "$dockerfile" . # Copy the package to host's (our own) file system mkdir -p "$PWD/dist/package/$target" - docker run -v $PWD:$PWD "$tag_package" cp -r /package/dist/. "$PWD/dist/package/$target" + docker run --entrypoint '/bin/sh' -v $PWD:$PWD "$tag_package" -c "cp -r /package/dist/. $PWD/dist/package/$target" else echo "Dockerfile not found for target: $target" -fi \ No newline at end of file +fi From d59cd771c9c590652ea298f7349ba25659aab5ed Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 8 Oct 2019 16:41:47 +0200 Subject: [PATCH 03/25] fix unsupported deep_map assignements and remove. add tests --- src/passes/2-simplify/pascaligo.ml | 54 +++++++++++------------------- src/test/contracts/map.ligo | 7 ++++ src/test/contracts/map.mligo | 8 ++++- src/test/integration_tests.ml | 5 +++ 4 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 9dc303e3c..6071da798 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -109,17 +109,6 @@ module Errors = struct ] in error ~data title message - let unsupported_deep_map_assign v = - let title () = "map assignments" in - let message () = - Format.asprintf "assignments to embedded maps are not \ - supported yet" in - let data = [ - ("lhs_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ v.Region.region) - ] in - error ~data title message - let unsupported_empty_record_patch record_expr = let title () = "empty record patch" in let message () = @@ -152,18 +141,6 @@ module Errors = struct ] in error ~data title message - let unsupported_deep_map_rm path = - let title () = "binding removals" in - let message () = - Format.asprintf "removal of bindings from embedded maps \ - are not supported yet" in - let data = [ - ("path_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ path.Region.region) - ] in - error ~data title message - - (* let unsupported_set_removal remove = let title () = "set removals" in let message () = @@ -791,13 +768,17 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu ) | MapPath v -> ( let v' = v.value in - let%bind name = match v'.path with - | Name name -> ok name - | _ -> fail @@ unsupported_deep_map_assign v in + let%bind (varname,map,path) = match v'.path with + | Name name -> ok (name.value , e_variable name.value, []) + | Path p -> + let expr = e_variable p.value.struct_name.value in + let (_,p') = simpl_path v'.path in + let accessor = e_accessor expr p' in + ok @@ (p.value.struct_name.value , accessor , p') + in let%bind key_expr = simpl_expression v'.index.value.inside in - let old_expr = e_variable name.value in - let expr' = e_map_add key_expr value_expr old_expr in - return_statement @@ e_assign ~loc name.value [] expr' + let expr' = e_map_add key_expr value_expr map in + return_statement @@ e_assign ~loc varname path expr' ) ) | CaseInstr c -> ( @@ -844,12 +825,17 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | MapRemove r -> ( let (v , loc) = r_split r in let key = v.key in - let%bind map = match v.map with - | Name v -> ok v.value - | Path path -> fail @@ unsupported_deep_map_rm path in + let%bind (varname,map,path) = match v.map with + | Name v -> ok (v.value , e_variable v.value , []) + | Path p -> + let expr = e_variable p.value.struct_name.value in + let (_,p') = simpl_path v.map in + let accessor = e_accessor expr p' in + ok @@ (p.value.struct_name.value , accessor , p') + in let%bind key' = simpl_expression key in - let expr = e_constant ~loc "MAP_REMOVE" [key' ; e_variable map] in - return_statement @@ e_assign ~loc map [] expr + let expr = e_constant ~loc "MAP_REMOVE" [key' ; map] in + return_statement @@ e_assign ~loc varname path expr ) | SetRemove r -> ( let (set_rm, loc) = r_split r in diff --git a/src/test/contracts/map.ligo b/src/test/contracts/map.ligo index 7d843f163..7437cfb26 100644 --- a/src/test/contracts/map.ligo +++ b/src/test/contracts/map.ligo @@ -54,3 +54,10 @@ function map_op (const m : foobar) : foobar is function fold_op (const m : foobar) : int is function aggregate (const i : int ; const j : (int * int)) : int is block { skip } with i + j.0 + j.1 ; block { skip } with map_fold(m , 10 , aggregate) + +function deep_op (var m : foobar) : foobar is +var coco : (int*foobar) := (0, m); +block { + remove 42 from map coco.1 ; + coco.1[32] := 16 ; +} with coco.1 \ No newline at end of file diff --git a/src/test/contracts/map.mligo b/src/test/contracts/map.mligo index 0d6ec9918..094252c0e 100644 --- a/src/test/contracts/map.mligo +++ b/src/test/contracts/map.mligo @@ -28,4 +28,10 @@ let map_op (m : foobar) : foobar = let fold_op (m : foobar) : foobar = let aggregate = fun (i : int) (j : (int * int)) -> i + j.(0) + j.(1) in - Map.fold m 10 aggregate \ No newline at end of file + Map.fold m 10 aggregate + +let deep_op (m : foobar) : foobar = + let coco = (0,m) in + let coco = (0 , Map.remove 42 coco.(1)) in + let coco = (0 , Map.update 32 (Some 16) coco.(1)) in + coco.(1) \ No newline at end of file diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index e68e32d8f..7a50ad29b 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -456,6 +456,11 @@ let map_ type_f path : unit result = let expected = e_int 76 in expect_eq program "fold_op" input expected in + let%bind () = + let input = ez [(2 , 20) ; (42 , 10)] in + let expected = ez [(2 , 20) ; (32 , 16) ] in + expect_eq program "deep_op" input expected + in ok () let big_map_ type_f path : unit result = From 54662db2f63947f337cb4a681ddd7af19f1e7f8d Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 8 Oct 2019 18:02:43 +0200 Subject: [PATCH 04/25] use simpl_projection to build accessor --- src/passes/2-simplify/pascaligo.ml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 6071da798..1b45c8c20 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -771,9 +771,8 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v'.path with | Name name -> ok (name.value , e_variable name.value, []) | Path p -> - let expr = e_variable p.value.struct_name.value in let (_,p') = simpl_path v'.path in - let accessor = e_accessor expr p' in + let%bind accessor = simpl_projection p in ok @@ (p.value.struct_name.value , accessor , p') in let%bind key_expr = simpl_expression v'.index.value.inside in @@ -828,9 +827,8 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v.map with | Name v -> ok (v.value , e_variable v.value , []) | Path p -> - let expr = e_variable p.value.struct_name.value in let (_,p') = simpl_path v.map in - let accessor = e_accessor expr p' in + let%bind accessor = simpl_projection p in ok @@ (p.value.struct_name.value , accessor , p') in let%bind key' = simpl_expression key in From 8c29dc6df3c3dc6d4e3f9bb20c83ad9d1476ecb1 Mon Sep 17 00:00:00 2001 From: Lesenechal Remi Date: Tue, 8 Oct 2019 18:20:32 +0200 Subject: [PATCH 05/25] cleaning (using name return by simpl_path which is equivalent) --- src/passes/2-simplify/pascaligo.ml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 1b45c8c20..3ef036291 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -771,9 +771,9 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v'.path with | Name name -> ok (name.value , e_variable name.value, []) | Path p -> - let (_,p') = simpl_path v'.path in + let (name,p') = simpl_path v'.path in let%bind accessor = simpl_projection p in - ok @@ (p.value.struct_name.value , accessor , p') + ok @@ (name , accessor , p') in let%bind key_expr = simpl_expression v'.index.value.inside in let expr' = e_map_add key_expr value_expr map in @@ -827,9 +827,9 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let%bind (varname,map,path) = match v.map with | Name v -> ok (v.value , e_variable v.value , []) | Path p -> - let (_,p') = simpl_path v.map in + let (name,p') = simpl_path v.map in let%bind accessor = simpl_projection p in - ok @@ (p.value.struct_name.value , accessor , p') + ok @@ (name , accessor , p') in let%bind key' = simpl_expression key in let expr = e_constant ~loc "MAP_REMOVE" [key' ; map] in From bcf73d01bf4a89ae60a1cda70527b9f2665422aa Mon Sep 17 00:00:00 2001 From: Christian Rinderknecht Date: Wed, 9 Oct 2019 16:07:13 +0200 Subject: [PATCH 06/25] Printing of tokens from the AST is now done in a Buffer.t --- src/passes/1-parser/ligodity/ParserLog.ml | 582 ++++++----- src/passes/1-parser/ligodity/ParserLog.mli | 15 +- src/passes/1-parser/ligodity/ParserMain.ml | 6 +- src/passes/1-parser/ligodity/Tests/match.mml | 13 - .../1-parser/pascaligo/.SParserMain.tag | 0 src/passes/1-parser/pascaligo/ParserLog.ml | 984 ++++++++++-------- src/passes/1-parser/pascaligo/ParserLog.mli | 12 +- src/passes/1-parser/pascaligo/ParserMain.ml | 6 +- src/passes/1-parser/pascaligo/SParserMain.ml | 10 +- .../pascaligo/Tests/crowdfunding.ligo | 2 +- src/passes/2-simplify/ligodity.ml | 7 +- src/passes/2-simplify/pascaligo.ml | 13 +- vendors/ligo-utils/simple-utils/PP_helpers.ml | 31 +- 13 files changed, 917 insertions(+), 764 deletions(-) delete mode 100644 src/passes/1-parser/ligodity/Tests/match.mml delete mode 100644 src/passes/1-parser/pascaligo/.SParserMain.tag diff --git a/src/passes/1-parser/ligodity/ParserLog.ml b/src/passes/1-parser/ligodity/ParserLog.ml index 5b594e969..299b2a392 100644 --- a/src/passes/1-parser/ligodity/ParserLog.ml +++ b/src/passes/1-parser/ligodity/ParserLog.ml @@ -8,357 +8,455 @@ open! Region let sprintf = Printf.sprintf let offsets = ref true - let mode = ref `Point let compact (region: Region.t) = region#compact ~offsets:!offsets !mode -let print_nsepseq sep print (head,tail) = +let print_nsepseq buffer sep print (head,tail) = let print_aux ((sep_reg:Region.t), item) = - Printf.printf "%s: %s\n" (compact sep_reg) sep; - print item - in print head; List.iter print_aux tail + let sep_line = sprintf "%s: %s\n" (compact sep_reg) sep + in Buffer.add_string buffer sep_line; + print buffer item + in print buffer head; List.iter print_aux tail -let print_sepseq sep print = function +let print_sepseq buffer sep print = function None -> () -| Some seq -> print_nsepseq sep print seq +| Some seq -> print_nsepseq buffer sep print seq -let print_csv print = print_nsepseq "," print +let print_csv buffer print = print_nsepseq buffer "," print -let print_token (reg: Region.t) conc = - Printf.printf "%s: %s\n" (compact reg) conc +let print_token buffer (reg: Region.t) conc = + let line = sprintf "%s: %s\n" (compact reg) conc + in Buffer.add_string buffer line -let print_var Region.{region; value} = - Printf.printf "%s: Ident %s\n" (compact region) value +let print_var buffer Region.{region; value} = + let line = sprintf "%s: Ident %s\n" (compact region) value + in Buffer.add_string buffer line -let print_uident Region.{region; value} = - Printf.printf "%s: Uident %s\n" (compact region) value +let print_pvar buffer Region.{region; value} = + let line = sprintf "%s: PVar %s\n" (compact region) value + in Buffer.add_string buffer line -let print_str Region.{region; value} = - Printf.printf "%s: Str \"%s\"\n" (compact region) value +let print_uident buffer Region.{region; value} = + let line = sprintf "%s: Uident %s\n" (compact region) value + in Buffer.add_string buffer line -let print_bytes Region.{region; value=lexeme, abstract} = - Printf.printf "%s: Bytes (\"%s\", \"0x%s\")\n" - (compact region) lexeme (Hex.to_string abstract) +let print_str buffer Region.{region; value} = + let line = sprintf "%s: Str \"%s\"\n" (compact region) value + in Buffer.add_string buffer line -let rec print_tokens {decl;eof} = - Utils.nseq_iter print_statement decl; print_token eof "EOF" +let print_bytes buffer Region.{region; value=lexeme, abstract} = + let line = sprintf "%s: Bytes (\"%s\", \"0x%s\")\n" + (compact region) lexeme (Hex.to_string abstract) + in Buffer.add_string buffer line -and print_statement = function +let print_int buffer Region.{region; value=lex,z} = + let line = sprintf "PInt %s (%s)" lex (Z.to_string z) + in print_token buffer region line + +let rec print_tokens buffer {decl;eof} = + Utils.nseq_iter (print_statement buffer) decl; + print_token buffer eof "EOF" + +and print_statement buffer = function Let {value=kwd_let, let_binding; _} -> - print_token kwd_let "let"; - print_let_binding let_binding + print_token buffer kwd_let "let"; + print_let_binding buffer let_binding | LetEntry {value=kwd_let_entry, let_binding; _} -> - print_token kwd_let_entry "let%entry"; - print_let_binding let_binding + print_token buffer kwd_let_entry "let%entry"; + print_let_binding buffer let_binding | TypeDecl {value={kwd_type; name; eq; type_expr}; _} -> - print_token kwd_type "type"; - print_var name; - print_token eq "="; - print_type_expr type_expr + print_token buffer kwd_type "type"; + print_var buffer name; + print_token buffer eq "="; + print_type_expr buffer type_expr -and print_type_expr = function - TProd prod -> print_cartesian prod -| TSum {value; _} -> print_nsepseq "|" print_variant value -| TRecord t -> print_record_type t -| TApp app -> print_type_app app -| TPar par -> print_type_par par -| TAlias var -> print_var var -| TFun t -> print_fun_type t +and print_type_expr buffer = function + TProd prod -> print_cartesian buffer prod +| TSum {value; _} -> print_nsepseq buffer "|" print_variant value +| TRecord t -> print_record_type buffer t +| TApp app -> print_type_app buffer app +| TPar par -> print_type_par buffer par +| TAlias var -> print_var buffer var +| TFun t -> print_fun_type buffer t -and print_fun_type {value; _} = +and print_fun_type buffer {value; _} = let domain, arrow, range = value in - print_type_expr domain; - print_token arrow "->"; - print_type_expr range + print_type_expr buffer domain; + print_token buffer arrow "->"; + print_type_expr buffer range -and print_type_app {value; _} = +and print_type_app buffer {value; _} = let type_constr, type_tuple = value in - print_type_tuple type_tuple; - print_var type_constr + print_type_tuple buffer type_tuple; + print_var buffer type_constr -and print_type_tuple {value; _} = +and print_type_tuple buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_nsepseq "," print_type_expr inside; - print_token rpar ")" + print_token buffer lpar "("; + print_nsepseq buffer "," print_type_expr inside; + print_token buffer rpar ")" -and print_type_par {value={lpar;inside=t;rpar}; _} = - print_token lpar "("; - print_type_expr t; - print_token rpar ")" +and print_type_par buffer {value={lpar;inside=t;rpar}; _} = + print_token buffer lpar "("; + print_type_expr buffer t; + print_token buffer rpar ")" -and print_projection node = +and print_projection buffer node = let {struct_name; selector; field_path} = node in - print_var struct_name; - print_token selector "."; - print_nsepseq "." print_selection field_path + print_var buffer struct_name; + print_token buffer selector "."; + print_nsepseq buffer "." print_selection field_path -and print_selection = function - FieldName id -> print_var id +and print_selection buffer = function + FieldName id -> + print_var buffer id | Component {value; _} -> let {lpar; inside; rpar} = value in let Region.{value=lexeme,z; region} = inside in - print_token lpar "("; - print_token region + print_token buffer lpar "("; + print_token buffer region (sprintf "Int %s (%s)" lexeme (Z.to_string z)); - print_token rpar ")" + print_token buffer rpar ")" -and print_cartesian Region.{value;_} = - print_nsepseq "*" print_type_expr value +and print_cartesian buffer Region.{value;_} = + print_nsepseq buffer "*" print_type_expr value -and print_variant {value = {constr; args}; _} = - print_uident constr; +and print_variant buffer {value = {constr; args}; _} = + print_uident buffer constr; match args with None -> () | Some (kwd_of, cartesian) -> - print_token kwd_of "of"; - print_cartesian cartesian + print_token buffer kwd_of "of"; + print_cartesian buffer cartesian -and print_record_type record_type = - print_injection print_field_decl record_type +and print_record_type buffer record_type = + print_injection buffer print_field_decl record_type -and print_field_decl {value; _} = +and print_field_decl buffer {value; _} = let {field_name; colon; field_type} = value - in print_var field_name; - print_token colon ":"; - print_type_expr field_type + in print_var buffer field_name; + print_token buffer colon ":"; + print_type_expr buffer field_type and print_injection : - 'a.('a -> unit) -> 'a injection reg -> unit = - fun print {value; _} -> + 'a.Buffer.t -> (Buffer.t -> 'a -> unit) -> 'a injection reg -> unit = + fun buffer print {value; _} -> let {opening; elements; terminator; closing} = value in - print_opening opening; - print_sepseq ";" print elements; - print_terminator terminator; - print_closing closing + print_opening buffer opening; + print_sepseq buffer ";" print elements; + print_terminator buffer terminator; + print_closing buffer closing -and print_opening = function - Begin region -> print_token region "begin" -| With region -> print_token region "with" -| LBrace region -> print_token region "{" -| LBracket region -> print_token region "[" +and print_opening buffer = function + Begin region -> print_token buffer region "begin" +| With region -> print_token buffer region "with" +| LBrace region -> print_token buffer region "{" +| LBracket region -> print_token buffer region "[" -and print_closing = function - End region -> print_token region "end" -| RBrace region -> print_token region "}" -| RBracket region -> print_token region "]" +and print_closing buffer = function + End region -> print_token buffer region "end" +| RBrace region -> print_token buffer region "}" +| RBracket region -> print_token buffer region "]" -and print_terminator = function - Some semi -> print_token semi ";" +and print_terminator buffer = function + Some semi -> print_token buffer semi ";" | None -> () -and print_let_binding {bindings; lhs_type; eq; let_rhs} = - List.iter print_pattern bindings; - (match lhs_type with - None -> () - | Some (colon, type_expr) -> - print_token colon ":"; - print_type_expr type_expr); - (print_token eq "="; print_expr let_rhs) +and print_let_binding buffer {bindings; lhs_type; eq; let_rhs} = + let () = List.iter (print_pattern buffer) bindings in + let () = + match lhs_type with + None -> () + | Some (colon, type_expr) -> + print_token buffer colon ":"; + print_type_expr buffer type_expr in + let () = print_token buffer eq "=" + in print_expr buffer let_rhs -and print_pattern = function - PTuple {value=patterns;_} -> print_csv print_pattern patterns -| PList p -> print_list_pattern p -| PVar {region; value} -> - Printf.printf "%s: PVar %s\n" (compact region) value +and print_pattern buffer = function + PTuple {value=patterns;_} -> + print_csv buffer print_pattern patterns +| PList p -> + print_list_pattern buffer p +| PVar v -> + print_pvar buffer v | PUnit {value=lpar,rpar; _} -> - print_token lpar "("; print_token rpar ")" -| PInt {region; value=lex,z} -> - print_token region (sprintf "PInt %s (%s)" lex (Z.to_string z)) -| PTrue kwd_true -> print_token kwd_true "true" -| PFalse kwd_false -> print_token kwd_false "false" -| PString s -> print_str s -| PWild wild -> print_token wild "_" + print_token buffer lpar "("; + print_token buffer rpar ")" +| PInt i -> + print_int buffer i +| PTrue kwd_true -> + print_token buffer kwd_true "true" +| PFalse kwd_false -> + print_token buffer kwd_false "false" +| PString s -> + print_str buffer s +| PWild wild -> + print_token buffer wild "_" | PPar {value={lpar;inside=p;rpar}; _} -> - print_token lpar "("; print_pattern p; print_token rpar ")" -| PConstr p -> print_constr_pattern p -| PRecord r -> print_record_pattern r -| PTyped t -> print_typed_pattern t + print_token buffer lpar "("; + print_pattern buffer p; + print_token buffer rpar ")" +| PConstr p -> + print_constr_pattern buffer p +| PRecord r -> + print_record_pattern buffer r +| PTyped t -> + print_typed_pattern buffer t -and print_list_pattern = function - Sugar p -> print_injection print_pattern p -| PCons p -> print_raw p +and print_list_pattern buffer = function + Sugar p -> print_injection buffer print_pattern p +| PCons p -> print_raw buffer p -and print_raw {value=p1,c,p2; _} = - print_pattern p1; print_token c "::"; print_pattern p2 +and print_raw buffer {value=p1,c,p2; _} = + print_pattern buffer p1; + print_token buffer c "::"; + print_pattern buffer p2 -and print_typed_pattern {value; _} = +and print_typed_pattern buffer {value; _} = let {pattern; colon; type_expr} = value in - print_pattern pattern; - print_token colon ":"; - print_type_expr type_expr + print_pattern buffer pattern; + print_token buffer colon ":"; + print_type_expr buffer type_expr -and print_record_pattern record_pattern = - print_injection print_field_pattern record_pattern +and print_record_pattern buffer record_pattern = + print_injection buffer print_field_pattern record_pattern -and print_field_pattern {value; _} = +and print_field_pattern buffer {value; _} = let {field_name; eq; pattern} = value in - print_var field_name; - print_token eq "="; - print_pattern pattern + print_var buffer field_name; + print_token buffer eq "="; + print_pattern buffer pattern -and print_constr_pattern {value=constr, p_opt; _} = - print_uident constr; +and print_constr_pattern buffer {value=constr, p_opt; _} = + print_uident buffer constr; match p_opt with None -> () - | Some pattern -> print_pattern pattern + | Some pattern -> print_pattern buffer pattern -and print_expr = function - ELetIn {value;_} -> print_let_in value -| ECond cond -> print_conditional cond -| ETuple {value;_} -> print_csv print_expr value -| ECase {value;_} -> print_match_expr value -| EFun e -> print_fun_expr e +and print_expr buffer = function + ELetIn {value;_} -> print_let_in buffer value +| ECond cond -> print_conditional buffer cond +| ETuple {value;_} -> print_csv buffer print_expr value +| ECase {value;_} -> print_match_expr buffer value +| EFun e -> print_fun_expr buffer e -| EAnnot e -> print_annot_expr e -| ELogic e -> print_logic_expr e -| EArith e -> print_arith_expr e -| EString e -> print_string_expr e +| EAnnot e -> print_annot_expr buffer e +| ELogic e -> print_logic_expr buffer e +| EArith e -> print_arith_expr buffer e +| EString e -> print_string_expr buffer e | ECall {value=f,l; _} -> - print_expr f; Utils.nseq_iter print_expr l -| EVar v -> print_var v -| EProj p -> print_projection p.value + print_expr buffer f; + Utils.nseq_iter (print_expr buffer) l +| EVar v -> + print_var buffer v +| EProj p -> + print_projection buffer p.value | EUnit {value=lpar,rpar; _} -> - print_token lpar "("; print_token rpar ")" -| EBytes b -> print_bytes b + print_token buffer lpar "("; + print_token buffer rpar ")" +| EBytes b -> + print_bytes buffer b | EPar {value={lpar;inside=e;rpar}; _} -> - print_token lpar "("; print_expr e; print_token rpar ")" -| EList e -> print_list_expr e -| ESeq seq -> print_sequence seq -| ERecord e -> print_record_expr e -| EConstr {value=constr,None; _} -> print_uident constr + print_token buffer lpar "("; + print_expr buffer e; + print_token buffer rpar ")" +| EList e -> + print_list_expr buffer e +| ESeq seq -> + print_sequence buffer seq +| ERecord e -> + print_record_expr buffer e +| EConstr {value=constr,None; _} -> + print_uident buffer constr | EConstr {value=(constr, Some arg); _} -> - print_uident constr; print_expr arg + print_uident buffer constr; + print_expr buffer arg -and print_annot_expr {value=e,t; _} = - print_expr e; - print_token Region.ghost ":"; - print_type_expr t +and print_annot_expr buffer {value=e,t; _} = + print_expr buffer e; + print_token buffer Region.ghost ":"; + print_type_expr buffer t -and print_list_expr = function +and print_list_expr buffer = function Cons {value={arg1;op;arg2}; _} -> - print_expr arg1; - print_token op "::"; - print_expr arg2 -| List e -> print_injection print_expr e -(*| Append {value=e1,append,e2; _} -> - print_expr e1; - print_token append "@"; - print_expr e2 *) + print_expr buffer arg1; + print_token buffer op "::"; + print_expr buffer arg2 +| List e -> print_injection buffer print_expr e +(* +| Append {value=e1,append,e2; _} -> + print_expr buffer e1; + print_token buffer append "@"; + print_expr buffer e2 +*) -and print_arith_expr = function +and print_arith_expr buffer = function Add {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "+"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "+"; + print_expr buffer arg2 | Sub {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "-"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "-"; + print_expr buffer arg2 | Mult {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "*"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "*"; + print_expr buffer arg2 | Div {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "/"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "/"; + print_expr buffer arg2 | Mod {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "mod"; print_expr arg2 -| Neg {value={op;arg}; _} -> print_token op "-"; print_expr arg + print_expr buffer arg1; + print_token buffer op "mod"; + print_expr buffer arg2 +| Neg {value={op;arg}; _} -> + print_token buffer op "-"; + print_expr buffer arg | Int {region; value=lex,z} -> - print_token region (sprintf "Int %s (%s)" lex (Z.to_string z)) + let line = sprintf "Int %s (%s)" lex (Z.to_string z) + in print_token buffer region line | Mtz {region; value=lex,z} -> - print_token region (sprintf "Mtz %s (%s)" lex (Z.to_string z)) + let line = sprintf "Mtz %s (%s)" lex (Z.to_string z) + in print_token buffer region line | Nat {region; value=lex,z} -> - print_token region (sprintf "Nat %s (%s)" lex (Z.to_string z)) + let line = sprintf "Nat %s (%s)" lex (Z.to_string z) + in print_token buffer region line -and print_string_expr = function +and print_string_expr buffer = function Cat {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "^"; print_expr arg2 -| String s -> print_str s + print_expr buffer arg1; + print_token buffer op "^"; + print_expr buffer arg2 +| String s -> + print_str buffer s -and print_logic_expr = function - BoolExpr e -> print_bool_expr e -| CompExpr e -> print_comp_expr e +and print_logic_expr buffer = function + BoolExpr e -> print_bool_expr buffer e +| CompExpr e -> print_comp_expr buffer e -and print_bool_expr = function +and print_bool_expr buffer = function Or {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "||"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "||"; + print_expr buffer arg2 | And {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "&&"; print_expr arg2 -| Not {value={op;arg}; _} -> print_token op "not"; print_expr arg -| True kwd_true -> print_token kwd_true "true" -| False kwd_false -> print_token kwd_false "false" + print_expr buffer arg1; + print_token buffer op "&&"; + print_expr buffer arg2 +| Not {value={op;arg}; _} -> + print_token buffer op "not"; + print_expr buffer arg +| True kwd_true -> + print_token buffer kwd_true "true" +| False kwd_false -> + print_token buffer kwd_false "false" -and print_comp_expr = function +and print_comp_expr buffer = function Lt {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "<"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "<"; + print_expr buffer arg2 | Leq {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "<="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "<="; + print_expr buffer arg2 | Gt {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op ">"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op ">"; + print_expr buffer arg2 | Geq {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op ">="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op ">="; + print_expr buffer arg2 | Neq {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "<>"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "<>"; + print_expr buffer arg2 | Equal {value={arg1;op;arg2}; _} -> - print_expr arg1; print_token op "="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "="; + print_expr buffer arg2 -and print_record_expr e = - print_injection print_field_assign e +and print_record_expr buffer e = + print_injection buffer print_field_assign e -and print_field_assign {value; _} = +and print_field_assign buffer {value; _} = let {field_name; assignment; field_expr} = value in - print_var field_name; - print_token assignment "="; - print_expr field_expr + print_var buffer field_name; + print_token buffer assignment "="; + print_expr buffer field_expr -and print_sequence seq = print_injection print_expr seq +and print_sequence buffer seq = + print_injection buffer print_expr seq -and print_match_expr expr = +and print_match_expr buffer expr = let {kwd_match; expr; opening; lead_vbar; cases; closing} = expr in - print_token kwd_match "match"; - print_expr expr; - print_opening opening; - print_token_opt lead_vbar "|"; - print_cases cases; - print_closing closing + print_token buffer kwd_match "match"; + print_expr buffer expr; + print_opening buffer opening; + print_token_opt buffer lead_vbar "|"; + print_cases buffer cases; + print_closing buffer closing -and print_token_opt = function +and print_token_opt buffer = function None -> fun _ -> () -| Some region -> print_token region +| Some region -> print_token buffer region -and print_cases {value; _} = - print_nsepseq "|" print_case_clause value +and print_cases buffer {value; _} = + print_nsepseq buffer "|" print_case_clause value -and print_case_clause {value; _} = +and print_case_clause buffer {value; _} = let {pattern; arrow; rhs} = value in - print_pattern pattern; - print_token arrow "->"; - print_expr rhs + print_pattern buffer pattern; + print_token buffer arrow "->"; + print_expr buffer rhs -and print_let_in (bind: let_in) = +and print_let_in buffer (bind: let_in) = let {kwd_let; binding; kwd_in; body} = bind in - print_token kwd_let "let"; - print_let_binding binding; - print_token kwd_in "in"; - print_expr body + print_token buffer kwd_let "let"; + print_let_binding buffer binding; + print_token buffer kwd_in "in"; + print_expr buffer body -and print_fun_expr {value; _} = +and print_fun_expr buffer {value; _} = let {kwd_fun; params; p_annot; arrow; body} = value in - print_token kwd_fun "fun"; - (match p_annot with - None -> List.iter print_pattern params - | Some (colon, type_expr) -> - print_token colon ":"; - print_type_expr type_expr); - print_token arrow "->"; - print_expr body + let () = print_token buffer kwd_fun "fun" in + let () = + match p_annot with + None -> List.iter (print_pattern buffer) params + | Some (colon, type_expr) -> + print_token buffer colon ":"; + print_type_expr buffer type_expr in + let () = + print_token buffer arrow "->" + in print_expr buffer body -and print_conditional {value; _} = - let {kwd_if; test; kwd_then; ifso; kwd_else; ifnot} = value - in print_token ghost "("; - print_token kwd_if "if"; - print_expr test; - print_token kwd_then "then"; - print_expr ifso; - print_token kwd_else "else"; - print_expr ifnot; - print_token ghost ")" +and print_conditional buffer {value; _} = + let {kwd_if; test; kwd_then; + ifso; kwd_else; ifnot} = value in + print_token buffer ghost "("; + print_token buffer kwd_if "if"; + print_expr buffer test; + print_token buffer kwd_then "then"; + print_expr buffer ifso; + print_token buffer kwd_else "else"; + print_expr buffer ifnot; + print_token buffer ghost ")" + +(* Conversion to string *) + +let to_string printer node = + let buffer = Buffer.create 131 in + let () = printer buffer node + in Buffer.contents buffer + +let tokens_to_string = to_string print_tokens +let pattern_to_string = to_string print_pattern +let expr_to_string = to_string print_expr diff --git a/src/passes/1-parser/ligodity/ParserLog.mli b/src/passes/1-parser/ligodity/ParserLog.mli index 23206c686..588197eb3 100644 --- a/src/passes/1-parser/ligodity/ParserLog.mli +++ b/src/passes/1-parser/ligodity/ParserLog.mli @@ -10,13 +10,10 @@ val mode : [`Byte | `Point] ref the AST to be unparsed before printing (those nodes that have been normalised with function [norm_let] and [norm_fun]). *) -val print_tokens : AST.t -> unit +val print_tokens : Buffer.t -> AST.t -> unit +val print_pattern : Buffer.t -> AST.pattern -> unit +val print_expr : Buffer.t -> AST.expr -> unit -(* val print_path : AST.path -> unit *) -val print_pattern : AST.pattern -> unit -val print_expr : AST.expr -> unit -(* val print_instruction : AST.instruction -> unit *) - -(* val print_projection : projection -> unit -val print_pattern : pattern -> unit -val print_expr : expr -> unit *) +val tokens_to_string : AST.t -> string +val pattern_to_string : AST.pattern -> string +val expr_to_string : AST.expr -> string diff --git a/src/passes/1-parser/ligodity/ParserMain.ml b/src/passes/1-parser/ligodity/ParserMain.ml index 1a8913c70..ce1f88edc 100644 --- a/src/passes/1-parser/ligodity/ParserMain.ml +++ b/src/passes/1-parser/ligodity/ParserMain.ml @@ -103,10 +103,12 @@ let () = try let ast = Parser.contract tokeniser buffer in if Utils.String.Set.mem "ast" options.verbose - then begin + then let buffer = Buffer.create 131 in + begin ParserLog.offsets := options.offsets; ParserLog.mode := options.mode; - ParserLog.print_tokens ast + ParserLog.print_tokens buffer ast; + Buffer.output_buffer stdout buffer end with Lexer.Error err -> diff --git a/src/passes/1-parser/ligodity/Tests/match.mml b/src/passes/1-parser/ligodity/Tests/match.mml deleted file mode 100644 index 1665e9f27..000000000 --- a/src/passes/1-parser/ligodity/Tests/match.mml +++ /dev/null @@ -1,13 +0,0 @@ -type storage = int - -type param = - Add of int -| Sub of int - -let%entry main (p : param) storage = - let storage = - storage + - (match p with - Add n -> n - | Sub n -> 0-n) - in (([] : operation list), storage) diff --git a/src/passes/1-parser/pascaligo/.SParserMain.tag b/src/passes/1-parser/pascaligo/.SParserMain.tag deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/passes/1-parser/pascaligo/ParserLog.ml b/src/passes/1-parser/pascaligo/ParserLog.ml index 3be60d699..6cf9ccc3e 100644 --- a/src/passes/1-parser/pascaligo/ParserLog.ml +++ b/src/passes/1-parser/pascaligo/ParserLog.ml @@ -6,675 +6,737 @@ open! Region (* Printing the tokens with their source regions *) -let printf = Printf.printf +let sprintf = Printf.sprintf let offsets = ref true - -let mode = ref `Point +let mode = ref `Point let compact (region: Region.t) = region#compact ~offsets:!offsets !mode let print_nsepseq : - string -> ('a -> unit) -> ('a, Region.t) nsepseq -> unit = - fun sep visit (head, tail) -> + Buffer.t -> string -> (Buffer.t -> 'a -> unit) -> + ('a, Region.t) nsepseq -> unit = + fun buffer sep print (head, tail) -> let print_aux (sep_reg, item) = - printf "%s: %s\n" (compact sep_reg) sep; - visit item - in visit head; List.iter print_aux tail + let sep_line = sprintf "%s: %s\n" (compact sep_reg) sep in + Buffer.add_string buffer sep_line; + print buffer item + in print buffer head; List.iter print_aux tail let print_sepseq : - string -> ('a -> unit) -> ('a, Region.t) sepseq -> unit = - fun sep visit -> function + Buffer.t -> string -> (Buffer.t -> 'a -> unit) -> + ('a, Region.t) sepseq -> unit = + fun buffer sep print -> function None -> () - | Some seq -> print_nsepseq sep visit seq + | Some seq -> print_nsepseq buffer sep print seq -let print_token region lexeme = - printf "%s: %s\n"(compact region) lexeme +let print_token buffer region lexeme = + let line = sprintf "%s: %s\n"(compact region) lexeme + in Buffer.add_string buffer line -let print_var {region; value=lexeme} = - printf "%s: Ident \"%s\"\n" (compact region) lexeme +let print_var buffer {region; value=lexeme} = + let line = sprintf "%s: Ident \"%s\"\n" + (compact region) lexeme + in Buffer.add_string buffer line -let print_constr {region; value=lexeme} = - printf "%s: Constr \"%s\"\n" - (compact region) lexeme +let print_constr buffer {region; value=lexeme} = + let line = sprintf "%s: Constr \"%s\"\n" + (compact region) lexeme + in Buffer.add_string buffer line -let print_string {region; value=lexeme} = - printf "%s: String %s\n" - (compact region) lexeme +let print_string buffer {region; value=lexeme} = + let line = sprintf "%s: String %s\n" + (compact region) lexeme + in Buffer.add_string buffer line -let print_bytes {region; value = lexeme, abstract} = - printf "%s: Bytes (\"%s\", \"0x%s\")\n" - (compact region) lexeme - (Hex.to_string abstract) +let print_bytes buffer {region; value = lexeme, abstract} = + let line = sprintf "%s: Bytes (\"%s\", \"0x%s\")\n" + (compact region) lexeme + (Hex.to_string abstract) + in Buffer.add_string buffer line + +let print_int buffer {region; value = lexeme, abstract} = + let line = sprintf "%s: Int (\"%s\", %s)\n" + (compact region) lexeme + (Z.to_string abstract) + in Buffer.add_string buffer line -let print_int {region; value = lexeme, abstract} = - printf "%s: Int (\"%s\", %s)\n" - (compact region) lexeme - (Z.to_string abstract) (* Main printing function *) -let rec print_tokens ast = +let rec print_tokens buffer ast = let {decl; eof} = ast in - Utils.nseq_iter print_decl decl; - print_token eof "EOF" + Utils.nseq_iter (print_decl buffer) decl; + print_token buffer eof "EOF" -and print_decl = function - TypeDecl decl -> print_type_decl decl -| ConstDecl decl -> print_const_decl decl -| LambdaDecl decl -> print_lambda_decl decl +and print_decl buffer = function + TypeDecl decl -> print_type_decl buffer decl +| ConstDecl decl -> print_const_decl buffer decl +| LambdaDecl decl -> print_lambda_decl buffer decl -and print_const_decl {value; _} = +and print_const_decl buffer {value; _} = let {kwd_const; name; colon; const_type; equal; init; terminator} = value in - print_token kwd_const "const"; - print_var name; - print_token colon ":"; - print_type_expr const_type; - print_token equal "="; - print_expr init; - print_terminator terminator + print_token buffer kwd_const "const"; + print_var buffer name; + print_token buffer colon ":"; + print_type_expr buffer const_type; + print_token buffer equal "="; + print_expr buffer init; + print_terminator buffer terminator -and print_type_decl {value; _} = +and print_type_decl buffer {value; _} = let {kwd_type; name; kwd_is; type_expr; terminator} = value in - print_token kwd_type "type"; - print_var name; - print_token kwd_is "is"; - print_type_expr type_expr; - print_terminator terminator + print_token buffer kwd_type "type"; + print_var buffer name; + print_token buffer kwd_is "is"; + print_type_expr buffer type_expr; + print_terminator buffer terminator -and print_type_expr = function - TProd cartesian -> print_cartesian cartesian -| TSum sum_type -> print_sum_type sum_type -| TRecord record_type -> print_record_type record_type -| TApp type_app -> print_type_app type_app -| TFun type_fun -> print_type_fun type_fun -| TPar par_type -> print_par_type par_type -| TAlias type_alias -> print_var type_alias +and print_type_expr buffer = function + TProd cartesian -> print_cartesian buffer cartesian +| TSum sum_type -> print_sum_type buffer sum_type +| TRecord record_type -> print_record_type buffer record_type +| TApp type_app -> print_type_app buffer type_app +| TFun type_fun -> print_type_fun buffer type_fun +| TPar par_type -> print_par_type buffer par_type +| TAlias type_alias -> print_var buffer type_alias -and print_cartesian {value; _} = - print_nsepseq "*" print_type_expr value +and print_cartesian buffer {value; _} = + print_nsepseq buffer "*" print_type_expr value -and print_variant {value; _} = +and print_variant buffer {value; _} = let {constr; args} = value in - print_constr constr; + print_constr buffer constr; match args with None -> () | Some (kwd_of, product) -> - print_token kwd_of "of"; - print_cartesian product + print_token buffer kwd_of "of"; + print_cartesian buffer product -and print_sum_type {value; _} = - print_nsepseq "|" print_variant value +and print_sum_type buffer {value; _} = + print_nsepseq buffer "|" print_variant value -and print_record_type record_type = - print_injection "record" print_field_decl record_type +and print_record_type buffer record_type = + print_injection buffer "record" print_field_decl record_type -and print_type_app {value; _} = +and print_type_app buffer {value; _} = let type_name, type_tuple = value in - print_var type_name; - print_type_tuple type_tuple + print_var buffer type_name; + print_type_tuple buffer type_tuple -and print_type_fun {value; _} = +and print_type_fun buffer {value; _} = let type_expr_a, arrow, type_expr_b = value in - print_type_expr type_expr_a; - print_token arrow "->"; - print_type_expr type_expr_b + print_type_expr buffer type_expr_a; + print_token buffer arrow "->"; + print_type_expr buffer type_expr_b -and print_par_type {value; _} = +and print_par_type buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_type_expr inside; - print_token rpar ")" + print_token buffer lpar "("; + print_type_expr buffer inside; + print_token buffer rpar ")" -and print_field_decl {value; _} = +and print_field_decl buffer {value; _} = let {field_name; colon; field_type} = value in - print_var field_name; - print_token colon ":"; - print_type_expr field_type + print_var buffer field_name; + print_token buffer colon ":"; + print_type_expr buffer field_type -and print_type_tuple {value; _} = +and print_type_tuple buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_nsepseq "," print_type_expr inside; - print_token rpar ")" + print_token buffer lpar "("; + print_nsepseq buffer "," print_type_expr inside; + print_token buffer rpar ")" -and print_lambda_decl = function - FunDecl fun_decl -> print_fun_decl fun_decl -| ProcDecl proc_decl -> print_proc_decl proc_decl +and print_lambda_decl buffer = function + FunDecl fun_decl -> print_fun_decl buffer fun_decl +| ProcDecl proc_decl -> print_proc_decl buffer proc_decl -and print_fun_decl {value; _} = +and print_fun_decl buffer {value; _} = let {kwd_function; name; param; colon; ret_type; kwd_is; local_decls; block; kwd_with; return; terminator} = value in - print_token kwd_function "function"; - print_var name; - print_parameters param; - print_token colon ":"; - print_type_expr ret_type; - print_token kwd_is "is"; - print_local_decls local_decls; - print_block block; - print_token kwd_with "with"; - print_expr return; - print_terminator terminator + print_token buffer kwd_function "function"; + print_var buffer name; + print_parameters buffer param; + print_token buffer colon ":"; + print_type_expr buffer ret_type; + print_token buffer kwd_is "is"; + print_local_decls buffer local_decls; + print_block buffer block; + print_token buffer kwd_with "with"; + print_expr buffer return; + print_terminator buffer terminator -and print_proc_decl {value; _} = +and print_proc_decl buffer {value; _} = let {kwd_procedure; name; param; kwd_is; local_decls; block; terminator} = value in - print_token kwd_procedure "procedure"; - print_var name; - print_parameters param; - print_token kwd_is "is"; - print_local_decls local_decls; - print_block block; - print_terminator terminator + print_token buffer kwd_procedure "procedure"; + print_var buffer name; + print_parameters buffer param; + print_token buffer kwd_is "is"; + print_local_decls buffer local_decls; + print_block buffer block; + print_terminator buffer terminator -and print_parameters {value; _} = +and print_parameters buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_nsepseq ";" print_param_decl inside; - print_token rpar ")" + print_token buffer lpar "("; + print_nsepseq buffer ";" print_param_decl inside; + print_token buffer rpar ")" -and print_param_decl = function - ParamConst param_const -> print_param_const param_const -| ParamVar param_var -> print_param_var param_var +and print_param_decl buffer = function + ParamConst param_const -> print_param_const buffer param_const +| ParamVar param_var -> print_param_var buffer param_var -and print_param_const {value; _} = +and print_param_const buffer {value; _} = let {kwd_const; var; colon; param_type} = value in - print_token kwd_const "const"; - print_var var; - print_token colon ":"; - print_type_expr param_type + print_token buffer kwd_const "const"; + print_var buffer var; + print_token buffer colon ":"; + print_type_expr buffer param_type -and print_param_var {value; _} = +and print_param_var buffer {value; _} = let {kwd_var; var; colon; param_type} = value in - print_token kwd_var "var"; - print_var var; - print_token colon ":"; - print_type_expr param_type + print_token buffer kwd_var "var"; + print_var buffer var; + print_token buffer colon ":"; + print_type_expr buffer param_type -and print_block {value; _} = +and print_block buffer {value; _} = let {opening; statements; terminator; closing} = value in - print_block_opening opening; - print_statements statements; - print_terminator terminator; - print_block_closing closing + print_block_opening buffer opening; + print_statements buffer statements; + print_terminator buffer terminator; + print_block_closing buffer closing -and print_block_opening = function - Block (kwd_block, lbrace) -> print_token kwd_block "block"; - print_token lbrace "{" -| Begin kwd_begin -> print_token kwd_begin "begin" +and print_block_opening buffer = function + Block (kwd_block, lbrace) -> + print_token buffer kwd_block "block"; + print_token buffer lbrace "{" +| Begin kwd_begin -> + print_token buffer kwd_begin "begin" -and print_block_closing = function - Block rbrace -> print_token rbrace "}" -| End kwd_end -> print_token kwd_end "end" +and print_block_closing buffer = function + Block rbrace -> print_token buffer rbrace "}" +| End kwd_end -> print_token buffer kwd_end "end" -and print_local_decls sequence = - List.iter print_local_decl sequence +and print_local_decls buffer sequence = + List.iter (print_local_decl buffer) sequence -and print_local_decl = function - LocalFun decl -> print_fun_decl decl -| LocalProc decl -> print_proc_decl decl -| LocalData decl -> print_data_decl decl +and print_local_decl buffer = function + LocalFun decl -> print_fun_decl buffer decl +| LocalProc decl -> print_proc_decl buffer decl +| LocalData decl -> print_data_decl buffer decl -and print_data_decl = function - LocalConst decl -> print_const_decl decl -| LocalVar decl -> print_var_decl decl +and print_data_decl buffer = function + LocalConst decl -> print_const_decl buffer decl +| LocalVar decl -> print_var_decl buffer decl -and print_var_decl {value; _} = +and print_var_decl buffer {value; _} = let {kwd_var; name; colon; var_type; assign; init; terminator} = value in - print_token kwd_var "var"; - print_var name; - print_token colon ":"; - print_type_expr var_type; - print_token assign ":="; - print_expr init; - print_terminator terminator + print_token buffer kwd_var "var"; + print_var buffer name; + print_token buffer colon ":"; + print_type_expr buffer var_type; + print_token buffer assign ":="; + print_expr buffer init; + print_terminator buffer terminator -and print_statements sequence = - print_nsepseq ";" print_statement sequence +and print_statements buffer sequence = + print_nsepseq buffer ";" print_statement sequence -and print_statement = function - Instr instr -> print_instruction instr -| Data data -> print_data_decl data +and print_statement buffer = function + Instr instr -> print_instruction buffer instr +| Data data -> print_data_decl buffer data -and print_instruction = function - Single instr -> print_single_instr instr -| Block block -> print_block block +and print_instruction buffer = function + Single instr -> print_single_instr buffer instr +| Block block -> print_block buffer block -and print_single_instr = function - Cond {value; _} -> print_conditional value -| CaseInstr {value; _} -> print_case_instr value -| Assign assign -> print_assignment assign -| Loop loop -> print_loop loop -| ProcCall fun_call -> print_fun_call fun_call -| Skip kwd_skip -> print_token kwd_skip "skip" -| RecordPatch {value; _} -> print_record_patch value -| MapPatch {value; _} -> print_map_patch value -| SetPatch {value; _} -> print_set_patch value -| MapRemove {value; _} -> print_map_remove value -| SetRemove {value; _} -> print_set_remove value +and print_single_instr buffer = function + Cond {value; _} -> print_conditional buffer value +| CaseInstr {value; _} -> print_case_instr buffer value +| Assign assign -> print_assignment buffer assign +| Loop loop -> print_loop buffer loop +| ProcCall fun_call -> print_fun_call buffer fun_call +| Skip kwd_skip -> print_token buffer kwd_skip "skip" +| RecordPatch {value; _} -> print_record_patch buffer value +| MapPatch {value; _} -> print_map_patch buffer value +| SetPatch {value; _} -> print_set_patch buffer value +| MapRemove {value; _} -> print_map_remove buffer value +| SetRemove {value; _} -> print_set_remove buffer value -and print_conditional node = +and print_conditional buffer node = let {kwd_if; test; kwd_then; ifso; terminator; kwd_else; ifnot} = node in - print_token kwd_if "if"; - print_expr test; - print_token kwd_then "then"; - print_if_clause ifso; - print_terminator terminator; - print_token kwd_else "else"; - print_if_clause ifnot + print_token buffer kwd_if "if"; + print_expr buffer test; + print_token buffer kwd_then "then"; + print_if_clause buffer ifso; + print_terminator buffer terminator; + print_token buffer kwd_else "else"; + print_if_clause buffer ifnot -and print_if_clause = function - ClauseInstr instr -> print_instruction instr +and print_if_clause buffer = function + ClauseInstr instr -> print_instruction buffer instr | ClauseBlock {value; _} -> let {lbrace; inside; rbrace} = value in let statements, terminator = inside in - print_token lbrace "{"; - print_statements statements; - print_terminator terminator; - print_token rbrace "}" + print_token buffer lbrace "{"; + print_statements buffer statements; + print_terminator buffer terminator; + print_token buffer rbrace "}" -and print_case_instr (node : instruction case) = +and print_case_instr buffer (node : instruction case) = let {kwd_case; expr; opening; lead_vbar; cases; closing} = node in - print_token kwd_case "case"; - print_expr expr; - print_opening "of" opening; - print_token_opt lead_vbar "|"; - print_cases_instr cases; - print_closing closing + print_token buffer kwd_case "case"; + print_expr buffer expr; + print_opening buffer "of" opening; + print_token_opt buffer lead_vbar "|"; + print_cases_instr buffer cases; + print_closing buffer closing -and print_token_opt = function +and print_token_opt buffer = function None -> fun _ -> () -| Some region -> print_token region +| Some region -> print_token buffer region -and print_cases_instr {value; _} = - print_nsepseq "|" print_case_clause_instr value +and print_cases_instr buffer {value; _} = + print_nsepseq buffer "|" print_case_clause_instr value -and print_case_clause_instr {value; _} = +and print_case_clause_instr buffer {value; _} = let {pattern; arrow; rhs} = value in - print_pattern pattern; - print_token arrow "->"; - print_instruction rhs + print_pattern buffer pattern; + print_token buffer arrow "->"; + print_instruction buffer rhs -and print_assignment {value; _} = +and print_assignment buffer {value; _} = let {lhs; assign; rhs} = value in - print_lhs lhs; - print_token assign ":="; - print_rhs rhs + print_lhs buffer lhs; + print_token buffer assign ":="; + print_rhs buffer rhs -and print_rhs e = print_expr e +and print_rhs buffer e = print_expr buffer e -and print_lhs = function - Path path -> print_path path -| MapPath {value; _} -> print_map_lookup value +and print_lhs buffer = function + Path path -> print_path buffer path +| MapPath {value; _} -> print_map_lookup buffer value -and print_loop = function - While {value; _} -> print_while_loop value -| For for_loop -> print_for_loop for_loop +and print_loop buffer = function + While {value; _} -> print_while_loop buffer value +| For for_loop -> print_for_loop buffer for_loop -and print_while_loop value = +and print_while_loop buffer value = let {kwd_while; cond; block} = value in - print_token kwd_while "while"; - print_expr cond; - print_block block + print_token buffer kwd_while "while"; + print_expr buffer cond; + print_block buffer block -and print_for_loop = function - ForInt for_int -> print_for_int for_int -| ForCollect for_collect -> print_for_collect for_collect +and print_for_loop buffer = function + ForInt for_int -> print_for_int buffer for_int +| ForCollect for_collect -> print_for_collect buffer for_collect -and print_for_int ({value; _} : for_int reg) = +and print_for_int buffer ({value; _} : for_int reg) = let {kwd_for; assign; down; kwd_to; bound; step; block} = value in - print_token kwd_for "for"; - print_var_assign assign; - print_down down; - print_token kwd_to "to"; - print_expr bound; - print_step step; - print_block block + print_token buffer kwd_for "for"; + print_var_assign buffer assign; + print_down buffer down; + print_token buffer kwd_to "to"; + print_expr buffer bound; + print_step buffer step; + print_block buffer block -and print_var_assign {value; _} = +and print_var_assign buffer {value; _} = let {name; assign; expr} = value in - print_var name; - print_token assign ":="; - print_expr expr + print_var buffer name; + print_token buffer assign ":="; + print_expr buffer expr -and print_down = function - Some kwd_down -> print_token kwd_down "down" -| None -> () +and print_down buffer = function + Some kwd_down -> print_token buffer kwd_down "down" +| None -> () -and print_step = function +and print_step buffer = function Some (kwd_step, expr) -> - print_token kwd_step "step"; - print_expr expr + print_token buffer kwd_step "step"; + print_expr buffer expr | None -> () -and print_for_collect ({value; _} : for_collect reg) = +and print_for_collect buffer ({value; _} : for_collect reg) = let {kwd_for; var; bind_to; kwd_in; expr; block} = value in - print_token kwd_for "for"; - print_var var; - print_bind_to bind_to; - print_token kwd_in "in"; - print_expr expr; - print_block block + print_token buffer kwd_for "for"; + print_var buffer var; + print_bind_to buffer bind_to; + print_token buffer kwd_in "in"; + print_expr buffer expr; + print_block buffer block -and print_bind_to = function +and print_bind_to buffer = function Some (arrow, variable) -> - print_token arrow "->"; - print_var variable + print_token buffer arrow "->"; + print_var buffer variable | None -> () -and print_expr = function - ECase {value;_} -> print_case_expr value -| EAnnot {value;_} -> print_annot_expr value -| ELogic e -> print_logic_expr e -| EArith e -> print_arith_expr e -| EString e -> print_string_expr e -| EList e -> print_list_expr e -| ESet e -> print_set_expr e -| EConstr e -> print_constr_expr e -| ERecord e -> print_record_expr e -| EProj e -> print_projection e -| EMap e -> print_map_expr e -| EVar v -> print_var v -| ECall e -> print_fun_call e -| EBytes b -> print_bytes b -| EUnit r -> print_token r "Unit" -| ETuple e -> print_tuple_expr e -| EPar e -> print_par_expr e +and print_expr buffer = function + ECase {value;_} -> print_case_expr buffer value +| EAnnot {value;_} -> print_annot_expr buffer value +| ELogic e -> print_logic_expr buffer e +| EArith e -> print_arith_expr buffer e +| EString e -> print_string_expr buffer e +| EList e -> print_list_expr buffer e +| ESet e -> print_set_expr buffer e +| EConstr e -> print_constr_expr buffer e +| ERecord e -> print_record_expr buffer e +| EProj e -> print_projection buffer e +| EMap e -> print_map_expr buffer e +| EVar v -> print_var buffer v +| ECall e -> print_fun_call buffer e +| EBytes b -> print_bytes buffer b +| EUnit r -> print_token buffer r "Unit" +| ETuple e -> print_tuple_expr buffer e +| EPar e -> print_par_expr buffer e -and print_annot_expr (expr , type_expr) = - print_expr expr ; - print_type_expr type_expr +and print_annot_expr buffer (expr , type_expr) = + print_expr buffer expr; + print_type_expr buffer type_expr -and print_case_expr (node : expr case) = +and print_case_expr buffer (node : expr case) = let {kwd_case; expr; opening; lead_vbar; cases; closing} = node in - print_token kwd_case "case"; - print_expr expr; - print_opening "of" opening; - print_token_opt lead_vbar "|"; - print_cases_expr cases; - print_closing closing + print_token buffer kwd_case "case"; + print_expr buffer expr; + print_opening buffer "of" opening; + print_token_opt buffer lead_vbar "|"; + print_cases_expr buffer cases; + print_closing buffer closing -and print_cases_expr {value; _} = - print_nsepseq "|" print_case_clause_expr value +and print_cases_expr buffer {value; _} = + print_nsepseq buffer "|" print_case_clause_expr value -and print_case_clause_expr {value; _} = +and print_case_clause_expr buffer {value; _} = let {pattern; arrow; rhs} = value in - print_pattern pattern; - print_token arrow "->"; - print_expr rhs + print_pattern buffer pattern; + print_token buffer arrow "->"; + print_expr buffer rhs -and print_map_expr = function - MapLookUp {value; _} -> print_map_lookup value -| MapInj inj -> print_injection "map" print_binding inj +and print_map_expr buffer = function + MapLookUp {value; _} -> print_map_lookup buffer value +| MapInj inj -> print_injection buffer "map" print_binding inj -and print_set_expr = function - SetInj inj -> print_injection "set" print_expr inj -| SetMem mem -> print_set_membership mem +and print_set_expr buffer = function + SetInj inj -> print_injection buffer "set" print_expr inj +| SetMem mem -> print_set_membership buffer mem -and print_set_membership {value; _} = +and print_set_membership buffer {value; _} = let {set; kwd_contains; element} = value in - print_expr set; - print_token kwd_contains "contains"; - print_expr element + print_expr buffer set; + print_token buffer kwd_contains "contains"; + print_expr buffer element -and print_map_lookup {path; index} = +and print_map_lookup buffer {path; index} = let {lbracket; inside; rbracket} = index.value in - print_path path; - print_token lbracket "["; - print_expr inside; - print_token rbracket "]" + print_path buffer path; + print_token buffer lbracket "["; + print_expr buffer inside; + print_token buffer rbracket "]" -and print_path = function - Name var -> print_var var -| Path path -> print_projection path +and print_path buffer = function + Name var -> print_var buffer var +| Path path -> print_projection buffer path -and print_logic_expr = function - BoolExpr e -> print_bool_expr e -| CompExpr e -> print_comp_expr e +and print_logic_expr buffer = function + BoolExpr e -> print_bool_expr buffer e +| CompExpr e -> print_comp_expr buffer e -and print_bool_expr = function +and print_bool_expr buffer = function Or {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "||"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "||"; + print_expr buffer arg2 | And {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "&&"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "&&"; + print_expr buffer arg2 | Not {value = {op; arg}; _} -> - print_token op "not"; print_expr arg -| False region -> print_token region "False" -| True region -> print_token region "True" + print_token buffer op "not"; + print_expr buffer arg +| False region -> + print_token buffer region "False" +| True region -> + print_token buffer region "True" -and print_comp_expr = function +and print_comp_expr buffer = function Lt {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "<"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "<"; + print_expr buffer arg2 | Leq {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "<="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "<="; + print_expr buffer arg2 | Gt {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op ">"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op ">"; + print_expr buffer arg2 | Geq {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op ">="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op ">="; + print_expr buffer arg2 | Equal {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "="; + print_expr buffer arg2 | Neq {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "=/="; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "=/="; + print_expr buffer arg2 -and print_arith_expr = function +and print_arith_expr buffer = function Add {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "+"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "+"; + print_expr buffer arg2 | Sub {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "-"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "-"; + print_expr buffer arg2 | Mult {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "*"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "*"; + print_expr buffer arg2 | Div {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "/"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "/"; + print_expr buffer arg2 | Mod {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "mod"; print_expr arg2 + print_expr buffer arg1; + print_token buffer op "mod"; + print_expr buffer arg2 | Neg {value = {op; arg}; _} -> - print_token op "-"; print_expr arg + print_token buffer op "-"; + print_expr buffer arg | Int i | Nat i -| Mtz i -> print_int i +| Mtz i -> print_int buffer i -and print_string_expr = function +and print_string_expr buffer = function Cat {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "^"; print_expr arg2 -| String s -> print_string s + print_expr buffer arg1; + print_token buffer op "^"; + print_expr buffer arg2 +| String s -> + print_string buffer s -and print_list_expr = function +and print_list_expr buffer = function Cons {value = {arg1; op; arg2}; _} -> - print_expr arg1; print_token op "#"; print_expr arg2 -| List e -> print_injection "list" print_expr e -| Nil e -> print_nil e + print_expr buffer arg1; + print_token buffer op "#"; + print_expr buffer arg2 +| List e -> print_injection buffer "list" print_expr e +| Nil e -> print_nil buffer e -and print_constr_expr = function - SomeApp e -> print_some_app e -| NoneExpr e -> print_none_expr e -| ConstrApp e -> print_constr_app e +and print_constr_expr buffer = function + SomeApp e -> print_some_app buffer e +| NoneExpr e -> print_none_expr buffer e +| ConstrApp e -> print_constr_app buffer e -and print_record_expr e = - print_injection "record" print_field_assign e +and print_record_expr buffer e = + print_injection buffer "record" print_field_assign e -and print_field_assign {value; _} = +and print_field_assign buffer {value; _} = let {field_name; equal; field_expr} = value in - print_var field_name; - print_token equal "="; - print_expr field_expr + print_var buffer field_name; + print_token buffer equal "="; + print_expr buffer field_expr -and print_projection {value; _} = +and print_projection buffer {value; _} = let {struct_name; selector; field_path} = value in - print_var struct_name; - print_token selector "."; - print_field_path field_path + print_var buffer struct_name; + print_token buffer selector "."; + print_field_path buffer field_path -and print_field_path sequence = - print_nsepseq "." print_selection sequence +and print_field_path buffer sequence = + print_nsepseq buffer "." print_selection sequence -and print_selection = function - FieldName name -> print_var name -| Component int -> print_int int +and print_selection buffer = function + FieldName name -> print_var buffer name +| Component int -> print_int buffer int -and print_record_patch node = +and print_record_patch buffer node = let {kwd_patch; path; kwd_with; record_inj} = node in - print_token kwd_patch "patch"; - print_path path; - print_token kwd_with "with"; - print_record_expr record_inj + print_token buffer kwd_patch "patch"; + print_path buffer path; + print_token buffer kwd_with "with"; + print_record_expr buffer record_inj -and print_set_patch node = +and print_set_patch buffer node = let {kwd_patch; path; kwd_with; set_inj} = node in - print_token kwd_patch "patch"; - print_path path; - print_token kwd_with "with"; - print_injection "set" print_expr set_inj + print_token buffer kwd_patch "patch"; + print_path buffer path; + print_token buffer kwd_with "with"; + print_injection buffer "set" print_expr set_inj -and print_map_patch node = +and print_map_patch buffer node = let {kwd_patch; path; kwd_with; map_inj} = node in - print_token kwd_patch "patch"; - print_path path; - print_token kwd_with "with"; - print_injection "map" print_binding map_inj + print_token buffer kwd_patch "patch"; + print_path buffer path; + print_token buffer kwd_with "with"; + print_injection buffer "map" print_binding map_inj -and print_map_remove node = +and print_map_remove buffer node = let {kwd_remove; key; kwd_from; kwd_map; map} = node in - print_token kwd_remove "remove"; - print_expr key; - print_token kwd_from "from"; - print_token kwd_map "map"; - print_path map + print_token buffer kwd_remove "remove"; + print_expr buffer key; + print_token buffer kwd_from "from"; + print_token buffer kwd_map "map"; + print_path buffer map -and print_set_remove node = +and print_set_remove buffer node = let {kwd_remove; element; kwd_from; kwd_set; set} = node in - print_token kwd_remove "remove"; - print_expr element; - print_token kwd_from "from"; - print_token kwd_set "set"; - print_path set + print_token buffer kwd_remove "remove"; + print_expr buffer element; + print_token buffer kwd_from "from"; + print_token buffer kwd_set "set"; + print_path buffer set and print_injection : - 'a.string -> ('a -> unit) -> 'a injection reg -> unit = - fun kwd print {value; _} -> + 'a.Buffer.t -> string -> (Buffer.t -> 'a -> unit) -> + 'a injection reg -> unit = + fun buffer kwd print {value; _} -> let {opening; elements; terminator; closing} = value in - print_opening kwd opening; - print_sepseq ";" print elements; - print_terminator terminator; - print_closing closing + print_opening buffer kwd opening; + print_sepseq buffer ";" print elements; + print_terminator buffer terminator; + print_closing buffer closing -and print_opening lexeme = function - Kwd kwd -> print_token kwd lexeme +and print_opening buffer lexeme = function + Kwd kwd -> + print_token buffer kwd lexeme | KwdBracket (kwd, lbracket) -> - print_token kwd lexeme; - print_token lbracket "{" + print_token buffer kwd lexeme; + print_token buffer lbracket "{" -and print_closing = function - RBracket rbracket -> print_token rbracket "}" -| End kwd_end -> print_token kwd_end "end" +and print_closing buffer = function + RBracket rbracket -> print_token buffer rbracket "}" +| End kwd_end -> print_token buffer kwd_end "end" -and print_binding {value; _} = +and print_binding buffer {value; _} = let {source; arrow; image} = value in - print_expr source; - print_token arrow "->"; - print_expr image + print_expr buffer source; + print_token buffer arrow "->"; + print_expr buffer image -and print_tuple_expr = function - TupleInj inj -> print_tuple_inj inj +and print_tuple_expr buffer = function + TupleInj inj -> print_tuple_inj buffer inj -and print_tuple_inj {value; _} = +and print_tuple_inj buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_nsepseq "," print_expr inside; - print_token rpar ")" + print_token buffer lpar "("; + print_nsepseq buffer "," print_expr inside; + print_token buffer rpar ")" -and print_nil value = - print_token value "nil"; +and print_nil buffer value = print_token buffer value "nil" -and print_none_expr value = - print_token value "None"; +and print_none_expr buffer value = print_token buffer value "None" -and print_fun_call {value; _} = +and print_fun_call buffer {value; _} = let fun_name, arguments = value in - print_var fun_name; - print_tuple_inj arguments + print_var buffer fun_name; + print_tuple_inj buffer arguments -and print_constr_app {value; _} = +and print_constr_app buffer {value; _} = let constr, arguments = value in - print_constr constr; + print_constr buffer constr; match arguments with None -> () - | Some args -> print_tuple_inj args + | Some args -> print_tuple_inj buffer args -and print_some_app {value; _} = +and print_some_app buffer {value; _} = let c_Some, arguments = value in - print_token c_Some "Some"; - print_tuple_inj arguments + print_token buffer c_Some "Some"; + print_tuple_inj buffer arguments -and print_par_expr {value; _} = +and print_par_expr buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_expr inside; - print_token rpar ")" + print_token buffer lpar "("; + print_expr buffer inside; + print_token buffer rpar ")" -and print_pattern = function - PCons {value; _} -> print_nsepseq "#" print_pattern value -| PVar var -> print_var var -| PWild wild -> print_token wild "_" -| PInt i -> print_int i -| PBytes b -> print_bytes b -| PString s -> print_string s -| PUnit region -> print_token region "Unit" -| PFalse region -> print_token region "False" -| PTrue region -> print_token region "True" -| PNone region -> print_token region "None" -| PSome psome -> print_psome psome -| PList pattern -> print_list_pattern pattern -| PTuple ptuple -> print_ptuple ptuple -| PConstr pattern -> print_constr_pattern pattern +and print_pattern buffer = function + PCons {value; _} -> print_nsepseq buffer "#" print_pattern value +| PVar var -> print_var buffer var +| PWild wild -> print_token buffer wild "_" +| PInt i -> print_int buffer i +| PBytes b -> print_bytes buffer b +| PString s -> print_string buffer s +| PUnit region -> print_token buffer region "Unit" +| PFalse region -> print_token buffer region "False" +| PTrue region -> print_token buffer region "True" +| PNone region -> print_token buffer region "None" +| PSome psome -> print_psome buffer psome +| PList pattern -> print_list_pattern buffer pattern +| PTuple ptuple -> print_ptuple buffer ptuple +| PConstr pattern -> print_constr_pattern buffer pattern -and print_constr_pattern {value; _} = +and print_constr_pattern buffer {value; _} = let (constr, args) = value in - print_constr constr; + print_constr buffer constr; match args with None -> () - | Some tuple -> print_ptuple tuple + | Some tuple -> print_ptuple buffer tuple -and print_psome {value; _} = +and print_psome buffer {value; _} = let c_Some, patterns = value in - print_token c_Some "Some"; - print_patterns patterns + print_token buffer c_Some "Some"; + print_patterns buffer patterns -and print_patterns {value; _} = +and print_patterns buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_pattern inside; - print_token rpar ")" + print_token buffer lpar "("; + print_pattern buffer inside; + print_token buffer rpar ")" -and print_list_pattern = function - Sugar sugar -> print_injection "list" print_pattern sugar -| PNil kwd_nil -> print_token kwd_nil "nil" -| Raw raw -> print_raw raw +and print_list_pattern buffer = function + Sugar sugar -> + print_injection buffer "list" print_pattern sugar +| PNil kwd_nil -> + print_token buffer kwd_nil "nil" +| Raw raw -> + print_raw buffer raw -and print_raw {value; _} = +and print_raw buffer {value; _} = let {lpar; inside; rpar} = value in let head, cons, tail = inside in - print_token lpar "("; - print_pattern head; - print_token cons "#"; - print_pattern tail; - print_token rpar ")" + print_token buffer lpar "("; + print_pattern buffer head; + print_token buffer cons "#"; + print_pattern buffer tail; + print_token buffer rpar ")" -and print_ptuple {value; _} = +and print_ptuple buffer {value; _} = let {lpar; inside; rpar} = value in - print_token lpar "("; - print_nsepseq "," print_pattern inside; - print_token rpar ")" + print_token buffer lpar "("; + print_nsepseq buffer "," print_pattern inside; + print_token buffer rpar ")" -and print_terminator = function - Some semi -> print_token semi ";" +and print_terminator buffer = function + Some semi -> print_token buffer semi ";" | None -> () + +(* Conversion to string *) + +let to_string printer node = + let buffer = Buffer.create 131 in + let () = printer buffer node + in Buffer.contents buffer + +let tokens_to_string = to_string print_tokens +let path_to_string = to_string print_path +let pattern_to_string = to_string print_pattern +let instruction_to_string = to_string print_instruction diff --git a/src/passes/1-parser/pascaligo/ParserLog.mli b/src/passes/1-parser/pascaligo/ParserLog.mli index a0db900a2..ad0c3f4f3 100644 --- a/src/passes/1-parser/pascaligo/ParserLog.mli +++ b/src/passes/1-parser/pascaligo/ParserLog.mli @@ -3,8 +3,12 @@ val offsets : bool ref val mode : [`Byte | `Point] ref -val print_tokens : AST.t -> unit +val print_tokens : Buffer.t -> AST.t -> unit +val print_path : Buffer.t -> AST.path -> unit +val print_pattern : Buffer.t -> AST.pattern -> unit +val print_instruction : Buffer.t -> AST.instruction -> unit -val print_path : AST.path -> unit -val print_pattern : AST.pattern -> unit -val print_instruction : AST.instruction -> unit +val tokens_to_string : AST.t -> string +val path_to_string : AST.path -> string +val pattern_to_string : AST.pattern -> string +val instruction_to_string : AST.instruction -> string diff --git a/src/passes/1-parser/pascaligo/ParserMain.ml b/src/passes/1-parser/pascaligo/ParserMain.ml index 14ee99307..70d8a8542 100644 --- a/src/passes/1-parser/pascaligo/ParserMain.ml +++ b/src/passes/1-parser/pascaligo/ParserMain.ml @@ -103,10 +103,12 @@ let () = try let ast = Parser.contract tokeniser buffer in if Utils.String.Set.mem "ast" options.verbose - then begin + then let buffer = Buffer.create 131 in + begin ParserLog.offsets := options.offsets; ParserLog.mode := options.mode; - ParserLog.print_tokens ast + ParserLog.print_tokens buffer ast; + Buffer.output_buffer stdout buffer end with Lexer.Error err -> diff --git a/src/passes/1-parser/pascaligo/SParserMain.ml b/src/passes/1-parser/pascaligo/SParserMain.ml index 64a2bcd96..5b5bf0c75 100644 --- a/src/passes/1-parser/pascaligo/SParserMain.ml +++ b/src/passes/1-parser/pascaligo/SParserMain.ml @@ -105,10 +105,12 @@ let () = try let ast = Parser.contract tokeniser buffer in if Utils.String.Set.mem "ast" options.verbose - then begin - ParserLog.offsets := options.offsets; - ParserLog.mode := options.mode; - ParserLog.print_tokens ast + then let buffer = Buffer.create 131 + in begin + ParserLog.offsets := options.offsets; + ParserLog.mode := options.mode; + ParserLog.print_tokens buffer ast; + Buffer.output_buffer stdout buffer end with Lexer.Error err -> diff --git a/src/passes/1-parser/pascaligo/Tests/crowdfunding.ligo b/src/passes/1-parser/pascaligo/Tests/crowdfunding.ligo index 12e516534..97fe7f15c 100644 --- a/src/passes/1-parser/pascaligo/Tests/crowdfunding.ligo +++ b/src/passes/1-parser/pascaligo/Tests/crowdfunding.ligo @@ -50,6 +50,6 @@ function withdraw (var store : store) : list (operation) * store is operations := list [Transfer (owner, balance)]; }; else failwith ("Below target.") - else fail "Too soon."; + else failwith ("Too soon."); else skip end with (operations, store) diff --git a/src/passes/2-simplify/ligodity.ml b/src/passes/2-simplify/ligodity.ml index 3edfd69c1..92877e722 100644 --- a/src/passes/2-simplify/ligodity.ml +++ b/src/passes/2-simplify/ligodity.ml @@ -121,7 +121,7 @@ module Errors = struct let message () = "" in let data = [ ("expression" , - thunk @@ Format.asprintf "%a" PP_helpers.(printer Parser.Ligodity.ParserLog.print_expr) t) + thunk @@ Parser.Ligodity.ParserLog.expr_to_string t) ] in error ~data title message @@ -751,7 +751,8 @@ and simpl_cases : type a . (Raw.pattern * a) list -> a matching result = let error x = let title () = "Pattern" in let content () = - Format.asprintf "Pattern : %a" (PP_helpers.printer Parser.Ligodity.ParserLog.print_pattern) x in + Printf.sprintf "Pattern : %s" + (Parser.Ligodity.ParserLog.pattern_to_string x) in error title content in let as_variant () = @@ -770,7 +771,7 @@ and simpl_cases : type a . (Raw.pattern * a) list -> a matching result = ok @@ Match_variant constrs in let as_option () = - let aux (x , y) = + let aux (x , y) = let%bind x' = trace (error x) @@ get_constr_opt x diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 9dc303e3c..ff20ea52b 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -175,9 +175,9 @@ module Errors = struct ] in error ~data title message *) - let unsupported_deep_set_rm path = + let unsupported_deep_set_rm path = let title () = "set removals" in - let message () = + let message () = Format.asprintf "removal of members from embedded sets is not supported yet" in let data = [ ("path_loc", @@ -217,7 +217,7 @@ module Errors = struct ("pattern_loc", fun () -> Format.asprintf "%a" Location.pp_lift @@ pattern_loc) ; ("pattern", - fun () -> Format.asprintf "%a" (Simple_utils.PP_helpers.printer Parser.Pascaligo.ParserLog.print_pattern) p) ; + fun () -> Parser.Pascaligo.ParserLog.pattern_to_string p) ] in error ~data title message @@ -261,7 +261,7 @@ module Errors = struct let message () = "" in let data = [ ("instruction", - fun () -> Format.asprintf "%a" PP_helpers.(printer Parser.Pascaligo.ParserLog.print_instruction) t) + fun () -> Parser.Pascaligo.ParserLog.instruction_to_string t) ] in error ~data title message end @@ -855,7 +855,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu let (set_rm, loc) = r_split r in let%bind set = match set_rm.set with | Name v -> ok v.value - | Path path -> fail @@ unsupported_deep_set_rm path in + | Path path -> fail @@ unsupported_deep_set_rm path in let%bind removed' = simpl_expression set_rm.element in let expr = e_constant ~loc "SET_REMOVE" [removed' ; e_variable set] in return_statement @@ e_assign ~loc set [] expr @@ -957,7 +957,8 @@ and simpl_cases : type a . (Raw.pattern * a) list -> a matching result = fun t - let error = let title () = "Pattern" in let content () = - Format.asprintf "Pattern : %a" (PP_helpers.printer Parser.Pascaligo.ParserLog.print_pattern) x in + Printf.sprintf "Pattern : %s" + (Parser.Pascaligo.ParserLog.pattern_to_string x) in error title content in let%bind x' = trace error @@ diff --git a/vendors/ligo-utils/simple-utils/PP_helpers.ml b/vendors/ligo-utils/simple-utils/PP_helpers.ml index 70f6410d1..258bc6af4 100644 --- a/vendors/ligo-utils/simple-utils/PP_helpers.ml +++ b/vendors/ligo-utils/simple-utils/PP_helpers.ml @@ -1,17 +1,28 @@ open Format + let string : formatter -> string -> unit = fun ppf s -> fprintf ppf "%s" s + let tag tag : formatter -> unit -> unit = fun ppf () -> fprintf ppf tag + let bool ppf b = fprintf ppf "%b" b + let pair f g ppf (a , b) = fprintf ppf "%a , %a" f a g b + let new_line : formatter -> unit -> unit = tag "@;" + let rec new_lines n ppf () = match n with | 0 -> new_line ppf () | n -> new_line ppf () ; new_lines (n-1) ppf () + let const const : formatter -> unit -> unit = fun ppf () -> fprintf ppf "%s" const + let comment : formatter -> string -> unit = fun ppf s -> fprintf ppf "(* %s *)" s + let list_sep value separator = pp_print_list ~pp_sep:separator value + let list value = pp_print_list ~pp_sep:(tag "") value + let ne_list_sep value separator ppf (hd, tl) = value ppf hd ; separator ppf () ; @@ -35,25 +46,11 @@ let int = fun ppf n -> fprintf ppf "%d" n let map = fun f pp ppf x -> pp ppf (f x) -let pair_sep value sep ppf (a, b) = fprintf ppf "%a %s %a" value a sep value b +let pair_sep value sep ppf (a, b) = + fprintf ppf "%a %s %a" value a sep value b + let smap_sep value sep ppf m = let module SMap = X_map.String in let lst = SMap.to_kv_list m in let new_pp ppf (k, v) = fprintf ppf "%s -> %a" k value v in fprintf ppf "%a" (list_sep new_pp sep) lst - -(* TODO: remove all uses. this is bad. *) -let printer : ('a -> unit) -> _ -> 'a -> unit = fun f ppf x -> - let oldstdout = Unix.dup Unix.stdout in - let name = "/tmp/wtf-" ^ (string_of_int @@ Random.bits ()) in - let newstdout = open_out name in - Unix.dup2 (Unix.descr_of_out_channel newstdout) Unix.stdout; - f x; - flush stdout; - Unix.dup2 oldstdout Unix.stdout; - let ic = open_in name in - let n = in_channel_length ic in - let s = Bytes.create n in - really_input ic s 0 n; - close_in ic; - fprintf ppf "%s" (Bytes.to_string s) From e8afba9581a03f900cbf5d375be9882bd788cedf Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 27 Sep 2019 11:33:32 -0500 Subject: [PATCH 07/25] Accept fake values for SENDER/SOURCE in dry-run --- src/bin/cli.ml | 61 +++++++++++++++++++++++----------- src/main/run/of_source.ml | 69 +++++++++++++++++++++++---------------- 2 files changed, 82 insertions(+), 48 deletions(-) diff --git a/src/bin/cli.ml b/src/bin/cli.ml index 31e9261ab..3ff01bd1e 100644 --- a/src/bin/cli.ml +++ b/src/bin/cli.ml @@ -6,7 +6,7 @@ let main = let term = Term.(const print_endline $ const "Ligo needs a command. Do ligo --help") in (term , Term.info "ligo") -let source n = +let source_file n = let open Arg in let info = let docv = "SOURCE_FILE" in @@ -53,6 +53,22 @@ let amount = info ~docv ~doc ["amount"] in value @@ opt string "0" info +let sender = + let open Arg in + let info = + let docv = "SENDER" in + let doc = "$(docv) is the sender the dry-run transaction will use." in + info ~docv ~doc ["sender"] in + value @@ opt (some string) None info + +let source = + let open Arg in + let info = + let docv = "SOURCE" in + let doc = "$(docv) is the source the dry-run transaction will use." in + info ~docv ~doc ["source"] in + value @@ opt (some string) None info + let display_format = let open Arg in let info = @@ -70,83 +86,90 @@ let michelson_code_format = value @@ opt string "michelson" info let compile_file = - let f source entry_point syntax display_format michelson_format = + let f source_file entry_point syntax display_format michelson_format = toplevel ~display_format @@ let%bind michelson_format = Main.Display.michelson_format_of_string michelson_format in let%bind contract = trace (simple_info "compiling contract to michelson") @@ - Ligo.Compile.Of_source.compile_file_contract_entry source entry_point (Syntax_name syntax) in + Ligo.Compile.Of_source.compile_file_contract_entry source_file entry_point (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" (Main.Display.michelson_pp michelson_format) contract in let term = - Term.(const f $ source 0 $ entry_point 1 $ syntax $ display_format $ michelson_code_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ syntax $ display_format $ michelson_code_format) in let cmdname = "compile-contract" in let docs = "Subcommand: compile a contract. See `ligo " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in (term , Term.info ~docs cmdname) let compile_parameter = - let f source entry_point expression syntax display_format = + let f source_file entry_point expression syntax display_format = toplevel ~display_format @@ let%bind value = trace (simple_error "compile-input") @@ - Ligo.Run.Of_source.compile_file_contract_parameter source entry_point expression (Syntax_name syntax) in + Ligo.Run.Of_source.compile_file_contract_parameter source_file entry_point expression (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" Tezos_utils.Michelson.pp value in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ syntax $ display_format) in let cmdname = "compile-parameter" in let docs = "Subcommand: compile parameters to a michelson expression. The resulting michelson expression can be passed as an argument in a transaction which calls a contract. See `ligo " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in (term , Term.info ~docs cmdname) let compile_storage = - let f source entry_point expression syntax display_format bigmap = + let f source_file entry_point expression syntax display_format bigmap = toplevel ~display_format @@ let%bind value = trace (simple_error "compile-storage") @@ - Ligo.Run.Of_source.compile_file_contract_storage ~value:bigmap source entry_point expression (Syntax_name syntax) in + Ligo.Run.Of_source.compile_file_contract_storage ~value:bigmap source_file entry_point expression (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" Tezos_utils.Michelson.pp value in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ display_format $ bigmap) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "STORAGE" 2 $ syntax $ display_format $ bigmap) in let cmdname = "compile-storage" in let docs = "Subcommand: compile an initial storage in ligo syntax to a michelson expression. The resulting michelson expression can be passed as an argument in a transaction which originates a contract. See `ligo " ^ cmdname ^ " --help' for a list of options specific to this subcommand." in (term , Term.info ~docs cmdname) let dry_run = - let f source entry_point storage input amount syntax display_format bigmap = + let f source_file entry_point storage input amount sender source syntax display_format bigmap = toplevel ~display_format @@ let%bind output = - Ligo.Run.Of_source.run_contract ~amount ~storage_value:bigmap source entry_point storage input (Syntax_name syntax) in + Ligo.Run.Of_source.run_contract + ~options:{ amount ; sender ; source } + ~storage_value:bigmap + source_file entry_point storage input (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression output in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ expression "STORAGE" 3 $ amount $ syntax $ display_format $ bigmap) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ expression "STORAGE" 3 $ amount $ sender $ source $ syntax $ display_format $ bigmap) in let cmdname = "dry-run" in let docs = "Subcommand: run a smart-contract with the given storage and input." in (term , Term.info ~docs cmdname) let run_function = - let f source entry_point parameter amount syntax display_format = + let f source_file entry_point parameter amount sender source syntax display_format = toplevel ~display_format @@ let%bind output = - Ligo.Run.Of_source.run_function_entry ~amount source entry_point parameter (Syntax_name syntax) in + Ligo.Run.Of_source.run_function_entry + ~options:{ amount ; sender ; source } + source_file entry_point parameter (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression output in let term = - Term.(const f $ source 0 $ entry_point 1 $ expression "PARAMETER" 2 $ amount $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ expression "PARAMETER" 2 $ amount $ sender $ source $ syntax $ display_format) in let cmdname = "run-function" in let docs = "Subcommand: run a function with the given parameter." in (term , Term.info ~docs cmdname) let evaluate_value = - let f source entry_point amount syntax display_format = + let f source_file entry_point amount sender source syntax display_format = toplevel ~display_format @@ let%bind output = - Ligo.Run.Of_source.evaluate_entry ~amount source entry_point (Syntax_name syntax) in + Ligo.Run.Of_source.evaluate_entry + ~options:{ amount ; sender ; source } + source_file entry_point (Syntax_name syntax) in ok @@ Format.asprintf "%a\n" Ast_simplified.PP.expression output in let term = - Term.(const f $ source 0 $ entry_point 1 $ amount $ syntax $ display_format) in + Term.(const f $ source_file 0 $ entry_point 1 $ amount $ sender $ source $ syntax $ display_format) in let cmdname = "evaluate-value" in let docs = "Subcommand: evaluate a given definition." in (term , Term.info ~docs cmdname) diff --git a/src/main/run/of_source.ml b/src/main/run/of_source.ml index f9a8e776c..7d365f59d 100644 --- a/src/main/run/of_source.ml +++ b/src/main/run/of_source.ml @@ -88,50 +88,61 @@ let compile_file_contract_args = let args = Ast_simplified.e_pair storage_simplified parameter_simplified in Of_simplified.compile_expression ?value args ~env +type dry_run_options = + { amount : string ; + sender : string option ; + source : string option } -let run_contract ?amount ?storage_value source_filename entry_point storage parameter syntax = +let make_dry_run_options (opts : dry_run_options) : Of_michelson.options result = + let open Proto_alpha_utils.Trace in + let open Proto_alpha_utils.Memory_proto_alpha in + let open Protocol.Alpha_context in + let%bind amount = match Tez.of_string opts.amount with + | None -> simple_fail "invalid amount" + | Some amount -> ok amount in + let%bind sender = + match opts.sender with + | None -> ok None + | Some sender -> + let%bind sender = + trace_alpha_tzresult + (simple_error "invalid address") + (Contract.of_b58check sender) in + ok (Some sender) in + let%bind source = + match opts.source with + | None -> ok None + | Some source -> + let%bind source = + trace_alpha_tzresult + (simple_error "invalid source address") + (Contract.of_b58check source) in + ok (Some source) in + ok @@ make_options ~amount ?source:sender ?payer:source () + +let run_contract ~options ?storage_value source_filename entry_point storage parameter syntax = let%bind program = Compile.Of_source.type_file syntax source_filename in let%bind code = Compile.Of_typed.compile_function_entry program entry_point in let%bind args = compile_file_contract_args ?value:storage_value source_filename entry_point storage parameter syntax in - let%bind ex_value_ty = - let options = - let open Proto_alpha_utils.Memory_proto_alpha in - let amount = Option.bind (fun amount -> Protocol.Alpha_context.Tez.of_string amount) amount in - (make_options ?amount ()) - in - Of_michelson.run ~options code args - in + let%bind options = make_dry_run_options options in + let%bind ex_value_ty = Of_michelson.run ~options code args in Compile.Of_simplified.uncompile_typed_program_entry_function_result program entry_point ex_value_ty -let run_function_entry ?amount source_filename entry_point input syntax = +let run_function_entry ~options source_filename entry_point input syntax = let%bind program = Compile.Of_source.type_file syntax source_filename in let%bind code = Compile.Of_typed.compile_function_entry program entry_point in let%bind args = compile_file_expression source_filename entry_point input syntax in - let%bind ex_value_ty = - let options = - let open Proto_alpha_utils.Memory_proto_alpha in - let amount = Option.bind (fun amount -> Protocol.Alpha_context.Tez.of_string amount) amount in - (make_options ?amount ()) - in - Of_michelson.run ~options code args - in + let%bind options = make_dry_run_options options in + let%bind ex_value_ty = Of_michelson.run ~options code args in Compile.Of_simplified.uncompile_typed_program_entry_function_result program entry_point ex_value_ty -let evaluate_entry ?amount source_filename entry_point syntax = +let evaluate_entry ~options source_filename entry_point syntax = let%bind program = Compile.Of_source.type_file syntax source_filename in let%bind code = Compile.Of_typed.compile_expression_as_function_entry program entry_point in - let%bind ex_value_ty = - let options = - let open Proto_alpha_utils.Memory_proto_alpha in - let amount = Option.bind (fun amount -> Protocol.Alpha_context.Tez.of_string amount) amount in - (make_options ?amount ()) - in - Of_michelson.evaluate ~options code - in + let%bind options = make_dry_run_options options in + let%bind ex_value_ty = Of_michelson.evaluate ~options code in Compile.Of_simplified.uncompile_typed_program_entry_expression_result program entry_point ex_value_ty let evaluate_michelson expression syntax = let%bind code = Compile.Of_source.compile_expression_as_function expression syntax in Of_michelson.evaluate_michelson code - - From 2f60c85aa882411811a7085c608c405f8237e747 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Wed, 9 Oct 2019 17:08:58 -0700 Subject: [PATCH 08/25] Add rough draft of set patch functionality --- src/passes/2-simplify/pascaligo.ml | 40 ++++++++++++++++++------------ 1 file changed, 24 insertions(+), 16 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 9dc303e3c..0a0e252d5 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -141,7 +141,7 @@ module Errors = struct ] in error ~data title message - let unsupported_set_patches patch = + (* let unsupported_set_patches patch = let title () = "set patches" in let message () = Format.asprintf "set patches (a.k.a. functional updates) are \ @@ -150,7 +150,7 @@ module Errors = struct ("patch_loc", fun () -> Format.asprintf "%a" Location.pp_lift @@ patch.Region.region) ] in - error ~data title message + error ~data title message *) let unsupported_deep_map_rm path = let title () = "binding removals" in @@ -163,18 +163,6 @@ module Errors = struct ] in error ~data title message - - (* let unsupported_set_removal remove = - let title () = "set removals" in - let message () = - Format.asprintf "removal of elements in a set is not \ - supported yet" in - let data = [ - ("removal_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ remove.Region.region) - ] in - error ~data title message *) - let unsupported_deep_set_rm path = let title () = "set removals" in let message () = @@ -839,8 +827,28 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu ) | MapPatch patch -> fail @@ unsupported_map_patches patch - | SetPatch patch -> - fail @@ unsupported_set_patches patch + | SetPatch patch -> ( + let setp = patch.value in + let (name , access_path) = simpl_path setp.path in + let%bind inj = bind_list + @@ List.map (fun (x:Raw.expr) -> + let%bind e = simpl_expression x + in ok e) + @@ pseq_to_list setp.set_inj.value.elements in + let%bind expr = + let aux = fun (v) -> + e_assign name access_path (e_constant "SET_ADD" [v ; e_variable name]) in + let assigns = List.map aux inj in + match assigns with + | [] -> fail @@ unsupported_empty_record_patch setp.set_inj + | hd :: tl -> ( + let aux acc cur = e_sequence acc cur in + ok @@ List.fold_left aux hd tl + ) + in + return_statement @@ expr + ) + | MapRemove r -> ( let (v , loc) = r_split r in let key = v.key in From c82076281fdacbe1f78a6a725374782d98ab348c Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Wed, 9 Oct 2019 23:13:25 -0700 Subject: [PATCH 09/25] Add test for set patch functionality Resolves LIGO-127 --- src/test/contracts/set_arithmetic.ligo | 5 +++++ src/test/integration_tests.ml | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/test/contracts/set_arithmetic.ligo b/src/test/contracts/set_arithmetic.ligo index 81f9b0d6c..d1b12195f 100644 --- a/src/test/contracts/set_arithmetic.ligo +++ b/src/test/contracts/set_arithmetic.ligo @@ -17,6 +17,11 @@ function remove_op (const s : set(string)) : set(string) is function remove_syntax (var s : set(string)) : set(string) is begin remove "foobar" from set s; end with s +function patch_op (var s: set(string)) : set(string) is + begin patch s with set ["foobar"]; end with s + function mem_op (const s : set(string)) : bool is begin skip end with set_mem("foobar" , s) + + diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index e68e32d8f..3f9c64ced 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -245,6 +245,10 @@ let set_arithmetic () : unit result = expect_eq program "remove_syntax" (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) (e_set [e_string "foo" ; e_string "bar"]) in + let%bind () = + expect_eq program "patch_op" + (e_set [e_string "foo" ; e_string "bar"]) + (e_set [e_string "foo" ; e_string "bar"; e_string "foobar"]) in let%bind () = expect_eq program "mem_op" (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) From 0de17f4b57e6f7ce180b13119ddcbd03967c8590 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 10 Oct 2019 13:35:38 -0700 Subject: [PATCH 10/25] Add empty set patches, add test for empty set patches --- src/passes/2-simplify/pascaligo.ml | 4 ++-- src/test/contracts/set_arithmetic.ligo | 3 +++ src/test/integration_tests.ml | 4 ++++ 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 0a0e252d5..bc29a71d9 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -828,7 +828,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | MapPatch patch -> fail @@ unsupported_map_patches patch | SetPatch patch -> ( - let setp = patch.value in + let (setp, loc) = r_split patch in let (name , access_path) = simpl_path setp.path in let%bind inj = bind_list @@ List.map (fun (x:Raw.expr) -> @@ -840,7 +840,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu e_assign name access_path (e_constant "SET_ADD" [v ; e_variable name]) in let assigns = List.map aux inj in match assigns with - | [] -> fail @@ unsupported_empty_record_patch setp.set_inj + | [] -> ok @@ e_skip ~loc () | hd :: tl -> ( let aux acc cur = e_sequence acc cur in ok @@ List.fold_left aux hd tl diff --git a/src/test/contracts/set_arithmetic.ligo b/src/test/contracts/set_arithmetic.ligo index d1b12195f..1a8e3550f 100644 --- a/src/test/contracts/set_arithmetic.ligo +++ b/src/test/contracts/set_arithmetic.ligo @@ -20,6 +20,9 @@ function remove_syntax (var s : set(string)) : set(string) is function patch_op (var s: set(string)) : set(string) is begin patch s with set ["foobar"]; end with s +function patch_op_empty (var s: set(string)) : set(string) is + begin patch s with set []; end with s + function mem_op (const s : set(string)) : bool is begin skip end with set_mem("foobar" , s) diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 3f9c64ced..e82a1b6cd 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -249,6 +249,10 @@ let set_arithmetic () : unit result = expect_eq program "patch_op" (e_set [e_string "foo" ; e_string "bar"]) (e_set [e_string "foo" ; e_string "bar"; e_string "foobar"]) in + let%bind () = + expect_eq program "patch_op_empty" + (e_set [e_string "foo" ; e_string "bar"]) + (e_set [e_string "foo" ; e_string "bar"]) in let%bind () = expect_eq program "mem_op" (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) From c181ec1cac9a2f5e7e4a2a964b257ebfea15f34c Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 10 Oct 2019 18:26:28 -0700 Subject: [PATCH 11/25] Upload rough draft of map patch functionality with test Right now I'm concerned that the way this generates the code is inefficient, in particular this line: `in ok @@ (access_path, key', value', loc)` Since the comments [on my code for the set patch](https://gitlab.com/ligolang/ligo/merge_requests/127) warned that repeated generation of the access path is a bad idea(?). In any case this does work, so it's something I can improve on. --- src/passes/2-simplify/pascaligo.ml | 32 ++++++++++++++++++++++++++---- src/test/contracts/map.ligo | 6 +++++- src/test/contracts/map.mligo | 5 ++++- src/test/integration_tests.ml | 5 +++++ 4 files changed, 42 insertions(+), 6 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 095ab6ac5..a2c43d0ee 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -119,7 +119,7 @@ module Errors = struct ] in error ~data title message - let unsupported_map_patches patch = + (* let unsupported_map_patches patch = let title () = "map patches" in let message () = Format.asprintf "map patches (a.k.a. functional updates) are \ @@ -128,7 +128,7 @@ module Errors = struct ("patch_loc", fun () -> Format.asprintf "%a" Location.pp_lift @@ patch.Region.region) ] in - error ~data title message + error ~data title message *) let unsupported_set_patches patch = let title () = "set patches" in @@ -817,8 +817,32 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu in return_statement @@ expr ) - | MapPatch patch -> - fail @@ unsupported_map_patches patch + | MapPatch patch -> ( + let (map_p, loc) = r_split patch in + let (name, access_path) = simpl_path map_p.path in + let%bind inj = bind_list + @@ List.map (fun (x:Raw.binding Region.reg) -> + let (x , loc) = r_split x in + let (key, value) = x.source, x.image in + let%bind key' = simpl_expression key in + let%bind value' = simpl_expression value + in ok @@ (access_path, key', value', loc) + ) + @@ pseq_to_list map_p.map_inj.value.elements in + let%bind expr = + let aux = fun (access, key, value, loc) -> + let map = e_variable name in + e_assign ~loc name access (e_map_add key value map) in + let assigns = List.map aux inj in + match assigns with + | [] -> ok @@ e_skip ~loc () + | hd :: tl -> ( + let aux acc cur = e_sequence acc cur in + ok @@ List.fold_left aux hd tl + ) + in + return_statement @@ expr + ) | SetPatch patch -> fail @@ unsupported_set_patches patch | MapRemove r -> ( diff --git a/src/test/contracts/map.ligo b/src/test/contracts/map.ligo index 7437cfb26..71be5dc20 100644 --- a/src/test/contracts/map.ligo +++ b/src/test/contracts/map.ligo @@ -25,6 +25,10 @@ function rm (var m : foobar) : foobar is block { remove 42 from map m } with m +function patch_ (var m: foobar) : foobar is block { + patch m with map [0 -> 5; 1 -> 6; 2 -> 7] +} with m + function size_ (const m : foobar) : nat is block {skip} with (size(m)) @@ -60,4 +64,4 @@ var coco : (int*foobar) := (0, m); block { remove 42 from map coco.1 ; coco.1[32] := 16 ; -} with coco.1 \ No newline at end of file +} with coco.1 diff --git a/src/test/contracts/map.mligo b/src/test/contracts/map.mligo index 094252c0e..88089d985 100644 --- a/src/test/contracts/map.mligo +++ b/src/test/contracts/map.mligo @@ -11,6 +11,9 @@ let set_ (n : int) (m : foobar) : foobar = let rm (m : foobar) : foobar = Map.remove 42 m +(* Dummy test so that we can add the same test for PascaLIGO *) +let patch_ (m : foobar) : foobar = Map.literal [ (0, 5) ; (1, 6) ; (2, 7) ] + let size_ (m : foobar) : nat = Map.size m let gf (m : foobar) : int = Map.find 23 m @@ -34,4 +37,4 @@ let deep_op (m : foobar) : foobar = let coco = (0,m) in let coco = (0 , Map.remove 42 coco.(1)) in let coco = (0 , Map.update 32 (Some 16) coco.(1)) in - coco.(1) \ No newline at end of file + coco.(1) diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 7a50ad29b..7e9f5c3b1 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -411,6 +411,11 @@ let map_ type_f path : unit result = let expected = ez [23, 23] in expect_eq program "rm" input expected in + let%bind () = + let input = ez [(0,0) ; (1,1) ; (2,2)] in + let expected = ez [(0, 5) ; (1, 6) ; (2, 7)] in + expect_eq program "patch_" input expected + in let%bind () = let make_input = fun n -> ez List.(map (fun x -> (x, x)) @@ range n) in let make_expected = e_nat in From 49ffe00466939ca2641b52583a913a128d9c12f8 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Thu, 10 Oct 2019 18:35:39 -0700 Subject: [PATCH 12/25] Remove unsupported_map_patch error in PascaLIGO simplifier --- src/passes/2-simplify/pascaligo.ml | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index a2c43d0ee..dfa37bd0f 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -119,17 +119,6 @@ module Errors = struct ] in error ~data title message - (* let unsupported_map_patches patch = - let title () = "map patches" in - let message () = - Format.asprintf "map patches (a.k.a. functional updates) are \ - not supported yet" in - let data = [ - ("patch_loc", - fun () -> Format.asprintf "%a" Location.pp_lift @@ patch.Region.region) - ] in - error ~data title message *) - let unsupported_set_patches patch = let title () = "set patches" in let message () = From 047065f8eeeb63a8416e9fb83d996ec2cbd1ae8e Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 15:12:07 +0000 Subject: [PATCH 13/25] Delete vestigial local repo stuff --- index.tar.gz | Bin 9735 -> 0 bytes packages/bip39/bip39.dev/opam | 29 --------- packages/blake2/blake2.dev/opam | 24 -------- packages/hacl/hacl.dev/opam | 28 --------- packages/irmin-lmdb/irmin-lmdb.dev/opam | 27 --------- .../ledgerwallet-tezos.dev/opam | 22 ------- packages/ledgerwallet/ledgerwallet.dev/opam | 24 -------- packages/ligo/ligo.dev/opam | 29 --------- packages/lmdb/lmdb.dev/opam | 23 ------- .../michelson-parser.dev/opam | 21 ------- .../ocplib-ezresto-directory.dev/opam | 28 --------- .../ocplib-ezresto/ocplib-ezresto.dev/opam | 28 --------- .../ocplib-json-typed-browser.dev/opam | 25 -------- .../ocplib-json-typed-bson.dev/opam | 25 -------- .../ocplib-json-typed.dev/opam | 24 -------- .../ocplib-resto-cohttp.dev/opam | 28 --------- .../ocplib-resto-directory.dev/opam | 29 --------- .../ocplib-resto-json.dev/opam | 28 --------- packages/ocplib-resto/ocplib-resto.dev/opam | 27 --------- packages/pbkdf/pbkdf.dev/opam | 27 --------- .../proto-alpha-utils.dev/opam | 56 ------------------ packages/secp256k1/secp256k1.dev/opam | 22 ------- packages/simple-utils/simple-utils.dev/opam | 54 ----------------- .../tezos-accuser-alpha-commands.dev/opam | 29 --------- .../tezos-accuser-alpha.dev/opam | 25 -------- .../tezos-baker-alpha-commands.dev/opam | 29 --------- .../tezos-baker-alpha.dev/opam | 25 -------- .../tezos-baking-alpha-commands.dev/opam | 29 --------- .../tezos-baking-alpha.dev/opam | 34 ----------- packages/tezos-base/tezos-base.dev/opam | 34 ----------- packages/tezos-clic/tezos-clic.dev/opam | 25 -------- .../tezos-client-alpha-commands.dev/opam | 27 --------- .../tezos-client-alpha.dev/opam | 26 -------- .../tezos-client-base-unix.dev/opam | 29 --------- .../tezos-client-base.dev/opam | 31 ---------- .../tezos-client-commands.dev/opam | 28 --------- .../tezos-client-demo.dev/opam | 29 --------- .../tezos-client-genesis.dev/opam | 29 --------- packages/tezos-client/tezos-client.dev/opam | 35 ----------- packages/tezos-crypto/tezos-crypto.dev/opam | 35 ----------- .../tezos-data-encoding.dev/opam | 30 ---------- .../tezos-embedded-protocol-alpha.dev/opam | 29 --------- .../tezos-embedded-protocol-demo.dev/opam | 28 --------- .../tezos-embedded-protocol-genesis.dev/opam | 28 --------- .../tezos-endorser-alpha-commands.dev/opam | 29 --------- .../tezos-endorser-alpha.dev/opam | 25 -------- .../tezos-error-monad.dev/opam | 26 -------- .../tezos-memory-proto-alpha.dev/opam | 22 ------- .../tezos-micheline/tezos-micheline.dev/opam | 27 --------- packages/tezos-node/tezos-node.dev/opam | 35 ----------- packages/tezos-p2p/tezos-p2p.dev/opam | 27 --------- .../tezos-protocol-alpha.dev/opam | 33 ----------- .../tezos-protocol-compiler.dev/opam | 31 ---------- .../tezos-protocol-demo.dev/opam | 27 --------- .../tezos-protocol-environment-shell.dev/opam | 26 -------- .../tezos-protocol-environment-sigs.dev/opam | 24 -------- .../tezos-protocol-environment.dev/opam | 26 -------- .../tezos-protocol-genesis.dev/opam | 27 --------- .../tezos-protocol-updater.dev/opam | 30 ---------- .../tezos-rpc-http/tezos-rpc-http.dev/opam | 26 -------- packages/tezos-rpc/tezos-rpc.dev/opam | 27 --------- .../tezos-shell-services.dev/opam | 24 -------- packages/tezos-shell/tezos-shell.dev/opam | 31 ---------- .../tezos-signer-backends.dev/opam | 34 ----------- .../tezos-signer-services.dev/opam | 26 -------- packages/tezos-signer/tezos-signer.dev/opam | 31 ---------- .../tezos-stdlib-unix.dev/opam | 27 --------- packages/tezos-stdlib/tezos-stdlib.dev/opam | 31 ---------- packages/tezos-storage/tezos-storage.dev/opam | 28 --------- packages/tezos-utils/tezos-utils.dev/opam | 55 ----------------- .../tezos-validation.dev/opam | 27 --------- packages/uecc/uecc.dev/opam | 25 -------- scripts/setup_ligo_opam_repository.sh | 6 -- urls.txt | 1 - .../rewrite-local-opam-repository.sh | 55 ----------------- vendors/opam-repository-tools/update.sh | 11 ---- 76 files changed, 2122 deletions(-) delete mode 100644 index.tar.gz delete mode 100644 packages/bip39/bip39.dev/opam delete mode 100644 packages/blake2/blake2.dev/opam delete mode 100644 packages/hacl/hacl.dev/opam delete mode 100644 packages/irmin-lmdb/irmin-lmdb.dev/opam delete mode 100644 packages/ledgerwallet-tezos/ledgerwallet-tezos.dev/opam delete mode 100644 packages/ledgerwallet/ledgerwallet.dev/opam delete mode 100644 packages/ligo/ligo.dev/opam delete mode 100644 packages/lmdb/lmdb.dev/opam delete mode 100644 packages/michelson-parser/michelson-parser.dev/opam delete mode 100644 packages/ocplib-ezresto-directory/ocplib-ezresto-directory.dev/opam delete mode 100644 packages/ocplib-ezresto/ocplib-ezresto.dev/opam delete mode 100644 packages/ocplib-json-typed-browser/ocplib-json-typed-browser.dev/opam delete mode 100644 packages/ocplib-json-typed-bson/ocplib-json-typed-bson.dev/opam delete mode 100644 packages/ocplib-json-typed/ocplib-json-typed.dev/opam delete mode 100644 packages/ocplib-resto-cohttp/ocplib-resto-cohttp.dev/opam delete mode 100644 packages/ocplib-resto-directory/ocplib-resto-directory.dev/opam delete mode 100644 packages/ocplib-resto-json/ocplib-resto-json.dev/opam delete mode 100644 packages/ocplib-resto/ocplib-resto.dev/opam delete mode 100644 packages/pbkdf/pbkdf.dev/opam delete mode 100644 packages/proto-alpha-utils/proto-alpha-utils.dev/opam delete mode 100644 packages/secp256k1/secp256k1.dev/opam delete mode 100644 packages/simple-utils/simple-utils.dev/opam delete mode 100644 packages/tezos-accuser-alpha-commands/tezos-accuser-alpha-commands.dev/opam delete mode 100644 packages/tezos-accuser-alpha/tezos-accuser-alpha.dev/opam delete mode 100644 packages/tezos-baker-alpha-commands/tezos-baker-alpha-commands.dev/opam delete mode 100644 packages/tezos-baker-alpha/tezos-baker-alpha.dev/opam delete mode 100644 packages/tezos-baking-alpha-commands/tezos-baking-alpha-commands.dev/opam delete mode 100644 packages/tezos-baking-alpha/tezos-baking-alpha.dev/opam delete mode 100644 packages/tezos-base/tezos-base.dev/opam delete mode 100644 packages/tezos-clic/tezos-clic.dev/opam delete mode 100644 packages/tezos-client-alpha-commands/tezos-client-alpha-commands.dev/opam delete mode 100644 packages/tezos-client-alpha/tezos-client-alpha.dev/opam delete mode 100644 packages/tezos-client-base-unix/tezos-client-base-unix.dev/opam delete mode 100644 packages/tezos-client-base/tezos-client-base.dev/opam delete mode 100644 packages/tezos-client-commands/tezos-client-commands.dev/opam delete mode 100644 packages/tezos-client-demo/tezos-client-demo.dev/opam delete mode 100644 packages/tezos-client-genesis/tezos-client-genesis.dev/opam delete mode 100644 packages/tezos-client/tezos-client.dev/opam delete mode 100644 packages/tezos-crypto/tezos-crypto.dev/opam delete mode 100644 packages/tezos-data-encoding/tezos-data-encoding.dev/opam delete mode 100644 packages/tezos-embedded-protocol-alpha/tezos-embedded-protocol-alpha.dev/opam delete mode 100644 packages/tezos-embedded-protocol-demo/tezos-embedded-protocol-demo.dev/opam delete mode 100644 packages/tezos-embedded-protocol-genesis/tezos-embedded-protocol-genesis.dev/opam delete mode 100644 packages/tezos-endorser-alpha-commands/tezos-endorser-alpha-commands.dev/opam delete mode 100644 packages/tezos-endorser-alpha/tezos-endorser-alpha.dev/opam delete mode 100644 packages/tezos-error-monad/tezos-error-monad.dev/opam delete mode 100644 packages/tezos-memory-proto-alpha/tezos-memory-proto-alpha.dev/opam delete mode 100644 packages/tezos-micheline/tezos-micheline.dev/opam delete mode 100644 packages/tezos-node/tezos-node.dev/opam delete mode 100644 packages/tezos-p2p/tezos-p2p.dev/opam delete mode 100644 packages/tezos-protocol-alpha/tezos-protocol-alpha.dev/opam delete mode 100644 packages/tezos-protocol-compiler/tezos-protocol-compiler.dev/opam delete mode 100644 packages/tezos-protocol-demo/tezos-protocol-demo.dev/opam delete mode 100644 packages/tezos-protocol-environment-shell/tezos-protocol-environment-shell.dev/opam delete mode 100644 packages/tezos-protocol-environment-sigs/tezos-protocol-environment-sigs.dev/opam delete mode 100644 packages/tezos-protocol-environment/tezos-protocol-environment.dev/opam delete mode 100644 packages/tezos-protocol-genesis/tezos-protocol-genesis.dev/opam delete mode 100644 packages/tezos-protocol-updater/tezos-protocol-updater.dev/opam delete mode 100644 packages/tezos-rpc-http/tezos-rpc-http.dev/opam delete mode 100644 packages/tezos-rpc/tezos-rpc.dev/opam delete mode 100644 packages/tezos-shell-services/tezos-shell-services.dev/opam delete mode 100644 packages/tezos-shell/tezos-shell.dev/opam delete mode 100644 packages/tezos-signer-backends/tezos-signer-backends.dev/opam delete mode 100644 packages/tezos-signer-services/tezos-signer-services.dev/opam delete mode 100644 packages/tezos-signer/tezos-signer.dev/opam delete mode 100644 packages/tezos-stdlib-unix/tezos-stdlib-unix.dev/opam delete mode 100644 packages/tezos-stdlib/tezos-stdlib.dev/opam delete mode 100644 packages/tezos-storage/tezos-storage.dev/opam delete mode 100644 packages/tezos-utils/tezos-utils.dev/opam delete mode 100644 packages/tezos-validation/tezos-validation.dev/opam delete mode 100644 packages/uecc/uecc.dev/opam delete mode 100755 scripts/setup_ligo_opam_repository.sh delete mode 100644 urls.txt delete mode 100755 vendors/opam-repository-tools/rewrite-local-opam-repository.sh delete mode 100755 vendors/opam-repository-tools/update.sh diff --git a/index.tar.gz b/index.tar.gz deleted file mode 100644 index 022ac1aef23d312cd3ce31a2b9a969d5288314fb..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 9735 zcmaiac{r4R`0iM;Wes0zhGb6&5iz#NQj%ngkqD`XP_~ySWX)c7${NaAq_HnqhGfrD z_7KK8W9I#wx8FI}`RiQQng7gOW}eUUd7k^Z@B4Yt(F~~Lc`kM+nhm=(ub-VM10EWe z#){Xk_$r?Mn_y@3E%l3xj7--V;~sR{%jg!Rhy-~QQ*%P0U2yJ21N-}pj|}D~d2=tE z##@R#@)U6J41oulXnNuM8=jBhh(%$;#F8~hqWfD&?2<9Kt5sDhQ*~ywG+)^8CbuD= z`OfpDkUB!LPRC1XQ`RH8?JuSKp{1q9Y!W5z_a=>YLho!n&Dg|yUBM2RWWErvqrpKY zs63uV5u>$405AAs;6CNEJ`q73Ok8^@5=Ooh@(QzG7tH(1^TFqq+S)n_CHrTZ=tQV3 z%tXu$`S&rjuzv9rg~d8LJ~e<9KA8P+nio6|ISJYth4)?VhA__KZl?=F91aWU@Zj~S zuf_&&^P@+qT?Ne;IBDZVHyd5ORR5l;$rB)Ug$4<~jN(U4!ZGdVuyYYi(=pyh zf{tBT3a6UoAYGLfAVF(Knq>`8^;&w$ARYr=(2;W3l_+35dd&7qju~Gj0d~&?j8vi^ zcJH-haJ4^>AVNwsyBHD41>B=@yp?r3^#TNxEy50Q?DCs9=c$NOWWSvK9M*Z{Z^Eql zzOwI0Hv9#4lR3!Z**2DeiKzZ-W_$E+aN~t2GTRo2qFMt{l!P+_M-2ZW=3B>zxZ=T- znn+zwfv2CxK8_hii#W`H*BX!%5?=!?^1WOHj6(q2hvy;_#+;5Jv8?oiFI|T?RV z4L2o8FJFVza55pyhmVZYxz>%@BM;SMKD1ifA5oL%ad|C=a&+$j&t}vJuHtl9-no`(K$Nzhob$N= z3=?opPr&osJ}@0PV=t?SLQb9s8?ak}&ET+l+b^=*EqvFtB~~E1U5GvGAwVyH(XH`C zY%lnFK*mM_CTdY2Zzaso2jI0TCgjjDWREjr6E+_eU5+XZ=W(>iTMytIpYS$;uIzFt zVI28NM>vvuUSa_3yR?AEnD7H`PBP}-DO-JWS2|sYT!&aiVOWkXmb@ujOU;(O)7vx& zB>)))XL#&H3R+713#dY>h&_28SIu_o%Vp|AT3F@A93BY2f4(At`6c0J<)EhRpX7AZ(91>B-SJtWE`QV}tZ^1L8RgeM#e zSG{dMl%tI$=d37^A$GtMb`#*G#v!D%2Q@+47ph!F5{`}nwTJYB7TmxrmE$v5LKpZc ztPFrGS&GX`vPCiA4AZ7SFZ4ek!Hm#SunaawATtD}Cqj;cmH;z$I)QT+b8-os2-`oz zXHMga79nj)J@4)UgzuzA`rTv;L{pW4=XvOggRd^r-W2);5T$KN_8Z_sA;nk4gk<3H zA@o-RE(?VvXf<{)KP7+w-60g7TMK5@p7Q=RgT>pSV|nVxP3~d1XCM*DW#|$0URlyA zK<(u`lP?AHudd{MTCBWA!;Um@`8;4e1l$NRQ$$|9FBd~rjvWAJW%tWu zp8O^pyw`yF%WY0K`TK^ob#H4_y=Dm7i!lnat1usUJ5t@W_(Xvip*DGWqD+#VZITw})`-EM!Hyf!`_y>bi};Jy8@JhNxbR^qEY zIGmj1%vj_Rps(@k|1(jG>!NyE(UZMfuZPXa+3b#sV4>viI2}X}R%*U)(lgGCi|CA9QZ?EescN zlNLNq?J7(^f^^T%zV-gPz|tJ_2KLFWd{4PXSoQJ@^t?zY{B)N1yPEp~zRTrTi*1(^ z+diS&zoB7`8lx$yq9mNg@s2*xAo*v4OqVETwSJ+9a&@c_d((PIGoEi^QEv54Ok&gb zXuHPxN7t8(&KKYkPcA4%T^w;ri^sF(MF)#E>gU-(ytiby3)j{I#|XYX5j%UIxhKa4 zSTtvCIb<{6y5qYCz3Ps9_SO$v4k+1vx3z$WU2hr9)();v3Tc67J%r^!suzb?3k!YN z|2tAE&{KKAoD!OHM|2+5xF+#_mzaxXWOfW0y>d_QD%Tx%(}}$2g&rOr_?K#KfNC~R6VS~ zJe>(V<3PY9f%y8vwYeo|63`!F8Ppb`;{FDoKTQvAQ10jq(wNRRE4^C z8kly8-ry^+RNZ~=xrVjNOH;}4_}Mli((7{QxfIcOuLdlCjHr>OO}R$uziawm>rQyw z*u=Ys6zK@3#!P2}3&B3i-c=s51o&IjgV}9ZRHt&rz8IVL_T+izi!%L^k}1#XH?i@I z`}MbOm)bKI^3@1h7b||OEvSEVS)`kx_;PTy%XDt7tcjW&qM`0$u z<5st-*eLQhx+Ax`eu+RMR8;!i91L42TFA{E0GStbFeEaU3TT@g24M*{`V3&W1CWGt zMIJ);s-LxBB3iJou`V}iFn*{T!?dGrzT*9kQ%N48evrj=?6BtFhM_EY+=tZkQ#@c}g|#DmZ9U(FLV8~R1qA)j zOdWlCi*CeN()$oyrVz}wvId54iNyftZe$oR5^}NtOTQBlnQ_*%*9feCHRZvu3K?ulC0v5@>S;`AoB8-A$gpB3T z_yF|wO*vudxczc&Tle(|IJK}+LgDY!lOd-jy_ht+O(pq_B>h=3)Nk?oHxS>#v701- z^=-%^RbU%p`2)fo^k7UoK--hCH!`%&f13Gzr%0xT^-rr*E(9;vrI6K-I&eSN2W03t z7xC|Cm`T8S6dp67S%*Y;Tfij`wL#QfDXL7FB#-yfX5AiUCxy}H8froUcTrHAVQ4?d zH$36~=3$kcM|W4;NT6CXEgV6FXn!#f<46C2qsllLV>iq_2XU-O9lG-bDXUylQ{-it ztuXkPJt2p+w<)0 zgU{FP^sluDAE~Rqcu6#-OPbA5CJqh!_!40XiQV35xqO{!RrFRb_vz(FXXK82FA)EB zy}ws80B+iTiid#{W(A?(qKi0J0A0DgffN-HwC6g*m~J>?9mGX}KQwJYE-+fhWv{r$ z8Z}O?q|gm7=l;^*pPVTY^W4Enmm~l=y6SH@U1Q!FFhRmt+(a&z*?$K#gtO#@5bsgF znPP1jeQBC&A}qR@{|Ab?7jo}Mh!n$$&^_UBdGs3!*0bA$VWiqE(<5XSR^ej&SA@(2 z^ezkYB%sRxE=F_PSKS{xk+Df$h zu1EM~33PTHJ0xONgaMX0E*TVmYR;v2e1IX{u~4KtYJsVgQ{*wNGr85AgX!A8zuuuW zxl{HP)>_mB;csXa_OXS_izMeGo0%9?Fg*4+9au7p_vVO-Iz$5QraVyM0HU>XDEP>e zCg7X#=cWMmJOTWK5bk&4luY1)KI<`=(!>w7IL*#MRvti@k@x=RL03d$;((-MnFC zk+Ti7ugnuY#?CGNwv;)I{Zv{v;<5V4^sDEUU@8{5ALoOk5~I&ww{te^C~&?^r96LQ zFcRp0B5XhTTZABmVd_8h5nX_|4$PSexS=_y>c2xQEomOeZ*K<1g7vMlxp8pz)e!67 zwzV6MAAL8+$I=J(dr8bI7n@U!E2fO98MiBIIvP<9uIz@xq%O z*`x7^`M|JS6YMuf-?)5hZJ<^shh%?HqT9ihmCvcwvAQvm$sVm_+%x$MazITu0#-fL z<{&Q}DID5BA{b=yjN)phzrmcKiHc69PIe0pdyX>osrq`XIR>OYK<8I5Z|%pnX+C2l z%NZlXRz8Uw5JcOykC_5pN>@H0cN!0-7Fl-LxKTydsRk8JX|puD%Fjc*?e>6d=( zfIt6ARFHtZ4`VOg*#X>F6hpuzov<`p-kv)6y!D0+WUm5!2=!i_(IgGRnrpy(U5_oXE@nq z9vX4lfb5X4o;$RYG0%S>bMFl5{_^T~`eBWFY<(r9?PZEjaayA#_QNAd<*~+N)_+qVhN0fTb@;A9U1LA2)pVrrV|wPGC`F8b zRVj9=5wtKnUs|f8<6;egEFFup+;6+38)Rh_&XYRX>jM z4#Q~v#E0bFO_8rQ3VTtq)#qx<`^D4$oPF&&_NswN>QM2_bv$!Zb~97Kk1>Lv-E&yz zSc_cR**M(UnifauQ-%dT9EQInte=?W#4&v2Jh4g)*IPL57J8W^>y|>7p+EGlvR2A1 zWw|OqGNPS9>*O)ec(fr-^vHgLm;SVeu~u0`|(~DVn;>u9OW|lm7XiszeaHlI&vQ8XFt*B2ea!mM<`-`Qc{KvI)!fBd+afb zt8mNM@3G`{y)r5 zt0$74%V)Vf%9?r6QkT#lrj}`TXF$x6)cN~dQrg!%z8cBeEN_`5rrUODC9WS<>hH}* z)g0dFiLX$qbT~*Huszjw0o&3(R(e0~n61Ag*bR-eRImQzesx(wYbpaX$9lOYby{;JGazqORML(rhKQx> z@Hz-(K97@^-_Ke0c(gcA*@ME#Yzn+0pyLR0;z8vrP;j{!oEmfi!xAWF@YGAwmY_=W zE_I|Q`GHcj$2YoH(>q=V>(w0rIKPNYxl$XrQX4mH zm1OcOs*hkNyL#+H?zF@JmDDwMpQJByvE0K!REVrzQENvWI&(NFkSdJqQMHdNMP{qS zKaTWG=o2I)r#0jgTCl0>LchYN9Qk!jNGYN#<}SbyhBZ0?3->=VlZ*>F#I<$;Zo{-Z z5XR2D3(@}0xlGXI(poZi#+? z@hF&w<{?q;8Yp_rzXry9xc}h~0ocCTzp;j5ezAwWy_r<&cX4-;K&J8k+>?qkbWLK{ zE+`ou7bUHs2w53;_aq6pK+H7lj^m}{||f@MB5Y{bo@y+_@4M=$5d;r&|fr48u@ z*^)ij$ZnCYM!>>9GH~C*UXPJUk0xvfe6JariS6wJlDcFp!`(z+wuAW-OU4X`!+6JL z72y3wmz6cdkToPib=LdT)}_LLtDPxk)fy6E%z9#}+6pjz27an+7kpMndF|ltcmFeu zt`hO%RGyK5C20es?L#OSD>S_i#aR$cZrlft%ag4fx&K@pt+T2arL&FD7-FdM+F4&S zdU%y}T|U5;?dt1>LXH@Wcb*^@zu~hS%h?7?kr~p8g)h6m+dKCGLS@N*rheJM*JY~} zdO@KNYXxaTnv@&Ut9P!*{>JolT|a5K`MvC5R?4DMzlzZMGT#>S^VA>GY(D-lZslg4 zcM?hIWh%8BO?xy5qQIYFm)&9TMgLoLr9H!rU^4Y(XH{H|!{y_Rb@$WU+OqrvuU#+F zZaU`sS2IDsUaHUETg5K{pZvaQr^F2%L#h9$xjgKqG8VZD+Q_Dk&9Xp@1o+-lD(}(# zlOcGxGEyi8wk`_hXYR6$EBg3MpH<)X2gdz}q;R5X?|f23fpbhqF(ph#0XE-|ByK8^ zfbk$=m#Qtu)c{;Y&wF5?*bMVfzW@Q>sjlyo7_EvP9dg_h(`|^K>B`&WDBx=PIlSnR zfB(YN+I)?8XbL-2>bT%dJtz+j7Ty4FSDoUQYM!U04ItOXvfDEWR2ltU$(72>itekI z7X7cD7x|I!-?<{&Ji&$~Pw9)YLGQ|e@!pQ$Bnn57TSZu2izE?U!os|bD?Gmh-C+5r zUcx9)Gl6FU<#|g2^1-hkVneQELht2{7u!x8bA+_oy85 z&njhZ^6*{B^;m_wx37_8V_t4`dR3BjBkh;k{FT?ruZxW1&~2j>d-$1Fry6OE{zlEq z7e&EdW>D6*#`Hj?prZN)r|r;#dgr(tk>^oOQCd@MCp!*te(Ub*-_-`1nM6+s_&y(p zap(RwR7LNC6tSd!V4eq?GJ93Hgik+QQe4Lt?27A-^}{jW)S2N+k#FMrF@*;txymHi9OpR6tpxh&Bbs-X{%MHxMIWjPD4W zqWn*(&Fujf&3g>gCQQ_N+o`;Niq?iqvCf`rn3InWAX^U|kSd*&W!vdbd$<9KmH;}W z@eF#Qa07(5vqZ%L0r3q$OU7M%LIR6k(DfkH5V{&0o3E>t5|7b#X*SHFiZ+|qQ=>hP z=G>jaey3Nnn9#hG29G%JHIA$|qF*_h$AGgle?6ZV(}vAYwr+Ey$Yi=K zJc5MmDK>y@lDaA-@7T4bW7puo8aB=ZuPyd#F@XO5R1Z`%1PrK-5MOFRt`4yM6D&%c zzY%w99u%?Zw()sld@=E|IrhFC=3CMa7?Rb<;AqcpR`k?8(l1JVPbtq@EGOVAF(Rcs zR8k`GakN%H;(9gPyTN(cULx31%YXa#Mbx6L+~nNms-secnAs|?gI}o{X?Ib)c_e)Iw{g3uhO?^{QP zlC#4!MFy>}4@Z~zo#-2VpH$HHUfnGH@9TiSGX03YJ4nPu9Nx27)f^Xk>S5P7qi2mR z=)-f&9Q%mfNKbY$PxX_uYpivQzE!{Bv16-Va-Or6yJIkCWu1m+*_25KKm3&Y*<6}2 zPZw5YnB(+@i8V+6f^*eYes*Sv73DHsnTPP)t<+Un=vv)=2L>lf`bCvJ) z)@hG0+%SP8%cb}(==E7%`py|^9PA)EQT=B2^~~Jq+9b`^;*YXJsxs<NDvZ~q2mbl#UV9VXnXPDkHN0( z+!LX~7Y|*ya!>ypDhxj29W)?K2hPe*9Sv)LSLJR(TWdt5(i@%F&UZBSrkJs!}>IV<4>qox?e*^cAX=ZcKTXS+SBp#!FsNopZ>uE)mQZvKpToX?PbYKYwBdDG{v93y1s@>J6- zC2Q}1s8pstaf`mtruxw4ScAIku};|C;`~uv><|}%-ntPmo1=U*nO^BR;uSF0!NWgJ z|C9N6c=N->7Pb#RXa^~ak=D{P%D&UeA8S0i-}xR==@Yrt1UW47EKS$eBR$8g-{_o{ zJa6W6VNkW>zs4sn9iRO4sAp;D)3-4Jl66luRmM#An2^LeY5{tMf39;Ss-99=+`zhn zVbG4?Gps$0dOKd*IDz0MvHgFE6r@)QYa>WC)C8uQp^V@3} z=M^B#fOOaiV%V6=Xlwl6+V_O-CsE%L6>M}2Z#z`3;)Q<1j0eWOYt^f{_V&RwstCMW z2p@1~@}5%D-pk?tw>vf@yUKsJ`!{`u3n5cYWiLdZ@0n}VVDXv6;`X1W8LODCbZs^)s6^_&}r?ZkV#ZHN@b7qKVLc-lNK!B4hnB8 z5g_h#V921q2uz8u(7hL7*F z?~nH=W0AdXqWC~8$d#w({(}o{YnO?ri$d#%m9&dRpD$98_i-h!5!UhS|LX5lAckl^ zg_T7}4D~&yWWQR2VfH;kQxV#;|b`q&S-76fy!Jx@VP>Vcvl4rnCmJC zgKT;QTqNlbF6WR;!P=CXS_nLW1;t3HmlYJ6JPM0`TtvP){wgm&1?v=Xl|9F$e(6jD zjJsEdF{-A->KLY%-l|z-jB`D6srqlekdIStt7rzrN^SV&@iLK#S}ZFoCO5y2rVf~1 zw=}o?ltzZEslfj+M1gb$C`!=y2fp!O=Tu{n5ot#Z-m?^~s@CQ%A@4b&8gG`q_De1t z$xhv<@=4*Sqq(G_+3U6_R=1Ho2h#YOaH{4!;)iwH$BM~9LpH!7`FTy{;s^tx#?4uf zP5l4tE*a=Hps-rtb8HDI#$P0yQ7o?{b#DjtWG~IsAEH_`uxVv%S=!mZXQ5BvWTF1| zyeJ+=wC=)lkN=V1H%G2rt=*GsKJju zm(hsFYOaX5%MRy>2P-sT`xtdlAYJk=ugKxl+gbckeW*v$idv6jFJJSQKhX~Z-^KZh zd?CnW>p6#1_cIOxMvVqhjn0T_lzc4@s(E)wfHOxifpT#Myh(!$dDM59!o-+Y^c7$i zDPfVP)a187&pWmo#-A8Rp1qL;$O*q&G%0{2s%=Q5n*k@XreC?NtvvVtUay}W3G+X? z8&_ad7ksevd)nqg(pc0n(!9IcF9o=xQ+s{Tcr%AlZGv)Y*PZP!vLx3wULY@sIkSGW z+F|p_z>Jq!mB*-nde*`lUmBbL*J?Z)najJ5k+3YN<-$>Ma+%TgVHJm4WPS{>ov zgbM6=!m`RihW>zt6Zp+lNI&" -authors: ["Vincent Bernardoff "] -homepage: "https://github.com/vbmithr/ocaml-bip39" -doc: "https://vbmithr.github.io/ocaml-bip39/doc" -synopsis: "Bitcoin's BIP39 implementation" -license: "ISC" -dev-repo: "git+https://github.com/vbmithr/ocaml-bip39.git" -bug-reports: "https://github.com/vbmithr/ocaml-bip39/issues" -tags: [] -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-bip39/bip39.install" "." ] -] -depends: [ - "dune" {build & >= "1.0.1"} - "base" {build & >= "v0.10.0"} - "stdio" {build & >= "v0.10.0"} - "hacl" - "bigstring" {>= "0.2"} - "pbkdf" {>= "0.2.0"} - "hex" {with-test & >= "1.2.0"} - "alcotest" {with-test & >= "0.8.1"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/blake2/blake2.dev/opam b/packages/blake2/blake2.dev/opam deleted file mode 100644 index d9c6bb6e3..000000000 --- a/packages/blake2/blake2.dev/opam +++ /dev/null @@ -1,24 +0,0 @@ -version: "dev" -opam-version: "2.0" -name: "blake2" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -license: "ISC" -synopsis: "Cryptography for Tezos" -homepage: "https://github.com/vbmithr/ocaml-blake2" -bug-reports: "https://github.com/vbmithr/ocaml-blake2/issues" -dev-repo: "git://github.com/vbmithr/ocaml-blake2" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-blake2/blake2.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "dune" {build & >= "1.0.1"} - "bigstring" {>= "0.1.1"} - "alcotest" { with-test } - "hex" {with-test & >= "1.2.0"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/hacl/hacl.dev/opam b/packages/hacl/hacl.dev/opam deleted file mode 100644 index 318720b99..000000000 --- a/packages/hacl/hacl.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -version: "dev" -opam-version: "2.0" -name: "hacl" -authors: [ "Vincent Bernardoff " "Marco Stronati " ] -maintainer: "Vincent Bernardoff " -synopsis: "Tezos binding for Hacl*" -homepage: "https://gitlab.com/tezos/tezos" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "dune" {build & >= "1.0.1"} - "bigstring" {>= "0.1.1"} - "ocplib-endian" {>= "1.0"} - "zarith" {>= "1.7"} - "alcotest" {with-test & >= "0.8.1"} - "hex" {with-test & >= "1.2.0"} - "base" - "stdio" -] -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-hacl/hacl.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/irmin-lmdb/irmin-lmdb.dev/opam b/packages/irmin-lmdb/irmin-lmdb.dev/opam deleted file mode 100644 index 46661c02d..000000000 --- a/packages/irmin-lmdb/irmin-lmdb.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "irmin-lmdb" -opam-version: "2.0" -maintainer: "gregoire.henry@tezos.com" -authors: ["Grégoire Henry"] -license: "ISC" -homepage: "https://gitlab.com/tezos/irmin-lmdb" -bug-reports: "https://gitlab.com/tezos/irmin-lmdb/issues" -dev-repo: "git+https://gitlab.com/tezos/irmin-lmdb.git" -doc: "https://tezos.gitlab.io/irmin-lmdb/" -synopsis: "LMDB backend for Irmin" - -build: [ - ["dune" "subst"] {pinned} - ["dune" "build" "-p" name "-j" jobs] - [ "mv" "vendors/tezos-modded/vendors/irmin-lmdb/irmin-lmdb.install" "." ] -] -run-test: ["dune" "runtest" "-p" name] - -depends: [ - "dune" {build & >= "1.0.1"} - "irmin" {>= "1.4.0"} - "lmdb" {>= "0.1"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ledgerwallet-tezos/ledgerwallet-tezos.dev/opam b/packages/ledgerwallet-tezos/ledgerwallet-tezos.dev/opam deleted file mode 100644 index c9f27d2ab..000000000 --- a/packages/ledgerwallet-tezos/ledgerwallet-tezos.dev/opam +++ /dev/null @@ -1,22 +0,0 @@ -version: "dev" -opam-version: "2.0" -name: "ledgerwallet-tezos" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -license: "ISC" -synopsis: "Ledger wallet library for OCaml: Tezos app" -homepage: "https://github.com/vbmithr/ocaml-ledger-wallet" -bug-reports: "https://github.com/vbmithr/ocaml-ledger-wallet/issues" -dev-repo: "git://github.com/vbmithr/ocaml-ledger-wallet" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-ledger-wallet/ledgerwallet-tezos.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "dune" {build & >= "1.0.1"} - "ledgerwallet" {= "dev"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ledgerwallet/ledgerwallet.dev/opam b/packages/ledgerwallet/ledgerwallet.dev/opam deleted file mode 100644 index 588236491..000000000 --- a/packages/ledgerwallet/ledgerwallet.dev/opam +++ /dev/null @@ -1,24 +0,0 @@ -opam-version: "2.0" -version: "dev" -name: "ledgerwallet" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -license: "ISC" -synopsis: "Ledger wallet library for OCaml" -homepage: "https://github.com/vbmithr/ocaml-ledger-wallet" -bug-reports: "https://github.com/vbmithr/ocaml-ledger-wallet/issues" -dev-repo: "git://github.com/vbmithr/ocaml-ledger-wallet" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-ledger-wallet/ledgerwallet.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "dune" {build & >= "1.0.1"} - "rresult" {>= "0.5.0"} - "cstruct" {>= "3.2.1"} - "hidapi" {>= "1.0"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ligo/ligo.dev/opam b/packages/ligo/ligo.dev/opam deleted file mode 100644 index e1e0f283b..000000000 --- a/packages/ligo/ligo.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "ligo" -opam-version: "2.0" -maintainer: "ligolang@gmail.com" -authors: [ "Galfour" ] -homepage: "https://gitlab.com/ligolang/tezos" -bug-reports: "https://gitlab.com/ligolang/tezos/issues" -synopsis: "A higher-level language which compiles to Michelson" -dev-repo: "git+https://gitlab.com/ligolang/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "menhir" - "ppx_let" - "ppx_deriving" - "tezos-utils" - "proto-alpha-utils" - "yojson" - "alcotest" { with-test } - "getopt" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "src/ligo.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/lmdb/lmdb.dev/opam b/packages/lmdb/lmdb.dev/opam deleted file mode 100644 index b4efa7c72..000000000 --- a/packages/lmdb/lmdb.dev/opam +++ /dev/null @@ -1,23 +0,0 @@ -opam-version: "2.0" -name: "lmdb" -version: "0.1" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -license: "ISC" -synopsis: "Simple OCaml binding to Lightning Memory-Mapped Database from Symas" -homepage: "https://github.com/vbmithr/ocaml-lmdb" -bug-reports: "https://github.com/vbmithr/ocaml-lmdb/issues" -dev-repo: "git://github.com/vbmithr/ocaml-lmdb" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-lmdb/lmdb.install" "." ] -] -depends: [ - "dune" {build & >= "1.0.1"} - "rresult" {>= "0.5.0"} - "cstruct" {with-test & >= "3.2.1"} - "alcotest" {with-test & >= "0.8.1"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/michelson-parser/michelson-parser.dev/opam b/packages/michelson-parser/michelson-parser.dev/opam deleted file mode 100644 index f2f5396d8..000000000 --- a/packages/michelson-parser/michelson-parser.dev/opam +++ /dev/null @@ -1,21 +0,0 @@ -name: "michelson-parser" -opam-version: "2.0" -version: "dev" -maintainer: "ligolang@gmail.com" -authors: [ "Galfour" ] -homepage: "https://gitlab.com/ligolang/tezos" -bug-reports: "https://gitlab.com/ligolang/tezos/issues" -dev-repo: "git+https://gitlab.com/ligolang/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" - "tezos-memory-proto-alpha" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/ligo-utils/tezos-utils/michelson-parser/michelson-parser.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-ezresto-directory/ocplib-ezresto-directory.dev/opam b/packages/ocplib-ezresto-directory/ocplib-ezresto-directory.dev/opam deleted file mode 100644 index 934ba0cf2..000000000 --- a/packages/ocplib-ezresto-directory/ocplib-ezresto-directory.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -name: "ocplib-ezresto-directory" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_ezresto-directory/ocplib-ezresto-directory.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "ocplib-ezresto" {= "dev" } - "ocplib-resto-directory" {= "dev" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-ezresto/ocplib-ezresto.dev/opam b/packages/ocplib-ezresto/ocplib-ezresto.dev/opam deleted file mode 100644 index 37a7933f8..000000000 --- a/packages/ocplib-ezresto/ocplib-ezresto.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -name: "ocplib-ezresto" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_ezresto/ocplib-ezresto.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "ocplib-resto" {= "dev" } - "ocplib-resto-json" {= "dev" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-json-typed-browser/ocplib-json-typed-browser.dev/opam b/packages/ocplib-json-typed-browser/ocplib-json-typed-browser.dev/opam deleted file mode 100644 index c620a7382..000000000 --- a/packages/ocplib-json-typed-browser/ocplib-json-typed-browser.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -opam-version: "2.0" -name: "ocplib-json-typed-browser" -version: "0.6" -maintainer: "Benjamin Canou " -authors: "Benjamin Canou " -homepage: "https://github.com/ocamlpro/ocplib-json-typed" -synopsis: "Libraries for reliable manipulation JSON objects (browser support)" -bug-reports: "https://github.com/ocamlpro/ocplib-json-typed/issues" -license: "LGPLv3 w/ linking exception" -dev-repo: "git+https://github.com/ocamlpro/ocplib-json-typed.git" - -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-json-typed/ocplib-json-typed-browser.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "ocaml" {>= "4.3.0"} - "dune" {build & >= "1.0.1"} - "ocplib-json-typed" {= "0.6" } - "js_of_ocaml" {>= "3.3.0"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-json-typed-bson/ocplib-json-typed-bson.dev/opam b/packages/ocplib-json-typed-bson/ocplib-json-typed-bson.dev/opam deleted file mode 100644 index 20399d5ef..000000000 --- a/packages/ocplib-json-typed-bson/ocplib-json-typed-bson.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -opam-version: "2.0" -name: "ocplib-json-typed-bson" -version: "0.6" -maintainer: "Benjamin Canou " -authors: "Benjamin Canou " -homepage: "https://github.com/ocamlpro/ocplib-json-typed" -synopsis: "Libraries for reliable manipulation JSON objects (BSON)" -bug-reports: "https://github.com/ocamlpro/ocplib-json-typed/issues" -license: "LGPLv3 w/ linking exception" -dev-repo: "git+https://github.com/ocamlpro/ocplib-json-typed.git" - -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-json-typed/ocplib-json-typed-bson.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "ocaml" {>= "4.3.0"} - "dune" {build & >= "1.0.1"} - "ocplib-json-typed" {= "0.6" } - "ocplib-endian" {>= "1.0"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-json-typed/ocplib-json-typed.dev/opam b/packages/ocplib-json-typed/ocplib-json-typed.dev/opam deleted file mode 100644 index a3495b59a..000000000 --- a/packages/ocplib-json-typed/ocplib-json-typed.dev/opam +++ /dev/null @@ -1,24 +0,0 @@ -opam-version: "2.0" -name: "ocplib-json-typed" -version: "0.6" -maintainer: "Benjamin Canou " -authors: "Benjamin Canou " -homepage: "https://github.com/ocamlpro/ocplib-json-typed" -synopsis: "Libraries for reliable manipulation JSON objects" -bug-reports: "https://github.com/ocamlpro/ocplib-json-typed/issues" -license: "LGPLv3 w/ linking exception" -dev-repo: "git+https://github.com/ocamlpro/ocplib-json-typed.git" - -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-json-typed/ocplib-json-typed.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "ocaml" {>= "4.3.0"} - "dune" {build & >= "1.0.1"} - "uri" {>= "1.9.0" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-resto-cohttp/ocplib-resto-cohttp.dev/opam b/packages/ocplib-resto-cohttp/ocplib-resto-cohttp.dev/opam deleted file mode 100644 index fa7d828a5..000000000 --- a/packages/ocplib-resto-cohttp/ocplib-resto-cohttp.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -name: "ocplib-resto-cohttp" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_resto-cohttp/ocplib-resto-cohttp.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "ocplib-resto-directory" {= "dev" } - "cohttp-lwt-unix" { >= "1.0.0" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-resto-directory/ocplib-resto-directory.dev/opam b/packages/ocplib-resto-directory/ocplib-resto-directory.dev/opam deleted file mode 100644 index 3af56bc61..000000000 --- a/packages/ocplib-resto-directory/ocplib-resto-directory.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -name: "ocplib-resto-directory" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_resto-directory/ocplib-resto-directory.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "ocplib-resto" {= "dev" } - "ocplib-resto-json" {= "dev" & with-test } - "lwt" { >= "3.0.0" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-resto-json/ocplib-resto-json.dev/opam b/packages/ocplib-resto-json/ocplib-resto-json.dev/opam deleted file mode 100644 index f16715117..000000000 --- a/packages/ocplib-resto-json/ocplib-resto-json.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -name: "ocplib-resto-json" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_resto-json/ocplib-resto-json.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "ocplib-resto" {= "dev" } - "ocplib-json-typed-bson" { >= "0.6" } -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/ocplib-resto/ocplib-resto.dev/opam b/packages/ocplib-resto/ocplib-resto.dev/opam deleted file mode 100644 index f33383dd6..000000000 --- a/packages/ocplib-resto/ocplib-resto.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -name: "ocplib-resto" -version: "dev" -opam-version: "2.0" -maintainer: "Grégoire Henry " -authors: "Grégoire Henry " -license: "LGPL-2.1-with-OCaml-exception" -homepage: "https://github.com/OCamlPro/ocplib-resto" -bug-reports: "https://github.com/OCamlPro/ocplib-resto/issues" -dev-repo: "git+https://github.com/OCamlPro/ocplib-resto" -synopsis: "A minimal OCaml library for type-safe HTTP/JSON RPCs" - -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/vendors/ocplib-resto/lib_resto/ocplib-resto.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] - -depends: [ - "ocamlfind" {build} - "dune" {build} - "uri" -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/pbkdf/pbkdf.dev/opam b/packages/pbkdf/pbkdf.dev/opam deleted file mode 100644 index fa6188c1f..000000000 --- a/packages/pbkdf/pbkdf.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -opam-version: "2.0" -name: "pbkdf" -version: "0.3.0" -homepage: "https://github.com/abeaumont/ocaml-pbkdf" -dev-repo: "git+https://github.com/abeaumont/ocaml-pbkdf.git" -bug-reports: "https://github.com/abeaumont/ocaml-pbkdf/issues" -authors: ["Alfredo Beaumont " "Sonia Meruelo "] -maintainer: ["Alfredo Beaumont "] -license: "BSD2" -synopsis: "Password based key derivation functions from PKCS#5, RFC 2898" - -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-pbkdf/pbkdf.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "dune" { build & >= "1.0.1" } - "hacl" - "bigstring" {>= "0.2"} - "ocplib-endian" {>= "1.0"} - "alcotest" {with-test & >= "0.8.1"} - "hex" {with-test & >= "1.2.0"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/proto-alpha-utils/proto-alpha-utils.dev/opam b/packages/proto-alpha-utils/proto-alpha-utils.dev/opam deleted file mode 100644 index 724e07d02..000000000 --- a/packages/proto-alpha-utils/proto-alpha-utils.dev/opam +++ /dev/null @@ -1,56 +0,0 @@ -opam-version: "2.0" -name: "proto-alpha-utils" -version: "dev" -synopsis: "LIGO Proto Alpha-specific Utilities, to be used by other libraries" -maintainer: "Galfour " -authors: "Galfour " -license: "MIT" -homepage: "https://gitlab.com/ligolang/ligo-utils" -bug-reports: "https://gitlab.com/ligolang/ligo-utils/issues" -depends: [ - "dune" - "base" - "base" - "bigstring" - "calendar" - "cohttp-lwt-unix" - "cstruct" - "ezjsonm" - "hex" - "hidapi" - "ipaddr" - "irmin" - "js_of_ocaml" - "lwt" - "lwt_log" - "mtime" - "ocplib-endian" - "ocp-ocamlres" - "re" - "rresult" - "stdio" - "uri" - "uutf" - "zarith" - "ocplib-json-typed" - "ocplib-json-typed-bson" - "tezos-crypto" - "tezos-stdlib-unix" - "tezos-data-encoding" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "michelson-parser" - "simple-utils" - "tezos-utils" - # from ppx_let: - "ocaml" {>= "4.04.2" & < "4.08.0"} - "dune" {build & >= "1.5.1"} - "ppxlib" {>= "0.5.0"} -] -build: [ - ["dune" "build" "-p" name] - [ "mv" "vendors/ligo-utils/proto-alpha-utils/proto-alpha-utils.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/secp256k1/secp256k1.dev/opam b/packages/secp256k1/secp256k1.dev/opam deleted file mode 100644 index f0b055659..000000000 --- a/packages/secp256k1/secp256k1.dev/opam +++ /dev/null @@ -1,22 +0,0 @@ -opam-version: "2.0" -name: "secp256k1" -version: "0.1" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -homepage: "https://github.com/vbmithr/ocaml-secp256k1-internal" -bug-reports: "https://github.com/vbmithr/ocaml-secp256k1-internal/issues" -dev-repo: "git://github.com/vbmithr/ocaml-secp256k1-internal" -synopsis: "Bindings to secp256k1 internal functions" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-secp256k1/secp256k1.install" "." ] -] -depends: [ - "conf-gmp" {build} - "dune" {build & >= "1.0.1"} - "cstruct" {>= "3.2.1"} - "bigstring" {>= "0.1.1"} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/simple-utils/simple-utils.dev/opam b/packages/simple-utils/simple-utils.dev/opam deleted file mode 100644 index 5545feb79..000000000 --- a/packages/simple-utils/simple-utils.dev/opam +++ /dev/null @@ -1,54 +0,0 @@ -opam-version: "2.0" -name: "simple-utils" -version: "dev" -synopsis: "LIGO Utilities, to be used by other libraries" -maintainer: "Galfour " -authors: "Galfour " -license: "MIT" -homepage: "https://gitlab.com/ligolang/ligo-utils" -bug-reports: "https://gitlab.com/ligolang/ligo-utils/issues" -depends: [ - "dune" - "base" - "base" - "bigstring" - "calendar" - "cohttp-lwt-unix" - "cstruct" - "ezjsonm" - "hex" - "hidapi" - "ipaddr" - "irmin" - "js_of_ocaml" - "lwt" - "lwt_log" - "mtime" - "ocplib-endian" - "ocp-ocamlres" - "re" - "rresult" - "stdio" - "uri" - "uutf" - "zarith" - "ocplib-json-typed" - "ocplib-json-typed-bson" - "tezos-crypto" - "tezos-stdlib-unix" - "tezos-data-encoding" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "michelson-parser" - # from ppx_let: - "ocaml" {>= "4.04.2" & < "4.08.0"} - "dune" {build & >= "1.5.1"} - "ppxlib" {>= "0.5.0"} -] -build: [ - ["dune" "build" "-p" name] - [ "mv" "vendors/ligo-utils/simple-utils/simple-utils.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-accuser-alpha-commands/tezos-accuser-alpha-commands.dev/opam b/packages/tezos-accuser-alpha-commands/tezos-accuser-alpha-commands.dev/opam deleted file mode 100644 index 1f3a1306c..000000000 --- a/packages/tezos-accuser-alpha-commands/tezos-accuser-alpha-commands.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-accuser-alpha-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-client-alpha" - "tezos-baking-alpha" - "tezos-signer-backends" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_delegate/tezos-accuser-alpha-commands.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-accuser-alpha/tezos-accuser-alpha.dev/opam b/packages/tezos-accuser-alpha/tezos-accuser-alpha.dev/opam deleted file mode 100644 index 39bb71633..000000000 --- a/packages/tezos-accuser-alpha/tezos-accuser-alpha.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -version: "dev" -name: "tezos-accuser-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-alpha" - "tezos-client-commands" - "tezos-baking-alpha-commands" - "tezos-client-base-unix" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/bin_accuser/tezos-accuser-alpha.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-baker-alpha-commands/tezos-baker-alpha-commands.dev/opam b/packages/tezos-baker-alpha-commands/tezos-baker-alpha-commands.dev/opam deleted file mode 100644 index c35bb6d21..000000000 --- a/packages/tezos-baker-alpha-commands/tezos-baker-alpha-commands.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-baker-alpha-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-client-alpha" - "tezos-baking-alpha" - "tezos-signer-backends" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_delegate/tezos-baker-alpha-commands.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-baker-alpha/tezos-baker-alpha.dev/opam b/packages/tezos-baker-alpha/tezos-baker-alpha.dev/opam deleted file mode 100644 index 957e350be..000000000 --- a/packages/tezos-baker-alpha/tezos-baker-alpha.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -version: "dev" -name: "tezos-baker-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-alpha" - "tezos-client-commands" - "tezos-baking-alpha-commands" - "tezos-client-base-unix" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/bin_baker/tezos-baker-alpha.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-baking-alpha-commands/tezos-baking-alpha-commands.dev/opam b/packages/tezos-baking-alpha-commands/tezos-baking-alpha-commands.dev/opam deleted file mode 100644 index e6a723bde..000000000 --- a/packages/tezos-baking-alpha-commands/tezos-baking-alpha-commands.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-baking-alpha-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-client-alpha" - "tezos-baking-alpha" - "tezos-signer-backends" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_delegate/tezos-baking-alpha-commands.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-baking-alpha/tezos-baking-alpha.dev/opam b/packages/tezos-baking-alpha/tezos-baking-alpha.dev/opam deleted file mode 100644 index 91a018dff..000000000 --- a/packages/tezos-baking-alpha/tezos-baking-alpha.dev/opam +++ /dev/null @@ -1,34 +0,0 @@ -version: "dev" -name: "tezos-baking-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-client-alpha" - "tezos-node" { with-test } - "tezos-client-genesis" { with-test } - "tezos-client-base-unix" { with-test } - "alcotest-lwt" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_delegate/tezos-baking-alpha.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-base/tezos-base.dev/opam b/packages/tezos-base/tezos-base.dev/opam deleted file mode 100644 index 32564ac5e..000000000 --- a/packages/tezos-base/tezos-base.dev/opam +++ /dev/null @@ -1,34 +0,0 @@ -version: "dev" -name: "tezos-base" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" - "tezos-crypto" - "tezos-data-encoding" - "tezos-error-monad" - "tezos-micheline" - "tezos-rpc" - "calendar" - "ezjsonm" { >= "0.5.0" } - "ipaddr" { >= "3.0.0" } - "mtime" { >= "1.0.0" } - "re" { >= "1.7.2" } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_base/tezos-base.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-clic/tezos-clic.dev/opam b/packages/tezos-clic/tezos-clic.dev/opam deleted file mode 100644 index fe22bdd53..000000000 --- a/packages/tezos-clic/tezos-clic.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -version: "dev" -name: "tezos-clic" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" - "tezos-error-monad" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_clic/tezos-clic.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-alpha-commands/tezos-client-alpha-commands.dev/opam b/packages/tezos-client-alpha-commands/tezos-client-alpha-commands.dev/opam deleted file mode 100644 index 67f7f90a8..000000000 --- a/packages/tezos-client-alpha-commands/tezos-client-alpha-commands.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-client-alpha-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-alpha" - "tezos-client-commands" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_client_commands/tezos-client-alpha-commands.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-alpha/tezos-client-alpha.dev/opam b/packages/tezos-client-alpha/tezos-client-alpha.dev/opam deleted file mode 100644 index 9c3d84601..000000000 --- a/packages/tezos-client-alpha/tezos-client-alpha.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-client-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-signer-backends" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_client/tezos-client-alpha.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-base-unix/tezos-client-base-unix.dev/opam b/packages/tezos-client-base-unix/tezos-client-base-unix.dev/opam deleted file mode 100644 index 41905b6c4..000000000 --- a/packages/tezos-client-base-unix/tezos-client-base-unix.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-client-base-unix" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-base" - "tezos-stdlib-unix" - "tezos-rpc-http" - "tezos-signer-backends" - "tezos-client-commands" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_client_base_unix/tezos-client-base-unix.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-base/tezos-client-base.dev/opam b/packages/tezos-client-base/tezos-client-base.dev/opam deleted file mode 100644 index b0607b349..000000000 --- a/packages/tezos-client-base/tezos-client-base.dev/opam +++ /dev/null @@ -1,31 +0,0 @@ -version: "dev" -name: "tezos-client-base" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-stdlib-unix" - "tezos-shell-services" - "tezos-storage" - "tezos-rpc-http" - "cmdliner" - "pbkdf" - "bip39" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_client_base/tezos-client-base.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-commands/tezos-client-commands.dev/opam b/packages/tezos-client-commands/tezos-client-commands.dev/opam deleted file mode 100644 index d755c9c29..000000000 --- a/packages/tezos-client-commands/tezos-client-commands.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -version: "dev" -name: "tezos-client-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-base" - "tezos-rpc" - "tezos-shell-services" - "tezos-signer-backends" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_client_commands/tezos-client-commands.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-demo/tezos-client-demo.dev/opam b/packages/tezos-client-demo/tezos-client-demo.dev/opam deleted file mode 100644 index 30e9eaf07..000000000 --- a/packages/tezos-client-demo/tezos-client-demo.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -name: "tezos-client-demo" -opam-version: "1.2" -version: "dev" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-protocol-environment" - "tezos-protocol-demo" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_demo/lib_client/tezos-client-demo.install" "." ] -] -build-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client-genesis/tezos-client-genesis.dev/opam b/packages/tezos-client-genesis/tezos-client-genesis.dev/opam deleted file mode 100644 index a0166d37a..000000000 --- a/packages/tezos-client-genesis/tezos-client-genesis.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-client-genesis" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-protocol-environment" - "tezos-protocol-genesis" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_genesis/lib_client/tezos-client-genesis.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-client/tezos-client.dev/opam b/packages/tezos-client/tezos-client.dev/opam deleted file mode 100644 index fd8ca5893..000000000 --- a/packages/tezos-client/tezos-client.dev/opam +++ /dev/null @@ -1,35 +0,0 @@ -version: "dev" -name: "tezos-client" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-base" - "tezos-client-genesis" - "tezos-client-demo" - "tezos-client-alpha" - "tezos-client-alpha-commands" - "tezos-baking-alpha" - "tezos-baking-alpha-commands" - "tezos-client-base-unix" - "tezos-signer-backends" - "tezos-node" { with-test } - "tezos-protocol-compiler" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/bin_client/tezos-client.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-crypto/tezos-crypto.dev/opam b/packages/tezos-crypto/tezos-crypto.dev/opam deleted file mode 100644 index 2696646e1..000000000 --- a/packages/tezos-crypto/tezos-crypto.dev/opam +++ /dev/null @@ -1,35 +0,0 @@ -version: "dev" -name: "tezos-crypto" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" - "tezos-data-encoding" - "tezos-error-monad" - "tezos-rpc" - "tezos-clic" - "lwt" - "blake2" - "hacl" - "zarith" - "secp256k1" - "uecc" - "alcotest" { with-test & >= "0.8.3" } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_crypto/tezos-crypto.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-data-encoding/tezos-data-encoding.dev/opam b/packages/tezos-data-encoding/tezos-data-encoding.dev/opam deleted file mode 100644 index f436e6d8a..000000000 --- a/packages/tezos-data-encoding/tezos-data-encoding.dev/opam +++ /dev/null @@ -1,30 +0,0 @@ -version: "dev" -name: "tezos-data-encoding" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" - "ezjsonm" - "ocplib-json-typed" - "ocplib-json-typed-bson" - "ocplib-endian" - "alcotest" { with-test } - "crowbar" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_data_encoding/tezos-data-encoding.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-embedded-protocol-alpha/tezos-embedded-protocol-alpha.dev/opam b/packages/tezos-embedded-protocol-alpha/tezos-embedded-protocol-alpha.dev/opam deleted file mode 100644 index 61dd7f1e5..000000000 --- a/packages/tezos-embedded-protocol-alpha/tezos-embedded-protocol-alpha.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-embedded-protocol-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-compiler" - "tezos-protocol-updater" -] -build: [ - [ "%{tezos-protocol-compiler:lib}%/replace" - "%{tezos-protocol-compiler:lib}%/dune_protocol.template" - "dune" "alpha" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_protocol/tezos-embedded-protocol-alpha.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-embedded-protocol-demo/tezos-embedded-protocol-demo.dev/opam b/packages/tezos-embedded-protocol-demo/tezos-embedded-protocol-demo.dev/opam deleted file mode 100644 index ec4f847ec..000000000 --- a/packages/tezos-embedded-protocol-demo/tezos-embedded-protocol-demo.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -version: "dev" -name: "tezos-embedded-protocol-demo" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-protocol-compiler" - "tezos-protocol-updater" -] -build: [ - [ "%{tezos-protocol-compiler:lib}%/replace" - "%{tezos-protocol-compiler:lib}%/dune_protocol.template" - "dune" "demo" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_demo/lib_protocol/tezos-embedded-protocol-demo.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-embedded-protocol-genesis/tezos-embedded-protocol-genesis.dev/opam b/packages/tezos-embedded-protocol-genesis/tezos-embedded-protocol-genesis.dev/opam deleted file mode 100644 index 8e20f6df0..000000000 --- a/packages/tezos-embedded-protocol-genesis/tezos-embedded-protocol-genesis.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -version: "dev" -name: "tezos-embedded-protocol-genesis" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-protocol-compiler" - "tezos-protocol-updater" -] -build: [ - [ "%{tezos-protocol-compiler:lib}%/replace" - "%{tezos-protocol-compiler:lib}%/dune_protocol.template" - "dune" "genesis" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_genesis/lib_protocol/tezos-embedded-protocol-genesis.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-endorser-alpha-commands/tezos-endorser-alpha-commands.dev/opam b/packages/tezos-endorser-alpha-commands/tezos-endorser-alpha-commands.dev/opam deleted file mode 100644 index d458260c7..000000000 --- a/packages/tezos-endorser-alpha-commands/tezos-endorser-alpha-commands.dev/opam +++ /dev/null @@ -1,29 +0,0 @@ -version: "dev" -name: "tezos-endorser-alpha-commands" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "tezos-shell-services" - "tezos-client-base" - "tezos-client-commands" - "tezos-client-alpha" - "tezos-baking-alpha" - "tezos-signer-backends" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_delegate/tezos-endorser-alpha-commands.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-endorser-alpha/tezos-endorser-alpha.dev/opam b/packages/tezos-endorser-alpha/tezos-endorser-alpha.dev/opam deleted file mode 100644 index cb4e35d03..000000000 --- a/packages/tezos-endorser-alpha/tezos-endorser-alpha.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -version: "dev" -name: "tezos-endorser-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-alpha" - "tezos-client-commands" - "tezos-baking-alpha-commands" - "tezos-client-base-unix" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/bin_endorser/tezos-endorser-alpha.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-error-monad/tezos-error-monad.dev/opam b/packages/tezos-error-monad/tezos-error-monad.dev/opam deleted file mode 100644 index 1d4f53b41..000000000 --- a/packages/tezos-error-monad/tezos-error-monad.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-error-monad" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" - "tezos-data-encoding" - "lwt" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_error_monad/tezos-error-monad.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-memory-proto-alpha/tezos-memory-proto-alpha.dev/opam b/packages/tezos-memory-proto-alpha/tezos-memory-proto-alpha.dev/opam deleted file mode 100644 index d86b5e185..000000000 --- a/packages/tezos-memory-proto-alpha/tezos-memory-proto-alpha.dev/opam +++ /dev/null @@ -1,22 +0,0 @@ -opam-version: "2.0" -name: "memory-proto-alpha" -version: "dev" -synopsis: "Tezos Protocol Alpha in memory" -maintainer: "Galfour " -authors: "Galfour " -license: "MIT" -homepage: "https://gitlab.com/ligolang/tezos" -bug-reports: "https://gitlab.com/ligolang/tezos/issues" -depends: [ - "dune" - "tezos-protocol-environment" - "tezos-protocol-alpha" -] -build: [ - ["dune" "build" "-p" name] - [ "mv" "vendors/tezos-modded/src/lib_memory_protocol_alpha/tezos-memory-proto-alpha.install" "." ] -] -dev-repo: "git+https://gitlab.com/ligolang/tezos" -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-micheline/tezos-micheline.dev/opam b/packages/tezos-micheline/tezos-micheline.dev/opam deleted file mode 100644 index 50ebdc708..000000000 --- a/packages/tezos-micheline/tezos-micheline.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-micheline" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-data-encoding" - "tezos-error-monad" - "uutf" - "alcotest-lwt" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_micheline/tezos-micheline.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-node/tezos-node.dev/opam b/packages/tezos-node/tezos-node.dev/opam deleted file mode 100644 index 89e341fb4..000000000 --- a/packages/tezos-node/tezos-node.dev/opam +++ /dev/null @@ -1,35 +0,0 @@ -version: "dev" -name: "tezos-node" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-rpc-http" - "tezos-p2p" - "tezos-shell" - "tezos-protocol-updater" - "tezos-embedded-protocol-genesis" - "tezos-embedded-protocol-demo" - "tezos-embedded-protocol-alpha" - "cmdliner" - "tls" - "cstruct" { < "3.4.0" } ## Because "tls" depends on a version of "nocrypto" - ## that is not compatible with recent "cstruct" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/bin_node/tezos-node.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-p2p/tezos-p2p.dev/opam b/packages/tezos-p2p/tezos-p2p.dev/opam deleted file mode 100644 index 2d707fcae..000000000 --- a/packages/tezos-p2p/tezos-p2p.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-p2p" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-stdlib-unix" - "tezos-shell-services" - "alcotest-lwt" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_p2p/tezos-p2p.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-alpha/tezos-protocol-alpha.dev/opam b/packages/tezos-protocol-alpha/tezos-protocol-alpha.dev/opam deleted file mode 100644 index 1e07e5466..000000000 --- a/packages/tezos-protocol-alpha/tezos-protocol-alpha.dev/opam +++ /dev/null @@ -1,33 +0,0 @@ -version: "dev" -name: "tezos-protocol-alpha" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-compiler" - "alcotest-lwt" { with-test } - "tezos-stdlib-unix" { with-test } - "tezos-protocol-environment" { with-test } - "tezos-shell-services" { with-test } - "bip39" { with-test } -] -build: [ -# [ "%{tezos-protocol-compiler:lib}%/replace" -# "%{tezos-protocol-compiler:lib}%/dune_protocol.template" -# "src/proto_alpha/lib_protocol/dune" "alpha" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_alpha/lib_protocol/tezos-protocol-alpha.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-compiler/tezos-protocol-compiler.dev/opam b/packages/tezos-protocol-compiler/tezos-protocol-compiler.dev/opam deleted file mode 100644 index a6a210c08..000000000 --- a/packages/tezos-protocol-compiler/tezos-protocol-compiler.dev/opam +++ /dev/null @@ -1,31 +0,0 @@ -version: "dev" -name: "tezos-protocol-compiler" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - ## ocaml should be in sync with `script/version.sh` - "ocaml" { = "4.06.1" } - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "base-unix" - "tezos-base" - "tezos-protocol-environment-sigs" - "tezos-stdlib-unix" - "ocplib-endian" - "ocp-ocamlres" { >= "0.4" } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_protocol_compiler/tezos-protocol-compiler.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-demo/tezos-protocol-demo.dev/opam b/packages/tezos-protocol-demo/tezos-protocol-demo.dev/opam deleted file mode 100644 index b337d1f2d..000000000 --- a/packages/tezos-protocol-demo/tezos-protocol-demo.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-protocol-demo" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-protocol-compiler" -] -build: [ - [ "%{tezos-protocol-compiler:lib}%/replace" - "%{tezos-protocol-compiler:lib}%/dune_protocol.template" - "src/proto_demo/lib_protocol/dune" "demo" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_demo/lib_protocol/tezos-protocol-demo.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-environment-shell/tezos-protocol-environment-shell.dev/opam b/packages/tezos-protocol-environment-shell/tezos-protocol-environment-shell.dev/opam deleted file mode 100644 index a781727a2..000000000 --- a/packages/tezos-protocol-environment-shell/tezos-protocol-environment-shell.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-protocol-environment-shell" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment" - "tezos-storage" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_protocol_environment/tezos-protocol-environment-shell.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-environment-sigs/tezos-protocol-environment-sigs.dev/opam b/packages/tezos-protocol-environment-sigs/tezos-protocol-environment-sigs.dev/opam deleted file mode 100644 index 45ccd307e..000000000 --- a/packages/tezos-protocol-environment-sigs/tezos-protocol-environment-sigs.dev/opam +++ /dev/null @@ -1,24 +0,0 @@ -version: "dev" -name: "tezos-protocol-environment-sigs" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-stdlib" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_protocol_environment/tezos-protocol-environment-sigs.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-environment/tezos-protocol-environment.dev/opam b/packages/tezos-protocol-environment/tezos-protocol-environment.dev/opam deleted file mode 100644 index 3ade72e86..000000000 --- a/packages/tezos-protocol-environment/tezos-protocol-environment.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-protocol-environment" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-protocol-environment-sigs" - "alcotest-lwt" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_protocol_environment/tezos-protocol-environment.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-genesis/tezos-protocol-genesis.dev/opam b/packages/tezos-protocol-genesis/tezos-protocol-genesis.dev/opam deleted file mode 100644 index e2ae0cdb0..000000000 --- a/packages/tezos-protocol-genesis/tezos-protocol-genesis.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-protocol-genesis" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-protocol-compiler" -] -build: [ - [ "%{tezos-protocol-compiler:lib}%/replace" - "%{tezos-protocol-compiler:lib}%/dune_protocol.template" - "dune" "genesis" ] - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/proto_genesis/lib_protocol/tezos-protocol-genesis.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-protocol-updater/tezos-protocol-updater.dev/opam b/packages/tezos-protocol-updater/tezos-protocol-updater.dev/opam deleted file mode 100644 index 1b435aa71..000000000 --- a/packages/tezos-protocol-updater/tezos-protocol-updater.dev/opam +++ /dev/null @@ -1,30 +0,0 @@ -version: "dev" -name: "tezos-protocol-updater" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-micheline" - "tezos-shell-services" - "tezos-protocol-compiler" - "tezos-protocol-environment-shell" - "tezos-stdlib-unix" - "tezos-storage" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_protocol_updater/tezos-protocol-updater.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-rpc-http/tezos-rpc-http.dev/opam b/packages/tezos-rpc-http/tezos-rpc-http.dev/opam deleted file mode 100644 index 657edd557..000000000 --- a/packages/tezos-rpc-http/tezos-rpc-http.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-rpc-http" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "ocplib-resto-directory" - "ocplib-resto-cohttp" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_rpc_http/tezos-rpc-http.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-rpc/tezos-rpc.dev/opam b/packages/tezos-rpc/tezos-rpc.dev/opam deleted file mode 100644 index e6ddd7978..000000000 --- a/packages/tezos-rpc/tezos-rpc.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-rpc" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-error-monad" - "tezos-data-encoding" - "ocplib-resto" - "ocplib-resto-directory" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_rpc/tezos-rpc.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-shell-services/tezos-shell-services.dev/opam b/packages/tezos-shell-services/tezos-shell-services.dev/opam deleted file mode 100644 index 2355ee2ac..000000000 --- a/packages/tezos-shell-services/tezos-shell-services.dev/opam +++ /dev/null @@ -1,24 +0,0 @@ -version: "dev" -name: "tezos-shell-services" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_shell_services/tezos-shell-services.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-shell/tezos-shell.dev/opam b/packages/tezos-shell/tezos-shell.dev/opam deleted file mode 100644 index 6d09f9910..000000000 --- a/packages/tezos-shell/tezos-shell.dev/opam +++ /dev/null @@ -1,31 +0,0 @@ -version: "dev" -name: "tezos-shell" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-rpc-http" - "tezos-p2p" - "tezos-shell-services" - "tezos-protocol-updater" - "tezos-validation" - "alcotest-lwt" { with-test } - "tezos-embedded-protocol-demo" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_shell/tezos-shell.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-signer-backends/tezos-signer-backends.dev/opam b/packages/tezos-signer-backends/tezos-signer-backends.dev/opam deleted file mode 100644 index a816c892f..000000000 --- a/packages/tezos-signer-backends/tezos-signer-backends.dev/opam +++ /dev/null @@ -1,34 +0,0 @@ -version: "dev" -name: "tezos-signer-backends" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-stdlib-unix" - "tezos-client-base" - "tezos-rpc-http" - "tezos-signer-services" - "tezos-shell-services" - "pbkdf" - "bip39" - "ledgerwallet-tezos" - "alcotest" {with-test & >= "0.8.1"} - "alcotest-lwt" {with-test & >= "0.8.0"} -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_signer_backends/tezos-signer-backends.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-signer-services/tezos-signer-services.dev/opam b/packages/tezos-signer-services/tezos-signer-services.dev/opam deleted file mode 100644 index d7d1fb040..000000000 --- a/packages/tezos-signer-services/tezos-signer-services.dev/opam +++ /dev/null @@ -1,26 +0,0 @@ -version: "dev" -name: "tezos-signer-services" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-base" - "tezos-rpc" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_signer_services/tezos-signer-services.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-signer/tezos-signer.dev/opam b/packages/tezos-signer/tezos-signer.dev/opam deleted file mode 100644 index e1f99dcd2..000000000 --- a/packages/tezos-signer/tezos-signer.dev/opam +++ /dev/null @@ -1,31 +0,0 @@ -version: "dev" -name: "tezos-signer" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-client-base" - "tezos-client-base-unix" - "tezos-client-commands" - "tezos-signer-services" - "tezos-rpc-http" - "tezos-stdlib-unix" - "tezos-signer-backends" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/bin_signer/tezos-signer.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-stdlib-unix/tezos-stdlib-unix.dev/opam b/packages/tezos-stdlib-unix/tezos-stdlib-unix.dev/opam deleted file mode 100644 index 1e3e8b9fa..000000000 --- a/packages/tezos-stdlib-unix/tezos-stdlib-unix.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-stdlib-unix" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "lwt" { >= "3.0.0" } - "conf-libev" - "ipaddr" { >= "3.0.0" } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_stdlib_unix/tezos-stdlib-unix.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-stdlib/tezos-stdlib.dev/opam b/packages/tezos-stdlib/tezos-stdlib.dev/opam deleted file mode 100644 index cc5f7a89b..000000000 --- a/packages/tezos-stdlib/tezos-stdlib.dev/opam +++ /dev/null @@ -1,31 +0,0 @@ -version: "dev" -name: "tezos-stdlib" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" & < "1.7" } ## Incompatible with lwt<4 - "bigstring" - "hex" - "ocplib-endian" - "re" - "lwt" { < "4" } - "zarith" - "alcotest" { with-test } - "ocp-indent" { with-test & = "1.6.1" } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_stdlib/tezos-stdlib.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-storage/tezos-storage.dev/opam b/packages/tezos-storage/tezos-storage.dev/opam deleted file mode 100644 index 4faf798c1..000000000 --- a/packages/tezos-storage/tezos-storage.dev/opam +++ /dev/null @@ -1,28 +0,0 @@ -version: "dev" -name: "tezos-storage" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "lmdb" - "irmin-lmdb" - "tezos-stdlib-unix" { with-test } - "alcotest-lwt" { with-test } -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_storage/tezos-storage.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-utils/tezos-utils.dev/opam b/packages/tezos-utils/tezos-utils.dev/opam deleted file mode 100644 index 3361f0f85..000000000 --- a/packages/tezos-utils/tezos-utils.dev/opam +++ /dev/null @@ -1,55 +0,0 @@ -opam-version: "2.0" -name: "tezos-utils" -version: "dev" -synopsis: "LIGO Tezos specific Utilities, to be used by other libraries" -maintainer: "Galfour " -authors: "Galfour " -license: "MIT" -homepage: "https://gitlab.com/ligolang/ligo-utils" -bug-reports: "https://gitlab.com/ligolang/ligo-utils/issues" -depends: [ - "dune" - "base" - "base" - "bigstring" - "calendar" - "cohttp-lwt-unix" - "cstruct" - "ezjsonm" - "hex" - "hidapi" - "ipaddr" - "irmin" - "js_of_ocaml" - "lwt" - "lwt_log" - "mtime" - "ocplib-endian" - "ocp-ocamlres" - "re" - "rresult" - "stdio" - "uri" - "uutf" - "zarith" - "ocplib-json-typed" - "ocplib-json-typed-bson" - "tezos-crypto" - "tezos-stdlib-unix" - "tezos-data-encoding" - "tezos-protocol-environment" - "tezos-protocol-alpha" - "michelson-parser" - "simple-utils" - # from ppx_let: - "ocaml" {>= "4.04.2" & < "4.08.0"} - "dune" {build & >= "1.5.1"} - "ppxlib" {>= "0.5.0"} -] -build: [ - ["dune" "build" "-p" name] - [ "mv" "vendors/ligo-utils/tezos-utils/tezos-utils.install" "." ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/tezos-validation/tezos-validation.dev/opam b/packages/tezos-validation/tezos-validation.dev/opam deleted file mode 100644 index 649903755..000000000 --- a/packages/tezos-validation/tezos-validation.dev/opam +++ /dev/null @@ -1,27 +0,0 @@ -version: "dev" -name: "tezos-validation" -opam-version: "2.0" -maintainer: "contact@tezos.com" -authors: [ "Tezos devteam" ] -homepage: "https://www.tezos.com/" -bug-reports: "https://gitlab.com/tezos/tezos/issues" -dev-repo: "git+https://gitlab.com/tezos/tezos.git" -license: "MIT" -depends: [ - "ocamlfind" { build } - "dune" { build & >= "1.0.1" } - "tezos-base" - "tezos-storage" - "tezos-shell-services" - "tezos-protocol-updater" -] -build: [ - [ "dune" "build" "-p" name "-j" jobs ] - [ "mv" "vendors/tezos-modded/src/lib_validation/tezos-validation.install" "." ] -] -run-test: [ - [ "dune" "runtest" "-p" name "-j" jobs ] -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/packages/uecc/uecc.dev/opam b/packages/uecc/uecc.dev/opam deleted file mode 100644 index f83feaebe..000000000 --- a/packages/uecc/uecc.dev/opam +++ /dev/null @@ -1,25 +0,0 @@ -opam-version: "2.0" -name: "uecc" -version: "dev" -authors: "Vincent Bernardoff " -maintainer: "Vincent Bernardoff " -license: "ISC" -homepage: "https://github.com/vbmithr/ocaml-uecc" -synopsis: "Bindings for ECDH and ECDSA for 8-bit, 32-bit, and 64-bit processors" -bug-reports: "https://github.com/vbmithr/ocaml-uecc/issues" -dev-repo: "git://github.com/vbmithr/ocaml-uecc" -build: [ - [ "dune" "build" "-j" jobs "-p" name "@install" ] - [ "mv" "vendors/tezos-modded/vendors/ocaml-uecc/uecc.install" "." ] -] -run-test: [ "dune" "runtest" "-p" name "-j" jobs ] -depends: [ - "dune" {build & >= "1.0.1"} - "bigstring" {>= "0.1.1"} - "alcotest" {with-test & >= "0.8.1"} - "cstruct" {with-test & >= "3.2.1"} - "hex" {with-test} -] -url { - src: "https://gitlab.com/ligolang/ligo/-/archive/master/ligo.tar.gz" -} diff --git a/scripts/setup_ligo_opam_repository.sh b/scripts/setup_ligo_opam_repository.sh deleted file mode 100755 index 444aee6d5..000000000 --- a/scripts/setup_ligo_opam_repository.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -set -e - -vendors/opam-repository-tools/rewrite-local-opam-repository.sh -opam repo add ligo-opam-repository ./vendors/ligo-opam-repository-local-generated -opam update ligo-opam-repository diff --git a/urls.txt b/urls.txt deleted file mode 100644 index 610db2b98..000000000 --- a/urls.txt +++ /dev/null @@ -1 +0,0 @@ -repo f9ec38c6d4dfb4ef9f64edb361326b32 420 diff --git a/vendors/opam-repository-tools/rewrite-local-opam-repository.sh b/vendors/opam-repository-tools/rewrite-local-opam-repository.sh deleted file mode 100755 index 8771aa7bd..000000000 --- a/vendors/opam-repository-tools/rewrite-local-opam-repository.sh +++ /dev/null @@ -1,55 +0,0 @@ -#!/bin/sh - -# Stop on error. -set -e - -# Defensive checks. We're going to remove an entire folder so this script is somewhat dangerous. Better check in advance what can go wrong in the entire execution of the script. -if test -e index.tar.gz && test -e packages && test -e repo && test -e urls.txt; then - if test -d vendors/; then - if test -d "$PWD"; then - if command -v sed >/dev/null 2>&1 \ - && command -v rm >/dev/null 2>&1 \ - && command -v mkdir >/dev/null 2>&1 \ - && command -v cp >/dev/null 2>&1 \ - && command -v find >/dev/null 2>&1 \ - && command -v xargs >/dev/null 2>&1 \ - && command -v opam >/dev/null 2>&1; then - - # Escape the current directory, to be used as the replacement part of the sed regular expression - escaped_project_root="$(printf %s "$PWD" | sed -e 's/\\/\\\\/' | sed -e 's/&/\\\&/' | sed -e 's/~/\\~/')" - - # Recreate vendors/ligo-opam-repository-local-generated which contains a copy of the files related to the opam repository - rm -fr vendors/ligo-opam-repository-local-generated - mkdir vendors/ligo-opam-repository-local-generated - cp -pR index.tar.gz packages repo urls.txt vendors/ligo-opam-repository-local-generated - - # Rewrite the URLs in the opam repository to point to the project root - ( - cd vendors/ligo-opam-repository-local-generated - find . -type f -name opam -print0 | xargs -0 sed -i -e 's~src: *"https://gitlab.com/ligolang/ligo/-/archive/master/ligo\.tar\.gz"~src: "file://'"$escaped_project_root"'"~' - ) - - # Regenerate the index.tar.gz etc. in the local repo - ( - cd vendors/ligo-opam-repository-local-generated - opam admin index - opam admin cache - ) - else - echo "One of the following commands is unavailable: sed rm mkdir cp find xargs opam." - exit 1 - fi - else - echo "Unable to access the current directory as indicated by PWD. Was the CWD of the current shell removed?" - exit 1 - fi - - else - echo "Cannot find the directory vendors/ in the current directory" - exit 1 - fi -else - echo "Cannot find some of the following files in the current directory" - echo "index.tar.gz packages repo urls.txt" - exit 1 -fi diff --git a/vendors/opam-repository-tools/update.sh b/vendors/opam-repository-tools/update.sh deleted file mode 100755 index 8c6b6d741..000000000 --- a/vendors/opam-repository-tools/update.sh +++ /dev/null @@ -1,11 +0,0 @@ -MESSAGE=$1 -if [ -z "$MESSAGE" ] ; then - echo "needs a commit message" - exit 1 -fi -opam admin index -opam admin cache -git add . -git commit -m "$MESSAGE" -git push -opam update new-galfour-tezos From d87d0aab73136e76f4bf5032b7341dfc6be80f1d Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 14:35:23 -0500 Subject: [PATCH 14/25] Expose tez/tez division --- src/passes/operators/operators.ml | 2 ++ src/test/contracts/tez.ligo | 10 +++++++++- src/test/integration_tests.ml | 5 +++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index 15ed4928a..abd34903b 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -438,6 +438,8 @@ module Typer = struct then ok @@ t_int () else if eq_1 a (t_tez ()) && eq_1 b (t_nat ()) then ok @@ t_tez () else + if eq_1 a (t_tez ()) && eq_1 b (t_tez ()) + then ok @@ t_nat () else simple_fail "Dividing with wrong types" let mod_ = typer_2 "MOD" @@ fun a b -> diff --git a/src/test/contracts/tez.ligo b/src/test/contracts/tez.ligo index cf487808d..190951d56 100644 --- a/src/test/contracts/tez.ligo +++ b/src/test/contracts/tez.ligo @@ -1,4 +1,12 @@ const add_tez : tez = 21mtz + 0.000021tz; const sub_tez : tez = 21mtz - 20mtz; -(* is this enough? *) +(* This is not enough. *) const not_enough_tez : tez = 4611686018427387903mtz; + + +const nat_mul_tez : tez = 1n * 100mtz; +const tez_mul_nat : tez = 100mtz * 10n; + +const tez_div_tez1 : nat = 100mtz / 1mtz; +const tez_div_tez2 : nat = 100mtz / 90mtz; +const tez_div_tez3 : nat = 100mtz / 110mtz; diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 7a50ad29b..4b73b0b33 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -829,6 +829,11 @@ let tez_ligo () : unit result = let%bind _ = expect_eq_evaluate program "add_tez" (e_mutez 42) in let%bind _ = expect_eq_evaluate program "sub_tez" (e_mutez 1) in let%bind _ = expect_eq_evaluate program "not_enough_tez" (e_mutez 4611686018427387903) in + let%bind _ = expect_eq_evaluate program "nat_mul_tez" (e_mutez 100) in + let%bind _ = expect_eq_evaluate program "tez_mul_nat" (e_mutez 1000) in + let%bind _ = expect_eq_evaluate program "tez_div_tez1" (e_nat 100) in + let%bind _ = expect_eq_evaluate program "tez_div_tez2" (e_nat 1) in + let%bind _ = expect_eq_evaluate program "tez_div_tez3" (e_nat 0) in ok () let tez_mligo () : unit result = From d947f3b462fe95e74e9f67cbfef0802898e0fb3e Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 11 Oct 2019 12:38:00 -0700 Subject: [PATCH 15/25] Change set patch to chain calls and only use one assignment --- src/passes/2-simplify/pascaligo.ml | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 5dda856b1..d8ea7bc5c 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -806,15 +806,19 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu in ok e) @@ pseq_to_list setp.set_inj.value.elements in let%bind expr = - let aux = fun (v) -> - e_assign name access_path (e_constant "SET_ADD" [v ; e_variable name]) in - let assigns = List.map aux inj in + let rec chain_add = fun lst s : expression -> + match lst with + | [] -> s + | hd :: tl -> chain_add tl (e_constant "SET_ADD" [hd ; s]) in + let assigns = + match inj with + | [] -> e_skip ~loc () + | _ :: _ -> chain_add inj (e_variable name) in match assigns with - | [] -> ok @@ e_skip ~loc () - | hd :: tl -> ( - let aux acc cur = e_sequence acc cur in - ok @@ List.fold_left aux hd tl - ) + | {expression = E_skip; _} -> ok @@ e_skip ~loc () + | {expression = E_constant e; location = loc} -> + ok @@ e_assign name access_path {expression = (E_constant e); location = loc} + | _ -> fail @@ corner_case ~loc:__LOC__ "Unexpected expression type" in return_statement @@ expr ) From e672d10029560f206567edef154af4333ba5999f Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 14:54:22 -0500 Subject: [PATCH 16/25] Expose tez mod tez, too --- src/passes/operators/operators.ml | 2 ++ src/test/contracts/tez.ligo | 4 ++++ src/test/integration_tests.ml | 3 +++ 3 files changed, 9 insertions(+) diff --git a/src/passes/operators/operators.ml b/src/passes/operators/operators.ml index abd34903b..65b55c18e 100644 --- a/src/passes/operators/operators.ml +++ b/src/passes/operators/operators.ml @@ -445,6 +445,8 @@ module Typer = struct let mod_ = typer_2 "MOD" @@ fun a b -> if (eq_1 a (t_nat ()) || eq_1 a (t_int ())) && (eq_1 b (t_nat ()) || eq_1 b (t_int ())) then ok @@ t_nat () else + if eq_1 a (t_tez ()) && eq_1 b (t_tez ()) + then ok @@ t_tez () else simple_fail "Computing modulo with wrong types" let add = typer_2 "ADD" @@ fun a b -> diff --git a/src/test/contracts/tez.ligo b/src/test/contracts/tez.ligo index 190951d56..cd76c47c7 100644 --- a/src/test/contracts/tez.ligo +++ b/src/test/contracts/tez.ligo @@ -10,3 +10,7 @@ const tez_mul_nat : tez = 100mtz * 10n; const tez_div_tez1 : nat = 100mtz / 1mtz; const tez_div_tez2 : nat = 100mtz / 90mtz; const tez_div_tez3 : nat = 100mtz / 110mtz; + +const tez_mod_tez1 : tez = 100mtz mod 1mtz; +const tez_mod_tez2 : tez = 100mtz mod 90mtz; +const tez_mod_tez3 : tez = 100mtz mod 110mtz; diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 4b73b0b33..94f0755a6 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -834,6 +834,9 @@ let tez_ligo () : unit result = let%bind _ = expect_eq_evaluate program "tez_div_tez1" (e_nat 100) in let%bind _ = expect_eq_evaluate program "tez_div_tez2" (e_nat 1) in let%bind _ = expect_eq_evaluate program "tez_div_tez3" (e_nat 0) in + let%bind _ = expect_eq_evaluate program "tez_mod_tez1" (e_mutez 0) in + let%bind _ = expect_eq_evaluate program "tez_mod_tez2" (e_mutez 10) in + let%bind _ = expect_eq_evaluate program "tez_mod_tez3" (e_mutez 100) in ok () let tez_mligo () : unit result = From c5361c57d45a842199268291636b2b36e38c3854 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 15:10:08 -0500 Subject: [PATCH 17/25] Simplify a bit --- src/passes/2-simplify/pascaligo.ml | 32 +++++++++++------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index d8ea7bc5c..02a0bedf0 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -800,26 +800,18 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | SetPatch patch -> ( let (setp, loc) = r_split patch in let (name , access_path) = simpl_path setp.path in - let%bind inj = bind_list - @@ List.map (fun (x:Raw.expr) -> - let%bind e = simpl_expression x - in ok e) - @@ pseq_to_list setp.set_inj.value.elements in - let%bind expr = - let rec chain_add = fun lst s : expression -> - match lst with - | [] -> s - | hd :: tl -> chain_add tl (e_constant "SET_ADD" [hd ; s]) in - let assigns = - match inj with - | [] -> e_skip ~loc () - | _ :: _ -> chain_add inj (e_variable name) in - match assigns with - | {expression = E_skip; _} -> ok @@ e_skip ~loc () - | {expression = E_constant e; location = loc} -> - ok @@ e_assign name access_path {expression = (E_constant e); location = loc} - | _ -> fail @@ corner_case ~loc:__LOC__ "Unexpected expression type" - in + let%bind inj = + bind_list @@ + List.map simpl_expression @@ + pseq_to_list setp.set_inj.value.elements in + let expr = + match inj with + | [] -> e_skip ~loc () + | _ :: _ -> + let assigns = List.fold_right + (fun hd s -> e_constant "SET_ADD" [hd ; s]) + inj (e_variable name) in + e_assign ~loc name access_path assigns in return_statement @@ expr ) From 62377135c4b1a88c1f351719a4fba254727780f3 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 11 Oct 2019 13:23:29 -0700 Subject: [PATCH 18/25] Add empty map patch test --- src/test/contracts/map.ligo | 4 ++++ src/test/contracts/map.mligo | 3 +++ src/test/integration_tests.ml | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/src/test/contracts/map.ligo b/src/test/contracts/map.ligo index 71be5dc20..24a267884 100644 --- a/src/test/contracts/map.ligo +++ b/src/test/contracts/map.ligo @@ -29,6 +29,10 @@ function patch_ (var m: foobar) : foobar is block { patch m with map [0 -> 5; 1 -> 6; 2 -> 7] } with m +function patch_empty (var m : foobar) : foobar is block { + patch m with map [] +} with m + function size_ (const m : foobar) : nat is block {skip} with (size(m)) diff --git a/src/test/contracts/map.mligo b/src/test/contracts/map.mligo index 88089d985..18a84d104 100644 --- a/src/test/contracts/map.mligo +++ b/src/test/contracts/map.mligo @@ -14,6 +14,9 @@ let rm (m : foobar) : foobar = Map.remove 42 m (* Dummy test so that we can add the same test for PascaLIGO *) let patch_ (m : foobar) : foobar = Map.literal [ (0, 5) ; (1, 6) ; (2, 7) ] +(* Second dummy test, see above *) +let patch_empty (m : foobar) : foobar = Map.literal [ (0, 0) ; (1, 1) ; (2, 2) ] + let size_ (m : foobar) : nat = Map.size m let gf (m : foobar) : int = Map.find 23 m diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 7e9f5c3b1..ad1ce6d69 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -416,6 +416,11 @@ let map_ type_f path : unit result = let expected = ez [(0, 5) ; (1, 6) ; (2, 7)] in expect_eq program "patch_" input expected in + let%bind () = + let input = ez [(0,0) ; (1,1) ; (2,2)] in + let expected = ez [(0,0) ; (1,1) ; (2,2)] in + expect_eq program "patch_empty" input expected + in let%bind () = let make_input = fun n -> ez List.(map (fun x -> (x, x)) @@ range n) in let make_expected = e_nat in From b64f82dff7ce4049684af5ac51e0e2cfe98dc31d Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 15:24:40 -0500 Subject: [PATCH 19/25] Add failing test --- src/test/contracts/set_arithmetic.ligo | 3 +++ src/test/integration_tests.ml | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/src/test/contracts/set_arithmetic.ligo b/src/test/contracts/set_arithmetic.ligo index 1a8e3550f..f38c1319f 100644 --- a/src/test/contracts/set_arithmetic.ligo +++ b/src/test/contracts/set_arithmetic.ligo @@ -20,6 +20,9 @@ function remove_syntax (var s : set(string)) : set(string) is function patch_op (var s: set(string)) : set(string) is begin patch s with set ["foobar"]; end with s +function patch_op_deep (var s: set(string)*nat) : set(string)*nat is + begin patch s.0 with set ["foobar"]; end with s + function patch_op_empty (var s: set(string)) : set(string) is begin patch s with set []; end with s diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index 9d2405ead..4ef61ad01 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -249,6 +249,14 @@ let set_arithmetic () : unit result = expect_eq program "patch_op" (e_set [e_string "foo" ; e_string "bar"]) (e_set [e_string "foo" ; e_string "bar"; e_string "foobar"]) in + let%bind () = + expect_eq program "patch_op_deep" + (e_pair + (e_set [e_string "foo" ; e_string "bar"]) + (e_nat 42)) + (e_pair + (e_set [e_string "foo" ; e_string "bar" ; e_string "foobar"]) + (e_nat 42)) in let%bind () = expect_eq program "patch_op_empty" (e_set [e_string "foo" ; e_string "bar"]) From c2a3fd473cfdbec5008e4da2f6ae7509d37ff4f6 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Fri, 11 Oct 2019 15:27:41 -0500 Subject: [PATCH 20/25] Fix test --- src/passes/2-simplify/pascaligo.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 02a0bedf0..0674a3caa 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -810,7 +810,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | _ :: _ -> let assigns = List.fold_right (fun hd s -> e_constant "SET_ADD" [hd ; s]) - inj (e_variable name) in + inj (e_accessor ~loc (e_variable name) access_path) in e_assign ~loc name access_path assigns in return_statement @@ expr ) From 3d053cd0734abdc813500a7f7c63985f4e0a08c6 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 11 Oct 2019 15:44:16 -0700 Subject: [PATCH 21/25] Refactor map patch so that it uses fewer assignments --- src/passes/2-simplify/pascaligo.ml | 31 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index dfa37bd0f..b6d6f895d 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -809,28 +809,25 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | MapPatch patch -> ( let (map_p, loc) = r_split patch in let (name, access_path) = simpl_path map_p.path in - let%bind inj = bind_list - @@ List.map (fun (x:Raw.binding Region.reg) -> - let (x , loc) = r_split x in + let%bind inj = bind_list + @@ List.map (fun (x:Raw.binding Region.reg) -> + let x = x.value in let (key, value) = x.source, x.image in let%bind key' = simpl_expression key in let%bind value' = simpl_expression value - in ok @@ (access_path, key', value', loc) + in ok @@ (key', value') ) @@ pseq_to_list map_p.map_inj.value.elements in - let%bind expr = - let aux = fun (access, key, value, loc) -> - let map = e_variable name in - e_assign ~loc name access (e_map_add key value map) in - let assigns = List.map aux inj in - match assigns with - | [] -> ok @@ e_skip ~loc () - | hd :: tl -> ( - let aux acc cur = e_sequence acc cur in - ok @@ List.fold_left aux hd tl - ) - in - return_statement @@ expr + let expr = + match inj with + | [] -> e_skip ~loc () + | _ :: _ -> + let assigns = List.fold_left + (fun map (key, value) -> (e_map_add key value map)) + (e_variable name) + inj + in e_assign ~loc name access_path assigns + in return_statement @@ expr ) | SetPatch patch -> fail @@ unsupported_set_patches patch From 5070ded5b9d241ebb1b78348f1a32f5ff1b3e102 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Fri, 11 Oct 2019 17:26:28 -0700 Subject: [PATCH 22/25] Add complex path traversal to map patch --- src/passes/2-simplify/pascaligo.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index b6d6f895d..337f91abd 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -824,7 +824,7 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu | _ :: _ -> let assigns = List.fold_left (fun map (key, value) -> (e_map_add key value map)) - (e_variable name) + (e_accessor ~loc (e_variable name) access_path) inj in e_assign ~loc name access_path assigns in return_statement @@ expr From b304772928da5a4c54f0ad17fa4cf232d1752836 Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Sat, 12 Oct 2019 12:38:05 -0700 Subject: [PATCH 23/25] Change set patch to use left fold --- src/passes/2-simplify/pascaligo.ml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index 0674a3caa..92f8c14aa 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -808,9 +808,9 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu match inj with | [] -> e_skip ~loc () | _ :: _ -> - let assigns = List.fold_right - (fun hd s -> e_constant "SET_ADD" [hd ; s]) - inj (e_accessor ~loc (e_variable name) access_path) in + let assigns = List.fold_left + (fun s hd -> e_constant "SET_ADD" [hd ; s]) + (e_accessor ~loc (e_variable name) access_path) inj in e_assign ~loc name access_path assigns in return_statement @@ expr ) From 93b5a068b5ece1bfe2759c334a57f26d5b040b9e Mon Sep 17 00:00:00 2001 From: John David Pressman Date: Mon, 14 Oct 2019 10:19:18 -0700 Subject: [PATCH 24/25] Add deep map patch test --- src/test/contracts/map.ligo | 3 +++ src/test/contracts/map.mligo | 3 +++ src/test/integration_tests.ml | 9 +++++++++ 3 files changed, 15 insertions(+) diff --git a/src/test/contracts/map.ligo b/src/test/contracts/map.ligo index 24a267884..a022379cd 100644 --- a/src/test/contracts/map.ligo +++ b/src/test/contracts/map.ligo @@ -33,6 +33,9 @@ function patch_empty (var m : foobar) : foobar is block { patch m with map [] } with m +function patch_deep (var m: foobar * nat) : foobar * nat is + begin patch m.0 with map [1 -> 9]; end with m + function size_ (const m : foobar) : nat is block {skip} with (size(m)) diff --git a/src/test/contracts/map.mligo b/src/test/contracts/map.mligo index 18a84d104..829201b23 100644 --- a/src/test/contracts/map.mligo +++ b/src/test/contracts/map.mligo @@ -17,6 +17,9 @@ let patch_ (m : foobar) : foobar = Map.literal [ (0, 5) ; (1, 6) ; (2, 7) ] (* Second dummy test, see above *) let patch_empty (m : foobar) : foobar = Map.literal [ (0, 0) ; (1, 1) ; (2, 2) ] +(* Third dummy test, see above *) +let patch_deep (m: foobar * nat) : foobar * nat = (Map.literal [ (0, 0) ; (1, 9) ; (2, 2) ], 10p) + let size_ (m : foobar) : nat = Map.size m let gf (m : foobar) : int = Map.find 23 m diff --git a/src/test/integration_tests.ml b/src/test/integration_tests.ml index ad1ce6d69..b964104c9 100644 --- a/src/test/integration_tests.ml +++ b/src/test/integration_tests.ml @@ -421,6 +421,15 @@ let map_ type_f path : unit result = let expected = ez [(0,0) ; (1,1) ; (2,2)] in expect_eq program "patch_empty" input expected in + let%bind () = + let input = (e_pair + (ez [(0,0) ; (1,1) ; (2,2)]) + (e_nat 10)) in + let expected = (e_pair + (ez [(0,0) ; (1,9) ; (2,2)]) + (e_nat 10)) in + expect_eq program "patch_deep" input expected + in let%bind () = let make_input = fun n -> ez List.(map (fun x -> (x, x)) @@ range n) in let make_expected = e_nat in From ed69c858a8a98f10509b91ae584a288811fe14a5 Mon Sep 17 00:00:00 2001 From: Tom Jack Date: Mon, 14 Oct 2019 14:05:35 -0500 Subject: [PATCH 25/25] Use right folds --- src/passes/2-simplify/pascaligo.ml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/passes/2-simplify/pascaligo.ml b/src/passes/2-simplify/pascaligo.ml index da0675a4a..18f2d8585 100644 --- a/src/passes/2-simplify/pascaligo.ml +++ b/src/passes/2-simplify/pascaligo.ml @@ -800,10 +800,10 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu match inj with | [] -> e_skip ~loc () | _ :: _ -> - let assigns = List.fold_left - (fun map (key, value) -> (e_map_add key value map)) - (e_accessor ~loc (e_variable name) access_path) + let assigns = List.fold_right + (fun (key, value) map -> (e_map_add key value map)) inj + (e_accessor ~loc (e_variable name) access_path) in e_assign ~loc name access_path assigns in return_statement @@ expr ) @@ -818,9 +818,9 @@ and simpl_single_instruction : Raw.single_instr -> (_ -> expression result) resu match inj with | [] -> e_skip ~loc () | _ :: _ -> - let assigns = List.fold_left - (fun s hd -> e_constant "SET_ADD" [hd ; s]) - (e_accessor ~loc (e_variable name) access_path) inj in + let assigns = List.fold_right + (fun hd s -> e_constant "SET_ADD" [hd ; s]) + inj (e_accessor ~loc (e_variable name) access_path) in e_assign ~loc name access_path assigns in return_statement @@ expr )