Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

return scanner errors intead of crashing #180

Open
Licenser opened this issue Jun 12, 2017 · 0 comments
Open

return scanner errors intead of crashing #180

Licenser opened this issue Jun 12, 2017 · 0 comments

Comments

@Licenser
Copy link
Contributor

It would be nice to return scanner error instead of crashing.

For example:

The following (broken) code:

module example

export add/2

let add x y = y * x + \1

let run () = add 2 1.0

let run () = add 2.0 1

causes the compiler crash with:

Error: {badmatch,{error,{5,alpaca_scan,{user,"Unexpected token: \\"}},5}}
[{alpaca_ast_gen,parse_module,1,
                 [{file,"/Users/heinz/Projects/Other/alptest/_build/default/plugins/alpaca/src/alpaca_ast_gen.erl"},
                  {line,80}]},
 {alpaca_ast_gen,'-make_modules/1-lc$^0/1-0-',1,
                 [{file,"/Users/heinz/Projects/Other/alptest/_build/default/plugins/alpaca/src/alpaca_ast_gen.erl"},
                  {line,63}]},
 {alpaca_ast_gen,make_modules,1,
                 [{file,"/Users/heinz/Projects/Other/alptest/_build/default/plugins/alpaca/src/alpaca_ast_gen.erl"},
                  {line,63}]},
 {alpaca,compile_phase_1,2,
         [{file,"/Users/heinz/Projects/Other/alptest/_build/default/plugins/alpaca/src/alpaca.erl"},
          {line,66}]},
 {rebar_prv_alpaca_compile,compile_apps,4,
                           [{file,"/Users/heinz/Projects/Other/alptest/_checkouts/rebar_prv_alpaca/src/rebar_prv_alpaca_compile.erl"},
                            {line,59}]},
 {rebar_prv_alpaca_compile,do,1,
                           [{file,"/Users/heinz/Projects/Other/alptest/_checkouts/rebar_prv_alpaca/src/rebar_prv_alpaca_compile.erl"},
                            {line,37}]},
 {rebar_core,do,2,
             [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_core.erl"},
              {line,153}]},
 {rebar_hooks,run_provider_hooks_,6,
              [{file,"/home/tristan/Devel/rebar3/_build/default/lib/rebar/src/rebar_hooks.erl"},
               {line,49}]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant