Client, Michelson: minor fixes in error reporting

This commit is contained in:
Benjamin Canou 2018-05-02 15:09:20 +02:00 committed by Grégoire Henry
parent a425b3dc27
commit ffec060a6f
3 changed files with 5 additions and 6 deletions

View File

@ -61,9 +61,7 @@ let expand_all source ast errors =
let parse_toplevel ?check source =
let tokens, lexing_errors = Micheline_parser.tokenize source in
let asts, parsing_errors = Micheline_parser.parse_toplevel ?check tokens in
let ast = match asts with
| [ ast ] -> ast
| asts ->
let ast =
let start = min_point asts and stop = max_point asts in
Seq ({ start ; stop }, asts, None) in
expand_all source ast (lexing_errors @ parsing_errors)

View File

@ -148,7 +148,7 @@ let commands () =
~details:(not no_print_source) ~parsed
~show_source:(not no_print_source)
ppf errors) () >>= fun () ->
return ()
cctxt#error "syntax error in program"
) ;
command ~group ~desc: "Ask the node to typecheck a data expression."

View File

@ -2240,6 +2240,7 @@ and parse_contract
and parse_toplevel
: Script.expr -> (Script.node * Script.node * Script.node) tzresult
= fun toplevel ->
record_trace (Ill_typed_contract (toplevel, [])) @@
match root toplevel with
| Int (loc, _) -> error (Invalid_kind (loc, [ Seq_kind ], Int_kind))
| String (loc, _) -> error (Invalid_kind (loc, [ Seq_kind ], String_kind))