Skip to content

Commit

Permalink
support binary files in owi validate
Browse files Browse the repository at this point in the history
  • Loading branch information
zapashcanon committed Jun 15, 2024
1 parent 76870f1 commit fe50da7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions src/cmd/cmd_validate.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,16 @@
open Syntax

let validate filename =
let* modul = Parse.Text.Module.from_file filename in
let+ _modul = Compile.Text.until_typecheck ~unsafe:false modul in
()
let* modul = Parse.guess_from_file filename in
match modul with
| Either.Left (Either.Left text_module) ->
let+ _modul = Compile.Text.until_typecheck ~unsafe:false text_module in
()
| Either.Left (Either.Right _text_script) ->
Error (`Msg "can not run validation on a script (.wast) file")
| Either.Right binary_module ->
let+ _module = Compile.Binary.until_typecheck ~unsafe:false binary_module in
()

let cmd debug files =
if debug then Log.debug_on := true;
Expand Down

0 comments on commit fe50da7

Please sign in to comment.