Skip to content

Commit

Permalink
Merge pull request #20 from lefessan/z-2021-08-23-use-cpp
Browse files Browse the repository at this point in the history
Bump version to 0.3.5
  • Loading branch information
lefessan authored Aug 25, 2021
2 parents c37fa9f + 2986cdd commit 0a4271c
Show file tree
Hide file tree
Showing 17 changed files with 46 additions and 31 deletions.
28 changes: 14 additions & 14 deletions .drom
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
2 changes: 1 addition & 1 deletion CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@

## v0.1.0 ( 2021-08-22 )
## v0.1.0 ( 2021-08-25 )

* Initial commit
2 changes: 1 addition & 1 deletion drom.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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..."
Expand Down
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion ez_hash.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion solidity-alcotest.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion solidity-common.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion solidity-parser.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion solidity-test.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion solidity-typechecker.opam
Original file line number Diff line number Diff line change
Expand Up @@ -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: """
Expand Down
2 changes: 1 addition & 1 deletion src/solidity-alcotest/version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion src/solidity-common/version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
18 changes: 15 additions & 3 deletions src/solidity-parser/solidity_parser.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions src/solidity-parser/solidity_parser.mli
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion src/solidity-parser/version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion src/solidity-test/version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down
2 changes: 1 addition & 1 deletion src/solidity-typechecker/version.mlt
Original file line number Diff line number Diff line change
Expand Up @@ -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 ->
Expand Down

0 comments on commit 0a4271c

Please sign in to comment.