JuliaLang / JuliaLang/JuliaSyntax.jl

Throw on invalid keyword arguments

Open
#416 0 comments 1 reaction 0 assignees View on GitHub
enhancement
Dominant language
Julia
Stars
293
Forks
50
PR merge metrics
No merged PRs in 30d

Description

Running `parseall(SyntaxNode, "abc", ignore_error=true)` should throw because "ignore_error" is not a valid keyword.

```julia
julia> parseall(SyntaxNode, "abc", ignore_error=true)
line:col│ tree │ file_name
1:1 │[toplevel]
1:1 │ abc

julia> parseall(SyntaxNode, "abc +", ignore_error=true)
ERROR: ParseError:
# Error @ line 1:6
abc +
# └ ── premature end of input
Stacktrace:
[1] _parse(rule::Symbol, need_eof::Bool, ::Type{…}, text::String, index::Int64; version::VersionNumber, ignore_trivia::Bool, filename::Nothing, first_line::Int64, ignore_errors::Bool, ignore_warnings::Bool, kws::@Kwargs{…})
@ JuliaSyntax ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:93
[2] _parse (repeats 2 times)
@ ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:77 [inlined]
[3] #parseall#96
@ ~/.julia/packages/JuliaSyntax/eqCSU/src/parser_api.jl:143 [inlined]
[4] top-level scope
@ REPL[306]:1
Some type information was truncated. Use `show(err)` to see complete types.

julia> parseall(SyntaxNode, "abc +", ignore_errors=true)
line:col│ tree │ file_name
1:1 │[toplevel]
1:1 │ [call-i]
1:1 │ abc
1:5 │ +
1:6 │ ✘
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.