mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-16 01:25:25 +00:00
Merge pull request #1367 from j30ng/syntax-err-on-star
Return SyntaxError on Invalid Star Expression
This commit is contained in:
commit
65c98069db
1 changed files with 7 additions and 4 deletions
|
@ -1616,10 +1616,13 @@ impl<O: OutputStream> Compiler<O> {
|
|||
Comprehension { kind, generators } => {
|
||||
self.compile_comprehension(kind, generators)?;
|
||||
}
|
||||
Starred { value } => {
|
||||
self.compile_expression(value)?;
|
||||
self.emit(Instruction::Unpack);
|
||||
panic!("We should not just unpack a starred args, since the size is unknown.");
|
||||
Starred { .. } => {
|
||||
return Err(CompileError {
|
||||
error: CompileErrorType::SyntaxError(std::string::String::from(
|
||||
"Invalid starred expression",
|
||||
)),
|
||||
location: self.current_source_location.clone(),
|
||||
});
|
||||
}
|
||||
IfExpression { test, body, orelse } => {
|
||||
let no_label = self.new_label();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue