From 2986cdd5b2a8d3344d2059376a660348cc36683c Mon Sep 17 00:00:00 2001 From: Fabrice Le Fessant Date: Wed, 25 Aug 2021 11:10:22 +0200 Subject: [PATCH] Bump version to 0.3.5 --- .drom | 28 ++++++++++++------------- CHANGES.md | 2 +- drom.toml | 2 +- dune-project | 2 +- ez_hash.opam | 2 +- solidity-alcotest.opam | 2 +- solidity-common.opam | 2 +- solidity-parser.opam | 2 +- solidity-test.opam | 2 +- solidity-typechecker.opam | 2 +- src/solidity-alcotest/version.mlt | 2 +- src/solidity-common/version.mlt | 2 +- src/solidity-parser/solidity_parser.ml | 18 +++++++++++++--- src/solidity-parser/solidity_parser.mli | 3 +++ src/solidity-parser/version.mlt | 2 +- src/solidity-test/version.mlt | 2 +- src/solidity-typechecker/version.mlt | 2 +- 17 files changed, 46 insertions(+), 31 deletions(-) diff --git a/.drom b/.drom index a14c4a6..01041a6 100644 --- a/.drom +++ b/.drom @@ -2,7 +2,7 @@ # hash of toml configuration files # used for generation of all files -7e29d2b184661329ff889ff76418998f:. +0e9b66abb305f418e9c6701323bd855d:. # end context for . # begin context for .github/workflows/doc-deploy.yml @@ -37,7 +37,7 @@ a8d1bcd6f62c6b813b77d3ff8959d8d2:.ocamlformat-ignore # begin context for CHANGES.md # file CHANGES.md -68c7d401f0bb426dbe174012bc81d943:CHANGES.md +5aadc83c9bdcbe1346be4cbe5e2dfea7:CHANGES.md # end context for CHANGES.md # begin context for LICENSE.md @@ -97,12 +97,12 @@ c8281f46ba9a11d0b61bc8ef67eaa357:docs/style.css # begin context for dune-project # file dune-project -fde4ce085d71aa26ec2ea4ecd950139b:dune-project +4eda589dedb472f06b76ba8e66710e52:dune-project # end context for dune-project # begin context for ez_hash.opam # file ez_hash.opam -c6a3345db78412133fe426f87a02b89f:ez_hash.opam +961240618ebc27ee726b8e96918af860:ez_hash.opam # end context for ez_hash.opam # begin context for scripts/after.sh @@ -122,27 +122,27 @@ bb3a9d286f0dc64021db4194427263ee:scripts/copy-bin.sh # begin context for solidity-alcotest.opam # file solidity-alcotest.opam -e54b04bccb6741b609e362c103fd7d15:solidity-alcotest.opam +f6e0864e7e9dbb168402f42292970f8a:solidity-alcotest.opam # end context for solidity-alcotest.opam # begin context for solidity-common.opam # file solidity-common.opam -3d2298bc9d263e7f5d30509eae092862:solidity-common.opam +f80014505a175a739b826cca6d89072c:solidity-common.opam # end context for solidity-common.opam # begin context for solidity-parser.opam # file solidity-parser.opam -5d56f69caa317a87e590737463b0e19c:solidity-parser.opam +b198f4ea160926c6b9bf02ea7c8c2f0a:solidity-parser.opam # end context for solidity-parser.opam # begin context for solidity-test.opam # file solidity-test.opam -dcbd142206187cc0e3870155dc922958:solidity-test.opam +b7b33c746586515a74b432329603ba11:solidity-test.opam # end context for solidity-test.opam # begin context for solidity-typechecker.opam # file solidity-typechecker.opam -9e531ab8e4db4e31305eb645bc049d25:solidity-typechecker.opam +277a8cedf9280f8d375eb00bcd7305c4:solidity-typechecker.opam # end context for solidity-typechecker.opam # begin context for sphinx/_static/css/fixes.css @@ -197,7 +197,7 @@ e86f9a67236dac57aaae3ca819cb7dbb:src/ocaml-solidity/package.toml # begin context for src/solidity-alcotest/version.mlt # file src/solidity-alcotest/version.mlt -cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-alcotest/version.mlt +06d7b97cb774143de55aa8972a6d084d:src/solidity-alcotest/version.mlt # end context for src/solidity-alcotest/version.mlt # begin context for src/solidity-common/dune @@ -217,7 +217,7 @@ cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-alcotest/version.mlt # begin context for src/solidity-common/version.mlt # file src/solidity-common/version.mlt -cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-common/version.mlt +06d7b97cb774143de55aa8972a6d084d:src/solidity-common/version.mlt # end context for src/solidity-common/version.mlt # begin context for src/solidity-parser/dune @@ -237,7 +237,7 @@ be413a351ddaf3cdf0d44e91ad35680e:src/solidity-parser/main.ml # begin context for src/solidity-parser/version.mlt # file src/solidity-parser/version.mlt -cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-parser/version.mlt +06d7b97cb774143de55aa8972a6d084d:src/solidity-parser/version.mlt # end context for src/solidity-parser/version.mlt # begin context for src/solidity-test/dune @@ -247,7 +247,7 @@ cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-parser/version.mlt # begin context for src/solidity-test/version.mlt # file src/solidity-test/version.mlt -cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-test/version.mlt +06d7b97cb774143de55aa8972a6d084d:src/solidity-test/version.mlt # end context for src/solidity-test/version.mlt # begin context for src/solidity-typechecker/dune @@ -267,5 +267,5 @@ cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-test/version.mlt # begin context for src/solidity-typechecker/version.mlt # file src/solidity-typechecker/version.mlt -cbfefb0311bbee9ff38a9ac78f436b5a:src/solidity-typechecker/version.mlt +06d7b97cb774143de55aa8972a6d084d:src/solidity-typechecker/version.mlt # end context for src/solidity-typechecker/version.mlt diff --git a/CHANGES.md b/CHANGES.md index e6c1700..957a44e 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,4 @@ -## v0.1.0 ( 2021-08-22 ) +## v0.1.0 ( 2021-08-25 ) * Initial commit diff --git a/drom.toml b/drom.toml index 2dd2c61..db12218 100644 --- a/drom.toml +++ b/drom.toml @@ -15,7 +15,7 @@ license = "LGPL2" min-edition = "4.08.0" name = "ocaml-solidity" synopsis = "The ocaml-solidity project" -version = "0.3.4" +version = "0.3.5" # keys that you could also define: # odoc-target = "...odoc-target..." diff --git a/dune-project b/dune-project index 89b4757..dac89a1 100644 --- a/dune-project +++ b/dune-project @@ -3,7 +3,7 @@ (name ocaml-solidity) (allow_approximate_merlin) (generate_opam_files false) -(version 0.3.4) +(version 0.3.5) (formatting (enabled_for ocaml reason)) (using menhir 2.0) diff --git a/ez_hash.opam b/ez_hash.opam index 516bd38..d5ff75a 100644 --- a/ez_hash.opam +++ b/ez_hash.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "ez_hash" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "Hash functions: sha3, sha256, blake2b" description: """ diff --git a/solidity-alcotest.opam b/solidity-alcotest.opam index 3f608f2..14e9b4f 100644 --- a/solidity-alcotest.opam +++ b/solidity-alcotest.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "solidity-alcotest" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "The ocaml-solidity project" description: """ diff --git a/solidity-common.opam b/solidity-common.opam index 3dad74c..9e208f3 100644 --- a/solidity-common.opam +++ b/solidity-common.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "solidity-common" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "The ocaml-solidity project" description: """ diff --git a/solidity-parser.opam b/solidity-parser.opam index 8fb6c16..af098da 100644 --- a/solidity-parser.opam +++ b/solidity-parser.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "solidity-parser" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "The ocaml-solidity project" description: """ diff --git a/solidity-test.opam b/solidity-test.opam index 79cdfba..efda030 100644 --- a/solidity-test.opam +++ b/solidity-test.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "solidity-test" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "The ocaml-solidity project" description: """ diff --git a/solidity-typechecker.opam b/solidity-typechecker.opam index 609782f..bd5abd2 100644 --- a/solidity-typechecker.opam +++ b/solidity-typechecker.opam @@ -2,7 +2,7 @@ # Do not modify, or add to the `skip` field of `drom.toml`. opam-version: "2.0" name: "solidity-typechecker" -version: "0.3.4" +version: "0.3.5" license: "LGPL-2.1-only with OCaml-LGPL-linking-exception" synopsis: "The ocaml-solidity project" description: """ diff --git a/src/solidity-alcotest/version.mlt b/src/solidity-alcotest/version.mlt index dace2af..040165c 100644 --- a/src/solidity-alcotest/version.mlt +++ b/src/solidity-alcotest/version.mlt @@ -13,7 +13,7 @@ let query cmd = let commit_hash = query "git show -s --pretty=format:%H" let commit_date = query "git show -s --pretty=format:%ci" -let version = "0.3.4" +let version = "0.3.5" let version = match commit_hash with | Some commit_hash -> diff --git a/src/solidity-common/version.mlt b/src/solidity-common/version.mlt index dace2af..040165c 100644 --- a/src/solidity-common/version.mlt +++ b/src/solidity-common/version.mlt @@ -13,7 +13,7 @@ let query cmd = let commit_hash = query "git show -s --pretty=format:%H" let commit_date = query "git show -s --pretty=format:%ci" -let version = "0.3.4" +let version = "0.3.5" let version = match commit_hash with | Some commit_hash -> diff --git a/src/solidity-parser/solidity_parser.ml b/src/solidity-parser/solidity_parser.ml index c7635b3..b9a36cf 100644 --- a/src/solidity-parser/solidity_parser.ml +++ b/src/solidity-parser/solidity_parser.ml @@ -13,6 +13,17 @@ open Solidity_common open Solidity_ast +let tmp_files = ref [] +let remove_temporary_files = ref true +let () = + at_exit (fun () -> + if !remove_temporary_files then + List.iter (fun file -> Sys.remove file) !tmp_files + ) +let keep_temporary_files () = remove_temporary_files := false +let add_temporary_file file = + tmp_files := file :: !tmp_files + let get_imported_files m = let base = Filename.dirname m.module_file in List.fold_left (fun fileset unit_node -> @@ -41,12 +52,13 @@ let parse_module id ?(cpp=false) ?preprocess file = | exception _ -> false in if cpp then - let tmp_file = Filename.temp_file (Filename.basename file) ".cpp" in + let tmp_file = Filename.temp_file (Filename.basename file) "-cpp.sol" in let cmd = Printf.sprintf "cpp -E %s > %s" file tmp_file in let res = Sys.command cmd in - if res = 0 then + if res = 0 then begin + add_temporary_file tmp_file ; EzFile.read_file tmp_file - else + end else Printf.kprintf failwith "Warning: %s failed with error %d\n%!" cmd res else diff --git a/src/solidity-parser/solidity_parser.mli b/src/solidity-parser/solidity_parser.mli index a5e0629..03a7e8b 100644 --- a/src/solidity-parser/solidity_parser.mli +++ b/src/solidity-parser/solidity_parser.mli @@ -15,3 +15,6 @@ val parse_file : ?preprocess:( string -> string ) -> ?cpp:bool -> string -> Solidity_ast.program + +val add_temporary_file : string -> unit +val keep_temporary_files : unit -> unit diff --git a/src/solidity-parser/version.mlt b/src/solidity-parser/version.mlt index dace2af..040165c 100644 --- a/src/solidity-parser/version.mlt +++ b/src/solidity-parser/version.mlt @@ -13,7 +13,7 @@ let query cmd = let commit_hash = query "git show -s --pretty=format:%H" let commit_date = query "git show -s --pretty=format:%ci" -let version = "0.3.4" +let version = "0.3.5" let version = match commit_hash with | Some commit_hash -> diff --git a/src/solidity-test/version.mlt b/src/solidity-test/version.mlt index dace2af..040165c 100644 --- a/src/solidity-test/version.mlt +++ b/src/solidity-test/version.mlt @@ -13,7 +13,7 @@ let query cmd = let commit_hash = query "git show -s --pretty=format:%H" let commit_date = query "git show -s --pretty=format:%ci" -let version = "0.3.4" +let version = "0.3.5" let version = match commit_hash with | Some commit_hash -> diff --git a/src/solidity-typechecker/version.mlt b/src/solidity-typechecker/version.mlt index dace2af..040165c 100644 --- a/src/solidity-typechecker/version.mlt +++ b/src/solidity-typechecker/version.mlt @@ -13,7 +13,7 @@ let query cmd = let commit_hash = query "git show -s --pretty=format:%H" let commit_date = query "git show -s --pretty=format:%ci" -let version = "0.3.4" +let version = "0.3.5" let version = match commit_hash with | Some commit_hash ->