diff --git a/src/aeso_parse_lib.erl b/src/aeso_parse_lib.erl index 04b0a76..e595a07 100644 --- a/src/aeso_parse_lib.erl +++ b/src/aeso_parse_lib.erl @@ -355,6 +355,7 @@ unexpected_token_error(Ts, Expect, T) -> {con, _, X} when ExpectId -> io_lib:format(" Did you mean ~s?", [mk_lower(X)]); {qcon, _, Xs} when ExpectCon -> io_lib:format(" Did you mean ~s?", [lists:last(Xs)]); {qid, _, Xs} when ExpectId -> io_lib:format(" Did you mean ~s?", [lists:last(Xs)]); + {return, _} -> " [Polite reminder that Sophia is not JavaScript]"; _ -> "" end, mk_error(Ts, io_lib:format("Unexpected ~s.~s", [describe(T), Fix])). diff --git a/src/aeso_scan.erl b/src/aeso_scan.erl index 8dc47d4..9ecd2ca 100644 --- a/src/aeso_scan.erl +++ b/src/aeso_scan.erl @@ -37,7 +37,8 @@ lexer() -> , {"[^/*]+|[/*]", skip()} ], Keywords = ["contract", "include", "let", "switch", "type", "record", "datatype", "if", "elif", "else", "function", - "stateful", "payable", "true", "false", "mod", "public", "entrypoint", "private", "indexed", "namespace"], + "stateful", "payable", "true", "false", "mod", "public", "entrypoint", "private", "indexed", "namespace", + "return"], KW = string:join(Keywords, "|"), Rules =