mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 10:23:20 +00:00
chore: add Token::col_end
This commit is contained in:
parent
f6763fcfdf
commit
06c14c35e5
11 changed files with 272 additions and 102 deletions
|
@ -3156,7 +3156,7 @@ impl PyCodeGenerator {
|
|||
}
|
||||
None => {}
|
||||
}
|
||||
let none = Token::new(TokenKind::NoneLit, "None", line, 0);
|
||||
let none = Token::new(TokenKind::NoneLit, "None", line, 0, 0);
|
||||
attrs.push(Expr::Lit(Literal::new(ValueObj::None, none)));
|
||||
let block = Block::new(attrs);
|
||||
let body = DefBody::new(EQUAL, block, DefId(0));
|
||||
|
|
|
@ -1483,7 +1483,7 @@ impl Context {
|
|||
}
|
||||
TypeSpec::Dict(dict) => {
|
||||
let mut inst_tys = dict! {};
|
||||
for (k, v) in dict {
|
||||
for (k, v) in dict.kvs.iter() {
|
||||
inst_tys.insert(
|
||||
self.instantiate_typespec_full(
|
||||
k,
|
||||
|
@ -1505,7 +1505,7 @@ impl Context {
|
|||
}
|
||||
TypeSpec::Record(rec) => {
|
||||
let mut inst_tys = dict! {};
|
||||
for (k, v) in rec {
|
||||
for (k, v) in rec.attrs.iter() {
|
||||
inst_tys.insert(
|
||||
self.instantiate_field(k)?,
|
||||
self.instantiate_typespec_full(
|
||||
|
|
|
@ -480,6 +480,7 @@ impl<'a> HIRLinker<'a> {
|
|||
path,
|
||||
mod_name_lit.ln_begin().unwrap(),
|
||||
mod_name_lit.col_begin().unwrap(),
|
||||
mod_name_lit.col_end().unwrap(),
|
||||
);
|
||||
let mod_name = Expr::Lit(Literal::try_from(token).unwrap());
|
||||
args.insert_pos(0, PosArg::new(mod_name));
|
||||
|
|
|
@ -1099,12 +1099,14 @@ impl ASTLowerer {
|
|||
Str::ever("."),
|
||||
pack.connector.ln_begin().unwrap(),
|
||||
pack.connector.col_begin().unwrap(),
|
||||
pack.connector.col_end().unwrap(),
|
||||
)),
|
||||
ast::VarName::new(Token::new(
|
||||
TokenKind::Symbol,
|
||||
Str::ever("new"),
|
||||
pack.connector.ln_begin().unwrap(),
|
||||
pack.connector.col_begin().unwrap(),
|
||||
pack.connector.col_end().unwrap(),
|
||||
)),
|
||||
);
|
||||
let vi = match self.module.context.get_call_t(
|
||||
|
@ -1911,6 +1913,7 @@ impl ASTLowerer {
|
|||
".",
|
||||
def.sig.ln_begin().unwrap(),
|
||||
def.sig.col_begin().unwrap(),
|
||||
def.sig.col_end().unwrap(),
|
||||
));
|
||||
}
|
||||
self.module
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue