mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-30 23:27:39 +00:00
chore: error report delay with variable defs
This commit is contained in:
parent
9682c0ddaf
commit
4da45eb842
3 changed files with 47 additions and 9 deletions
|
@ -4,6 +4,7 @@
|
|||
//! e.g. Literal parameters, Multi assignment
|
||||
//! 型チェックなどによる検証は行わない
|
||||
|
||||
use erg_common::consts::PYTHON_MODE;
|
||||
use erg_common::error::Location;
|
||||
use erg_common::fresh::FreshNameGenerator;
|
||||
use erg_common::traits::{Locational, Stream};
|
||||
|
@ -1737,7 +1738,11 @@ impl Desugarer {
|
|||
let (mut op, lhs, rhs) = bin.deconstruct();
|
||||
op.content = Str::from("contains");
|
||||
op.kind = TokenKind::ContainsOp;
|
||||
let not = Identifier::private("not".into());
|
||||
let not = if PYTHON_MODE {
|
||||
Identifier::public("not".into())
|
||||
} else {
|
||||
Identifier::private("not".into())
|
||||
};
|
||||
let bin = Expr::BinOp(BinOp::new(op, rhs, lhs));
|
||||
Expr::Accessor(Accessor::Ident(not)).call1(bin)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue