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

Throw on invalid keyword arguments #416

Open
LilithHafner opened this issue Feb 17, 2024 · 0 comments · May be fixed by #422
Open

Throw on invalid keyword arguments #416

LilithHafner opened this issue Feb 17, 2024 · 0 comments · May be fixed by #422
Labels
enhancement New feature or request

Comments

@LilithHafner
Copy link
Member

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

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  │    ✘
@LilithHafner LilithHafner added the enhancement New feature or request label Feb 17, 2024
@pfitzseb pfitzseb changed the title Throw on invalid keywords Throw on invalid keyword arguments Feb 19, 2024
@ericphanson ericphanson linked a pull request Feb 25, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant