Refactor ast to hold data as seperated type

This commit is contained in:
Jeong YunWon 2023-05-07 17:14:17 +09:00
parent 9f1a538eba
commit 6d7358090b
111 changed files with 23485 additions and 20218 deletions

View file

@ -131,6 +131,9 @@ class FindUserdataTypesVisitor(asdl.VisitorBase):
if is_simple(sum): if is_simple(sum):
info.has_userdata = False info.has_userdata = False
else: else:
for t in sum.types:
self.typeinfo[t.name] = TypeInfo(t.name)
self.add_children(t.name, t.fields)
if len(sum.types) > 1: if len(sum.types) > 1:
info.boxed = True info.boxed = True
if sum.attributes: if sum.attributes:
@ -205,16 +208,49 @@ class StructVisitor(TypeInfoEmitVisitor):
def sum_with_constructors(self, sum, name, depth): def sum_with_constructors(self, sum, name, depth):
typeinfo = self.typeinfo[name] typeinfo = self.typeinfo[name]
generics, generics_applied = self.get_generics(name, "U = ()", "U")
enumname = rustname = get_rust_type(name) enumname = rustname = get_rust_type(name)
# all the attributes right now are for location, so if it has attrs we # all the attributes right now are for location, so if it has attrs we
# can just wrap it in Located<> # can just wrap it in Located<>
if sum.attributes: if sum.attributes:
enumname = rustname + "Kind" enumname = rustname + "Kind"
for t in sum.types:
if not t.fields:
continue
self.emit_attrs(depth)
self.typeinfo[t] = TypeInfo(t)
t_generics, t_generics_applied = self.get_generics(t.name, "U = ()", "U")
payload_name = f"{rustname}{t.name}"
self.emit(f"pub struct {payload_name}{t_generics} {{", depth)
for f in t.fields:
self.visit(f, typeinfo, "pub ", depth + 1, t.name)
self.emit("}", depth)
self.emit(
textwrap.dedent(
f"""
impl{t_generics_applied} From<{payload_name}{t_generics_applied}> for {enumname}{t_generics_applied} {{
fn from(payload: {payload_name}{t_generics_applied}) -> Self {{
{enumname}::{t.name}(payload)
}}
}}
"""
),
depth,
)
generics, generics_applied = self.get_generics(name, "U = ()", "U")
self.emit_attrs(depth) self.emit_attrs(depth)
self.emit(f"pub enum {enumname}{generics} {{", depth) self.emit(f"pub enum {enumname}{generics} {{", depth)
for t in sum.types: for t in sum.types:
self.visit(t, typeinfo, depth + 1) if t.fields:
t_generics, t_generics_applied = self.get_generics(
t.name, "U = ()", "U"
)
self.emit(
f"{t.name}({rustname}{t.name}{t_generics_applied}),", depth + 1
)
else:
self.emit(f"{t.name},", depth + 1)
self.emit("}", depth) self.emit("}", depth)
if sum.attributes: if sum.attributes:
self.emit( self.emit(
@ -238,13 +274,18 @@ class StructVisitor(TypeInfoEmitVisitor):
if fieldtype and fieldtype.has_userdata: if fieldtype and fieldtype.has_userdata:
typ = f"{typ}<U>" typ = f"{typ}<U>"
# don't box if we're doing Vec<T>, but do box if we're doing Vec<Option<Box<T>>> # don't box if we're doing Vec<T>, but do box if we're doing Vec<Option<Box<T>>>
if fieldtype and fieldtype.boxed and (not (parent.product or field.seq) or field.opt): if (
fieldtype
and fieldtype.boxed
and (not (parent.product or field.seq) or field.opt)
):
typ = f"Box<{typ}>" typ = f"Box<{typ}>"
if field.opt or ( if field.opt or (
# When a dictionary literal contains dictionary unpacking (e.g., `{**d}`), # When a dictionary literal contains dictionary unpacking (e.g., `{**d}`),
# the expression to be unpacked goes in `values` with a `None` at the corresponding # the expression to be unpacked goes in `values` with a `None` at the corresponding
# position in `keys`. To handle this, the type of `keys` needs to be `Option<Vec<T>>`. # position in `keys`. To handle this, the type of `keys` needs to be `Option<Vec<T>>`.
constructor == "Dict" and field.name == "keys" constructor == "Dict"
and field.name == "keys"
): ):
typ = f"Option<{typ}>" typ = f"Option<{typ}>"
if field.seq: if field.seq:
@ -344,14 +385,21 @@ class FoldImplVisitor(TypeInfoEmitVisitor):
) )
if is_located: if is_located:
self.emit("fold_located(folder, node, |folder, node| {", depth) self.emit("fold_located(folder, node, |folder, node| {", depth)
enumname += "Kind" rustname = enumname + "Kind"
else:
rustname = enumname
self.emit("match node {", depth + 1) self.emit("match node {", depth + 1)
for cons in sum.types: for cons in sum.types:
fields_pattern = self.make_pattern(cons.fields) fields_pattern = self.make_pattern(
self.emit( enumname, rustname, cons.name, cons.fields
f"{enumname}::{cons.name} {{ {fields_pattern} }} => {{", depth + 2 )
self.emit(
f"{fields_pattern[0]} {{ {fields_pattern[1]} }} {fields_pattern[2]} => {{",
depth + 2,
)
self.gen_construction(
fields_pattern[0], cons.fields, fields_pattern[2], depth + 3
) )
self.gen_construction(f"{enumname}::{cons.name}", cons.fields, depth + 3)
self.emit("}", depth + 2) self.emit("}", depth + 2)
self.emit("}", depth + 1) self.emit("}", depth + 1)
if is_located: if is_located:
@ -381,23 +429,33 @@ class FoldImplVisitor(TypeInfoEmitVisitor):
) )
if is_located: if is_located:
self.emit("fold_located(folder, node, |folder, node| {", depth) self.emit("fold_located(folder, node, |folder, node| {", depth)
structname += "Data" rustname = structname + "Data"
fields_pattern = self.make_pattern(product.fields) else:
self.emit(f"let {structname} {{ {fields_pattern} }} = node;", depth + 1) rustname = structname
self.gen_construction(structname, product.fields, depth + 1) fields_pattern = self.make_pattern(rustname, structname, None, product.fields)
self.emit(f"let {rustname} {{ {fields_pattern[1]} }} = node;", depth + 1)
self.gen_construction(rustname, product.fields, "", depth + 1)
if is_located: if is_located:
self.emit("})", depth) self.emit("})", depth)
self.emit("}", depth) self.emit("}", depth)
def make_pattern(self, fields): def make_pattern(self, rustname, pyname, fieldname, fields):
return ",".join(rust_field(f.name) for f in fields) if fields:
header = f"{pyname}::{fieldname}({rustname}{fieldname}"
footer = ")"
else:
header = f"{pyname}::{fieldname}"
footer = ""
def gen_construction(self, cons_path, fields, depth): body = ",".join(rust_field(f.name) for f in fields)
self.emit(f"Ok({cons_path} {{", depth) return header, body, footer
def gen_construction(self, header, fields, footer, depth):
self.emit(f"Ok({header} {{", depth)
for field in fields: for field in fields:
name = rust_field(field.name) name = rust_field(field.name)
self.emit(f"{name}: Foldable::fold({name}, folder)?,", depth + 1) self.emit(f"{name}: Foldable::fold({name}, folder)?,", depth + 1)
self.emit("})", depth) self.emit(f"}}{footer})", depth)
class FoldModuleVisitor(TypeInfoEmitVisitor): class FoldModuleVisitor(TypeInfoEmitVisitor):
@ -514,33 +572,36 @@ class TraitImplVisitor(EmitVisitor):
self.visit(type.value, type.name, depth) self.visit(type.value, type.name, depth)
def visitSum(self, sum, name, depth): def visitSum(self, sum, name, depth):
enumname = get_rust_type(name) rustname = enumname = get_rust_type(name)
if sum.attributes: if sum.attributes:
enumname += "Kind" rustname = enumname + "Kind"
self.emit(f"impl NamedNode for ast::{enumname} {{", depth) self.emit(f"impl NamedNode for ast::{rustname} {{", depth)
self.emit(f"const NAME: &'static str = {json.dumps(name)};", depth + 1) self.emit(f"const NAME: &'static str = {json.dumps(name)};", depth + 1)
self.emit("}", depth) self.emit("}", depth)
self.emit(f"impl Node for ast::{enumname} {{", depth) self.emit(f"impl Node for ast::{rustname} {{", depth)
self.emit( self.emit(
"fn ast_to_object(self, _vm: &VirtualMachine) -> PyObjectRef {", depth + 1 "fn ast_to_object(self, _vm: &VirtualMachine) -> PyObjectRef {", depth + 1
) )
self.emit("match self {", depth + 2) self.emit("match self {", depth + 2)
for variant in sum.types: for variant in sum.types:
self.constructor_to_object(variant, enumname, depth + 3) self.constructor_to_object(variant, enumname, rustname, depth + 3)
self.emit("}", depth + 2) self.emit("}", depth + 2)
self.emit("}", depth + 1) self.emit("}", depth + 1)
self.emit( self.emit(
"fn ast_from_object(_vm: &VirtualMachine, _object: PyObjectRef) -> PyResult<Self> {", "fn ast_from_object(_vm: &VirtualMachine, _object: PyObjectRef) -> PyResult<Self> {",
depth + 1, depth + 1,
) )
self.gen_sum_fromobj(sum, name, enumname, depth + 2) self.gen_sum_fromobj(sum, name, enumname, rustname, depth + 2)
self.emit("}", depth + 1) self.emit("}", depth + 1)
self.emit("}", depth) self.emit("}", depth)
def constructor_to_object(self, cons, enumname, depth): def constructor_to_object(self, cons, enumname, rustname, depth):
fields_pattern = self.make_pattern(cons.fields) self.emit(f"ast::{rustname}::{cons.name}", depth)
self.emit(f"ast::{enumname}::{cons.name} {{ {fields_pattern} }} => {{", depth) if cons.fields:
fields_pattern = self.make_pattern(cons.fields)
self.emit(f"( ast::{enumname}{cons.name} {{ {fields_pattern} }} )", depth)
self.emit(" => {", depth)
self.make_node(cons.name, cons.fields, depth + 1) self.make_node(cons.name, cons.fields, depth + 1)
self.emit("}", depth) self.emit("}", depth)
@ -586,7 +647,7 @@ class TraitImplVisitor(EmitVisitor):
def make_pattern(self, fields): def make_pattern(self, fields):
return ",".join(rust_field(f.name) for f in fields) return ",".join(rust_field(f.name) for f in fields)
def gen_sum_fromobj(self, sum, sumname, enumname, depth): def gen_sum_fromobj(self, sum, sumname, enumname, rustname, depth):
if sum.attributes: if sum.attributes:
self.extract_location(sumname, depth) self.extract_location(sumname, depth)
@ -594,7 +655,12 @@ class TraitImplVisitor(EmitVisitor):
self.emit("Ok(", depth) self.emit("Ok(", depth)
for cons in sum.types: for cons in sum.types:
self.emit(f"if _cls.is(Node{cons.name}::static_type()) {{", depth) self.emit(f"if _cls.is(Node{cons.name}::static_type()) {{", depth)
self.gen_construction(f"{enumname}::{cons.name}", cons, sumname, depth + 1) if cons.fields:
self.emit(f"ast::{rustname}::{cons.name} (ast::{enumname}{cons.name} {{", depth + 1)
self.gen_construction_fields(cons, sumname, depth + 1)
self.emit("})", depth + 1)
else:
self.emit(f"ast::{rustname}::{cons.name}", depth + 1)
self.emit("} else", depth) self.emit("} else", depth)
self.emit("{", depth) self.emit("{", depth)
@ -610,13 +676,16 @@ class TraitImplVisitor(EmitVisitor):
self.gen_construction(structname, product, prodname, depth + 1) self.gen_construction(structname, product, prodname, depth + 1)
self.emit(")", depth) self.emit(")", depth)
def gen_construction(self, cons_path, cons, name, depth): def gen_construction_fields(self, cons, name, depth):
self.emit(f"ast::{cons_path} {{", depth)
for field in cons.fields: for field in cons.fields:
self.emit( self.emit(
f"{rust_field(field.name)}: {self.decode_field(field, name)},", f"{rust_field(field.name)}: {self.decode_field(field, name)},",
depth + 1, depth + 1,
) )
def gen_construction(self, cons_path, cons, name, depth):
self.emit(f"ast::{cons_path} {{", depth)
self.gen_construction_fields(cons, name, depth + 1)
self.emit("}", depth) self.emit("}", depth)
def extract_location(self, typename, depth): def extract_location(self, typename, depth):

File diff suppressed because it is too large Load diff

View file

@ -100,7 +100,7 @@ impl<U> crate::fold::Fold<U> for ConstantOptimizer {
} }
fn fold_expr(&mut self, node: crate::Expr<U>) -> Result<crate::Expr<U>, Self::Error> { fn fold_expr(&mut self, node: crate::Expr<U>) -> Result<crate::Expr<U>, Self::Error> {
match node.node { match node.node {
crate::ExprKind::Tuple { elts, ctx } => { crate::ExprKind::Tuple(crate::ExprTuple { elts, ctx }) => {
let elts = elts let elts = elts
.into_iter() .into_iter()
.map(|x| self.fold_expr(x)) .map(|x| self.fold_expr(x))
@ -112,16 +112,16 @@ impl<U> crate::fold::Fold<U> for ConstantOptimizer {
let tuple = elts let tuple = elts
.into_iter() .into_iter()
.map(|e| match e.node { .map(|e| match e.node {
crate::ExprKind::Constant { value, .. } => value, crate::ExprKind::Constant(crate::ExprConstant { value, .. }) => value,
_ => unreachable!(), _ => unreachable!(),
}) })
.collect(); .collect();
crate::ExprKind::Constant { crate::ExprKind::Constant(crate::ExprConstant {
value: Constant::Tuple(tuple), value: Constant::Tuple(tuple),
kind: None, kind: None,
} })
} else { } else {
crate::ExprKind::Tuple { elts, ctx } crate::ExprKind::Tuple(crate::ExprTuple { elts, ctx })
}; };
Ok(crate::Expr { Ok(crate::Expr {
node: expr, node: expr,
@ -151,66 +151,73 @@ mod tests {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Tuple { node: ExprTuple {
ctx: ExprContext::Load, ctx: ExprContext::Load,
elts: vec![ elts: vec![
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: BigInt::from(1).into(), value: BigInt::from(1).into(),
kind: None, kind: None,
}, }
.into(),
}, },
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: BigInt::from(2).into(), value: BigInt::from(2).into(),
kind: None, kind: None,
}, }
.into(),
}, },
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Tuple { node: ExprTuple {
ctx: ExprContext::Load, ctx: ExprContext::Load,
elts: vec![ elts: vec![
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: BigInt::from(3).into(), value: BigInt::from(3).into(),
kind: None, kind: None,
}, }
.into(),
}, },
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: BigInt::from(4).into(), value: BigInt::from(4).into(),
kind: None, kind: None,
}, }
.into(),
}, },
Located { Located {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: BigInt::from(5).into(), value: BigInt::from(5).into(),
kind: None, kind: None,
}, }
.into(),
}, },
], ],
}, }
.into(),
}, },
], ],
}, }
.into(),
}; };
let new_ast = ConstantOptimizer::new() let new_ast = ConstantOptimizer::new()
.fold_expr(ast) .fold_expr(ast)
@ -221,7 +228,7 @@ mod tests {
location: start, location: start,
end_location: end, end_location: end,
custom, custom,
node: ExprKind::Constant { node: ExprConstant {
value: Constant::Tuple(vec![ value: Constant::Tuple(vec![
BigInt::from(1).into(), BigInt::from(1).into(),
BigInt::from(2).into(), BigInt::from(2).into(),
@ -232,7 +239,8 @@ mod tests {
]) ])
]), ]),
kind: None kind: None
}, }
.into(),
} }
); );
} }

View file

@ -13,7 +13,7 @@ impl<U> ExprKind<U> {
ExprKind::Compare { .. } => "comparison", ExprKind::Compare { .. } => "comparison",
ExprKind::Attribute { .. } => "attribute", ExprKind::Attribute { .. } => "attribute",
ExprKind::Call { .. } => "function call", ExprKind::Call { .. } => "function call",
ExprKind::Constant { value, .. } => match value { ExprKind::Constant(crate::ExprConstant { value, .. }) => match value {
Constant::Str(_) Constant::Str(_)
| Constant::Int(_) | Constant::Int(_)
| Constant::Float(_) | Constant::Float(_)
@ -40,7 +40,7 @@ impl<U> ExprKind<U> {
ExprKind::GeneratorExp { .. } => "generator expression", ExprKind::GeneratorExp { .. } => "generator expression",
ExprKind::Starred { .. } => "starred", ExprKind::Starred { .. } => "starred",
ExprKind::Slice { .. } => "slice", ExprKind::Slice { .. } => "slice",
ExprKind::JoinedStr { values } => { ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
if values if values
.iter() .iter()
.any(|e| matches!(e.node, ExprKind::JoinedStr { .. })) .any(|e| matches!(e.node, ExprKind::JoinedStr { .. }))

View file

@ -71,7 +71,7 @@ impl<'a> Unparser<'a> {
}}; }};
} }
match &ast.node { match &ast.node {
ExprKind::BoolOp { op, values } => { ExprKind::BoolOp(crate::ExprBoolOp { op, values }) => {
let (op, prec) = op_prec!(bin, op, Boolop, And("and", AND), Or("or", OR)); let (op, prec) = op_prec!(bin, op, Boolop, And("and", AND), Or("or", OR));
group_if!(prec, { group_if!(prec, {
let mut first = true; let mut first = true;
@ -81,14 +81,14 @@ impl<'a> Unparser<'a> {
} }
}) })
} }
ExprKind::NamedExpr { target, value } => { ExprKind::NamedExpr(crate::ExprNamedExpr { target, value }) => {
group_if!(precedence::TUPLE, { group_if!(precedence::TUPLE, {
self.unparse_expr(target, precedence::ATOM)?; self.unparse_expr(target, precedence::ATOM)?;
self.p(" := ")?; self.p(" := ")?;
self.unparse_expr(value, precedence::ATOM)?; self.unparse_expr(value, precedence::ATOM)?;
}) })
} }
ExprKind::BinOp { left, op, right } => { ExprKind::BinOp(crate::ExprBinOp { left, op, right }) => {
let right_associative = matches!(op, Operator::Pow); let right_associative = matches!(op, Operator::Pow);
let (op, prec) = op_prec!( let (op, prec) = op_prec!(
bin, bin,
@ -114,7 +114,7 @@ impl<'a> Unparser<'a> {
self.unparse_expr(right, prec + !right_associative as u8)?; self.unparse_expr(right, prec + !right_associative as u8)?;
}) })
} }
ExprKind::UnaryOp { op, operand } => { ExprKind::UnaryOp(crate::ExprUnaryOp { op, operand }) => {
let (op, prec) = op_prec!( let (op, prec) = op_prec!(
un, un,
op, op,
@ -129,7 +129,7 @@ impl<'a> Unparser<'a> {
self.unparse_expr(operand, prec)?; self.unparse_expr(operand, prec)?;
}) })
} }
ExprKind::Lambda { args, body } => { ExprKind::Lambda(crate::ExprLambda { args, body }) => {
group_if!(precedence::TEST, { group_if!(precedence::TEST, {
let pos = args.args.len() + args.posonlyargs.len(); let pos = args.args.len() + args.posonlyargs.len();
self.p(if pos > 0 { "lambda " } else { "lambda" })?; self.p(if pos > 0 { "lambda " } else { "lambda" })?;
@ -137,7 +137,7 @@ impl<'a> Unparser<'a> {
write!(self, ": {}", **body)?; write!(self, ": {}", **body)?;
}) })
} }
ExprKind::IfExp { test, body, orelse } => { ExprKind::IfExp(crate::ExprIfExp { test, body, orelse }) => {
group_if!(precedence::TEST, { group_if!(precedence::TEST, {
self.unparse_expr(body, precedence::TEST + 1)?; self.unparse_expr(body, precedence::TEST + 1)?;
self.p(" if ")?; self.p(" if ")?;
@ -146,7 +146,7 @@ impl<'a> Unparser<'a> {
self.unparse_expr(orelse, precedence::TEST)?; self.unparse_expr(orelse, precedence::TEST)?;
}) })
} }
ExprKind::Dict { keys, values } => { ExprKind::Dict(crate::ExprDict { keys, values }) => {
self.p("{")?; self.p("{")?;
let mut first = true; let mut first = true;
let (packed, unpacked) = values.split_at(keys.len()); let (packed, unpacked) = values.split_at(keys.len());
@ -164,7 +164,7 @@ impl<'a> Unparser<'a> {
} }
self.p("}")?; self.p("}")?;
} }
ExprKind::Set { elts } => { ExprKind::Set(crate::ExprSet { elts }) => {
self.p("{")?; self.p("{")?;
let mut first = true; let mut first = true;
for v in elts { for v in elts {
@ -173,23 +173,23 @@ impl<'a> Unparser<'a> {
} }
self.p("}")?; self.p("}")?;
} }
ExprKind::ListComp { elt, generators } => { ExprKind::ListComp(crate::ExprListComp { elt, generators }) => {
self.p("[")?; self.p("[")?;
self.unparse_expr(elt, precedence::TEST)?; self.unparse_expr(elt, precedence::TEST)?;
self.unparse_comp(generators)?; self.unparse_comp(generators)?;
self.p("]")?; self.p("]")?;
} }
ExprKind::SetComp { elt, generators } => { ExprKind::SetComp(crate::ExprSetComp { elt, generators }) => {
self.p("{")?; self.p("{")?;
self.unparse_expr(elt, precedence::TEST)?; self.unparse_expr(elt, precedence::TEST)?;
self.unparse_comp(generators)?; self.unparse_comp(generators)?;
self.p("}")?; self.p("}")?;
} }
ExprKind::DictComp { ExprKind::DictComp(crate::ExprDictComp {
key, key,
value, value,
generators, generators,
} => { }) => {
self.p("{")?; self.p("{")?;
self.unparse_expr(key, precedence::TEST)?; self.unparse_expr(key, precedence::TEST)?;
self.p(": ")?; self.p(": ")?;
@ -197,33 +197,33 @@ impl<'a> Unparser<'a> {
self.unparse_comp(generators)?; self.unparse_comp(generators)?;
self.p("}")?; self.p("}")?;
} }
ExprKind::GeneratorExp { elt, generators } => { ExprKind::GeneratorExp(crate::ExprGeneratorExp { elt, generators }) => {
self.p("(")?; self.p("(")?;
self.unparse_expr(elt, precedence::TEST)?; self.unparse_expr(elt, precedence::TEST)?;
self.unparse_comp(generators)?; self.unparse_comp(generators)?;
self.p(")")?; self.p(")")?;
} }
ExprKind::Await { value } => { ExprKind::Await(crate::ExprAwait { value }) => {
group_if!(precedence::AWAIT, { group_if!(precedence::AWAIT, {
self.p("await ")?; self.p("await ")?;
self.unparse_expr(value, precedence::ATOM)?; self.unparse_expr(value, precedence::ATOM)?;
}) })
} }
ExprKind::Yield { value } => { ExprKind::Yield(crate::ExprYield { value }) => {
if let Some(value) = value { if let Some(value) = value {
write!(self, "(yield {})", **value)?; write!(self, "(yield {})", **value)?;
} else { } else {
self.p("(yield)")?; self.p("(yield)")?;
} }
} }
ExprKind::YieldFrom { value } => { ExprKind::YieldFrom(crate::ExprYieldFrom { value }) => {
write!(self, "(yield from {})", **value)?; write!(self, "(yield from {})", **value)?;
} }
ExprKind::Compare { ExprKind::Compare(crate::ExprCompare {
left, left,
ops, ops,
comparators, comparators,
} => { }) => {
group_if!(precedence::CMP, { group_if!(precedence::CMP, {
let new_lvl = precedence::CMP + 1; let new_lvl = precedence::CMP + 1;
self.unparse_expr(left, new_lvl)?; self.unparse_expr(left, new_lvl)?;
@ -245,16 +245,16 @@ impl<'a> Unparser<'a> {
} }
}) })
} }
ExprKind::Call { ExprKind::Call(crate::ExprCall {
func, func,
args, args,
keywords, keywords,
} => { }) => {
self.unparse_expr(func, precedence::ATOM)?; self.unparse_expr(func, precedence::ATOM)?;
self.p("(")?; self.p("(")?;
if let ( if let (
[Expr { [Expr {
node: ExprKind::GeneratorExp { elt, generators }, node: ExprKind::GeneratorExp(crate::ExprGeneratorExp { elt, generators }),
.. ..
}], }],
[], [],
@ -282,13 +282,15 @@ impl<'a> Unparser<'a> {
} }
self.p(")")?; self.p(")")?;
} }
ExprKind::FormattedValue { ExprKind::FormattedValue(crate::ExprFormattedValue {
value, value,
conversion, conversion,
format_spec, format_spec,
} => self.unparse_formatted(value, *conversion, format_spec.as_deref())?, }) => self.unparse_formatted(value, *conversion, format_spec.as_deref())?,
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, false)?, ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
ExprKind::Constant { value, kind } => { self.unparse_joined_str(values, false)?
}
ExprKind::Constant(crate::ExprConstant { value, kind }) => {
if let Some(kind) = kind { if let Some(kind) = kind {
self.p(kind)?; self.p(kind)?;
} }
@ -304,12 +306,12 @@ impl<'a> Unparser<'a> {
_ => fmt::Display::fmt(value, &mut self.f)?, _ => fmt::Display::fmt(value, &mut self.f)?,
} }
} }
ExprKind::Attribute { value, attr, .. } => { ExprKind::Attribute(crate::ExprAttribute { value, attr, .. }) => {
self.unparse_expr(value, precedence::ATOM)?; self.unparse_expr(value, precedence::ATOM)?;
let period = if let ExprKind::Constant { let period = if let ExprKind::Constant(crate::ExprConstant {
value: Constant::Int(_), value: Constant::Int(_),
.. ..
} = &value.node }) = &value.node
{ {
" ." " ."
} else { } else {
@ -318,10 +320,10 @@ impl<'a> Unparser<'a> {
self.p(period)?; self.p(period)?;
self.p(attr)?; self.p(attr)?;
} }
ExprKind::Subscript { value, slice, .. } => { ExprKind::Subscript(crate::ExprSubscript { value, slice, .. }) => {
self.unparse_expr(value, precedence::ATOM)?; self.unparse_expr(value, precedence::ATOM)?;
let mut lvl = precedence::TUPLE; let mut lvl = precedence::TUPLE;
if let ExprKind::Tuple { elts, .. } = &slice.node { if let ExprKind::Tuple(crate::ExprTuple { elts, .. }) = &slice.node {
if elts if elts
.iter() .iter()
.any(|expr| matches!(expr.node, ExprKind::Starred { .. })) .any(|expr| matches!(expr.node, ExprKind::Starred { .. }))
@ -333,12 +335,12 @@ impl<'a> Unparser<'a> {
self.unparse_expr(slice, lvl)?; self.unparse_expr(slice, lvl)?;
self.p("]")?; self.p("]")?;
} }
ExprKind::Starred { value, .. } => { ExprKind::Starred(crate::ExprStarred { value, .. }) => {
self.p("*")?; self.p("*")?;
self.unparse_expr(value, precedence::EXPR)?; self.unparse_expr(value, precedence::EXPR)?;
} }
ExprKind::Name { id, .. } => self.p(id)?, ExprKind::Name(crate::ExprName { id, .. }) => self.p(id)?,
ExprKind::List { elts, .. } => { ExprKind::List(crate::ExprList { elts, .. }) => {
self.p("[")?; self.p("[")?;
let mut first = true; let mut first = true;
for elt in elts { for elt in elts {
@ -347,7 +349,7 @@ impl<'a> Unparser<'a> {
} }
self.p("]")?; self.p("]")?;
} }
ExprKind::Tuple { elts, .. } => { ExprKind::Tuple(crate::ExprTuple { elts, .. }) => {
if elts.is_empty() { if elts.is_empty() {
self.p("()")?; self.p("()")?;
} else { } else {
@ -361,7 +363,7 @@ impl<'a> Unparser<'a> {
}) })
} }
} }
ExprKind::Slice { lower, upper, step } => { ExprKind::Slice(crate::ExprSlice { lower, upper, step }) => {
if let Some(lower) = lower { if let Some(lower) = lower {
self.unparse_expr(lower, precedence::TEST)?; self.unparse_expr(lower, precedence::TEST)?;
} }
@ -483,19 +485,21 @@ impl<'a> Unparser<'a> {
fn unparse_fstring_elem<U>(&mut self, expr: &Expr<U>, is_spec: bool) -> fmt::Result { fn unparse_fstring_elem<U>(&mut self, expr: &Expr<U>, is_spec: bool) -> fmt::Result {
match &expr.node { match &expr.node {
ExprKind::Constant { value, .. } => { ExprKind::Constant(crate::ExprConstant { value, .. }) => {
if let Constant::Str(s) = value { if let Constant::Str(s) = value {
self.unparse_fstring_str(s) self.unparse_fstring_str(s)
} else { } else {
unreachable!() unreachable!()
} }
} }
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, is_spec), ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
ExprKind::FormattedValue { self.unparse_joined_str(values, is_spec)
}
ExprKind::FormattedValue(crate::ExprFormattedValue {
value, value,
conversion, conversion,
format_spec, format_spec,
} => self.unparse_formatted(value, *conversion, format_spec.as_deref()), }) => self.unparse_formatted(value, *conversion, format_spec.as_deref()),
_ => unreachable!(), _ => unreachable!(),
} }
} }

View file

@ -1,44 +1,47 @@
use rustpython_ast::{Expr, ExprContext, ExprKind}; use crate::ast::{self, Expr, ExprContext, ExprKind};
pub(crate) fn set_context(expr: Expr, ctx: ExprContext) -> Expr { pub(crate) fn set_context(expr: Expr, ctx: ExprContext) -> Expr {
match expr.node { match expr.node {
ExprKind::Name { id, .. } => Expr { ExprKind::Name(ast::ExprName { id, .. }) => Expr {
node: ExprKind::Name { id, ctx }, node: ast::ExprName { id, ctx }.into(),
..expr ..expr
}, },
ExprKind::Tuple { elts, .. } => Expr { ExprKind::Tuple(ast::ExprTuple { elts, .. }) => Expr {
node: ExprKind::Tuple { node: ast::ExprTuple {
elts: elts elts: elts
.into_iter() .into_iter()
.map(|elt| set_context(elt, ctx.clone())) .map(|elt| set_context(elt, ctx.clone()))
.collect(), .collect(),
ctx, ctx,
}, }
.into(),
..expr ..expr
}, },
ExprKind::List { elts, .. } => Expr { ExprKind::List(ast::ExprList { elts, .. }) => Expr {
node: ExprKind::List { node: ast::ExprList {
elts: elts elts: elts
.into_iter() .into_iter()
.map(|elt| set_context(elt, ctx.clone())) .map(|elt| set_context(elt, ctx.clone()))
.collect(), .collect(),
ctx, ctx,
}, }
.into(),
..expr ..expr
}, },
ExprKind::Attribute { value, attr, .. } => Expr { ExprKind::Attribute(ast::ExprAttribute { value, attr, .. }) => Expr {
node: ExprKind::Attribute { value, attr, ctx }, node: ast::ExprAttribute { value, attr, ctx }.into(),
..expr ..expr
}, },
ExprKind::Subscript { value, slice, .. } => Expr { ExprKind::Subscript(ast::ExprSubscript { value, slice, .. }) => Expr {
node: ExprKind::Subscript { value, slice, ctx }, node: ast::ExprSubscript { value, slice, ctx }.into(),
..expr ..expr
}, },
ExprKind::Starred { value, .. } => Expr { ExprKind::Starred(ast::ExprStarred { value, .. }) => Expr {
node: ExprKind::Starred { node: ast::ExprStarred {
value: Box::new(set_context(*value, ctx.clone())), value: Box::new(set_context(*value, ctx.clone())),
ctx, ctx,
}, }
.into(),
..expr ..expr
}, },
_ => expr, _ => expr,

View file

@ -46,7 +46,7 @@ pub(super) use lalrpop_util::ParseError as LalrpopError;
/// ``` /// ```
pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, ParseError> { pub fn parse_program(source: &str, source_path: &str) -> Result<ast::Suite, ParseError> {
parse(source, Mode::Module, source_path).map(|top| match top { parse(source, Mode::Module, source_path).map(|top| match top {
ast::Mod::Module { body, .. } => body, ast::Mod::Module(ast::ModModule { body, .. }) => body,
_ => unreachable!(), _ => unreachable!(),
}) })
} }
@ -94,7 +94,7 @@ pub fn parse_expression_located(
location: Location, location: Location,
) -> Result<ast::Expr, ParseError> { ) -> Result<ast::Expr, ParseError> {
parse_located(source, Mode::Expression, path, location).map(|top| match top { parse_located(source, Mode::Expression, path, location).map(|top| match top {
ast::Mod::Expression { body } => *body, ast::Mod::Expression(ast::ModExpression { body }) => *body,
_ => unreachable!(), _ => unreachable!(),
}) })
} }

File diff suppressed because it is too large Load diff

422
parser/src/python.rs generated

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,63 +15,71 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: AnnAssign { node: AnnAssign(
target: Located { StmtAnnAssign {
location: Location { target: Located {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
annotation: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name {
id: "int",
ctx: Load,
},
},
value: Some(
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 9, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 10, column: 1,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Name(
value: Int( ExprName {
1, id: "x",
), ctx: Store,
kind: None, },
}, ),
}, },
), annotation: Located {
simple: 1, location: Location {
}, row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "int",
ctx: Load,
},
),
},
value: Some(
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
),
simple: 1,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,119 +15,133 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Attribute(
ExprAttribute {
value: Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
attr: "y",
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 6,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 3, column: 15,
}, },
), ),
custom: (), custom: (),
node: Attribute { node: Tuple(
value: Located { ExprTuple {
location: Location { elts: [
row: 1, Located {
column: 0, location: Location {
}, row: 1,
end_location: Some( column: 7,
Location { },
row: 1, end_location: Some(
column: 1, Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Name { row: 1,
id: "x", column: 10,
ctx: Load, },
}, end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
}, },
attr: "y", ),
ctx: Store,
},
},
],
value: Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 15,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,117 +15,129 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: For { node: For(
target: Located { StmtFor {
location: Location { target: Located {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 5,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
},
},
body: [
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 20, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 24, column: 5,
}, },
), ),
custom: (), custom: (),
node: Pass, node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
}, },
], iter: Located {
orelse: [], location: Location {
type_comment: None, row: 1,
}, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
},
),
},
body: [
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Pass,
},
],
orelse: [],
type_comment: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,137 +15,153 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: List(
ExprList {
elts: [
Located {
location: Location {
row: 1,
column: 1,
},
end_location: Some(
Location {
row: 1,
column: 2,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
},
Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 5,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
],
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 9,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 18,
}, },
), ),
custom: (), custom: (),
node: List { node: Tuple(
elts: [ ExprTuple {
Located { elts: [
location: Location { Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 2, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 11,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 5, column: 13,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "y", column: 14,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
}, },
}, Located {
], location: Location {
ctx: Store, row: 1,
}, column: 16,
}, },
], end_location: Some(
value: Located { Location {
location: Location { row: 1,
row: 1, column: 17,
column: 9, },
}, ),
end_location: Some( custom: (),
Location { node: Constant(
row: 1, ExprConstant {
column: 18, value: Int(
}, 3,
), ),
custom: (), kind: None,
node: Tuple { },
elts: [ ),
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
}, },
), ],
custom: (), ctx: Load,
node: Constant {
value: Int(
1,
),
kind: None,
},
}, },
Located { ),
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,157 +15,175 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
location: Location { Located {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
],
value: Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: ListComp {
elt: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 5, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 1,
}, },
), ),
custom: (), custom: (),
node: Name { node: Name(
id: "y", ExprName {
ctx: Load, id: "x",
}, ctx: Store,
},
),
}, },
generators: [ ],
Comprehension { value: Located {
target: Located { location: Location {
location: Location { row: 1,
row: 1, column: 4,
column: 11, },
}, end_location: Some(
end_location: Some( Location {
Location { row: 1,
row: 1, column: 26,
column: 12,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 21,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
},
},
ifs: [],
is_async: 0,
}, },
], ),
custom: (),
node: ListComp(
ExprListComp {
elt: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 21,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,102 +15,114 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 1, column: 13,
}, },
), ),
custom: (), custom: (),
node: Name { node: Tuple(
id: "x", ExprTuple {
ctx: Store, elts: [
}, Located {
}, location: Location {
], row: 1,
value: Located { column: 5,
location: Location { },
row: 1, end_location: Some(
column: 4, Location {
}, row: 1,
end_location: Some( column: 6,
Location { },
row: 1, ),
column: 13, custom: (),
}, node: Constant(
), ExprConstant {
custom: (), value: Int(
node: Tuple { 1,
elts: [ ),
Located { kind: None,
location: Location { },
row: 1, ),
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
}, },
), Located {
custom: (), location: Location {
node: Constant { row: 1,
value: Int( column: 8,
1, },
), end_location: Some(
kind: None, Location {
}, row: 1,
}, column: 9,
Located { },
location: Location { ),
row: 1, custom: (),
column: 8, node: Constant(
}, ExprConstant {
end_location: Some( value: Int(
Location { 2,
row: 1, ),
column: 9, kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Constant { row: 1,
value: Int( column: 11,
2, },
), end_location: Some(
kind: None, Location {
}, row: 1,
}, column: 12,
Located { },
location: Location { ),
row: 1, custom: (),
column: 11, node: Constant(
}, ExprConstant {
end_location: Some( value: Int(
Location { 3,
row: 1, ),
column: 12, kind: None,
},
),
}, },
), ],
custom: (), ctx: Load,
node: Constant {
value: Int(
3,
),
kind: None,
},
}, },
], ),
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,75 +15,83 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: If { node: If(
test: Located { StmtIf {
location: Location { test: Located {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: NamedExpr {
target: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
},
},
body: [
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 10, column: 3,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 14, column: 8,
}, },
), ),
custom: (), custom: (),
node: Pass, node: NamedExpr(
ExprNamedExpr {
target: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
},
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
},
),
}, },
], body: [
orelse: [], Located {
}, location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Pass,
},
],
orelse: [],
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,157 +15,175 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
location: Location { Located {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
],
value: Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: SetComp {
elt: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 5, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 1,
}, },
), ),
custom: (), custom: (),
node: Name { node: Name(
id: "y", ExprName {
ctx: Load, id: "x",
}, ctx: Store,
},
),
}, },
generators: [ ],
Comprehension { value: Located {
target: Located { location: Location {
location: Location { row: 1,
row: 1, column: 4,
column: 11, },
}, end_location: Some(
end_location: Some( Location {
Location { row: 1,
row: 1, column: 26,
column: 12,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 21,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
},
},
ifs: [],
is_async: 0,
}, },
], ),
custom: (),
node: SetComp(
ExprSetComp {
elt: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 21,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 24,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,56 +15,47 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
location: Location { Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Tuple { row: 1,
elts: [ column: 7,
Located {
location: Location {
row: 1,
column: 1,
},
end_location: Some(
Location {
row: 1,
column: 2,
},
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: Tuple(
column: 4, ExprTuple {
}, elts: [
end_location: Some( Located {
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Starred {
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 5, column: 1,
},
end_location: Some(
Location {
row: 1,
column: 2,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
},
Located {
location: Location {
row: 1,
column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
@ -73,95 +64,122 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Name { node: Starred(
id: "y", ExprStarred {
ctx: Store, value: Located {
}, location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
ctx: Store,
},
),
}, },
ctx: Store, ],
}, ctx: Store,
}, },
], ),
ctx: Store,
}, },
}, ],
], value: Located {
value: Located { location: Location {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 19, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Tuple { row: 1,
elts: [ column: 19,
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: Tuple(
column: 14, ExprTuple {
}, elts: [
end_location: Some( Located {
Location { location: Location {
row: 1, row: 1,
column: 15, column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Constant { row: 1,
value: Int( column: 14,
2, },
), end_location: Some(
kind: None, Location {
}, row: 1,
}, column: 15,
Located { },
location: Location { ),
row: 1, custom: (),
column: 17, node: Constant(
}, ExprConstant {
end_location: Some( value: Int(
Location { 2,
row: 1, ),
column: 18, kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Constant { row: 1,
value: Int( column: 17,
3, },
), end_location: Some(
kind: None, Location {
}, row: 1,
column: 18,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
}, },
], ),
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,135 +15,151 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Subscript(
ExprSubscript {
value: Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
slice: Located {
location: Location {
row: 1,
column: 2,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 7,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 4, column: 16,
}, },
), ),
custom: (), custom: (),
node: Subscript { node: Tuple(
value: Located { ExprTuple {
location: Location { elts: [
row: 1, Located {
column: 0, location: Location {
}, row: 1,
end_location: Some( column: 8,
Location { },
row: 1, end_location: Some(
column: 1, Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Name { row: 1,
id: "x", column: 11,
ctx: Load, },
}, end_location: Some(
}, Location {
slice: Located { row: 1,
location: Location { column: 12,
row: 1, },
column: 2, ),
}, custom: (),
end_location: Some( node: Constant(
Location { ExprConstant {
row: 1, value: Int(
column: 3, 2,
),
kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Name { row: 1,
id: "y", column: 14,
ctx: Load, },
}, end_location: Some(
Location {
row: 1,
column: 15,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load,
}, },
ctx: Store, ),
},
},
],
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 14,
},
end_location: Some(
Location {
row: 1,
column: 15,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,137 +15,153 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 1,
},
end_location: Some(
Location {
row: 1,
column: 2,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
},
Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 5,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
],
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 9,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 18,
}, },
), ),
custom: (), custom: (),
node: Tuple { node: Tuple(
elts: [ ExprTuple {
Located { elts: [
location: Location { Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 2, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 11,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 5, column: 13,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "y", column: 14,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
}, },
}, Located {
], location: Location {
ctx: Store, row: 1,
}, column: 16,
}, },
], end_location: Some(
value: Located { Location {
location: Location { row: 1,
row: 1, column: 17,
column: 9, },
}, ),
end_location: Some( custom: (),
Location { node: Constant(
row: 1, ExprConstant {
column: 18, value: Int(
}, 3,
), ),
custom: (), kind: None,
node: Tuple { },
elts: [ ),
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
}, },
), ],
custom: (), ctx: Load,
node: Constant {
value: Int(
1,
),
kind: None,
},
}, },
Located { ),
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,66 +15,72 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: With { node: With(
items: [ StmtWith {
Withitem { items: [
context_expr: Located { Withitem {
location: Location { context_expr: Located {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
optional_vars: Some(
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 10, column: 5,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 11, column: 6,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "x", ExprConstant {
ctx: Store, value: Int(
1,
),
kind: None,
},
),
},
optional_vars: Some(
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Store,
},
),
}, },
}, ),
),
},
],
body: [
Located {
location: Location {
row: 1,
column: 13,
}, },
end_location: Some( ],
Location { body: [
Located {
location: Location {
row: 1, row: 1,
column: 17, column: 13,
}, },
), end_location: Some(
custom: (), Location {
node: Pass, row: 1,
}, column: 17,
], },
type_comment: None, ),
}, custom: (),
node: Pass,
},
],
type_comment: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,117 +15,131 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: AugAssign { node: AugAssign(
target: Located { StmtAugAssign {
location: Location { target: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 3, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Attribute {
value: Located {
location: Location {
row: 1, row: 1,
column: 0, column: 3,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Attribute(
column: 1, ExprAttribute {
value: Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
), attr: "y",
custom: (), ctx: Store,
node: Name { },
id: "x", ),
},
op: Add,
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 14,
},
end_location: Some(
Location {
row: 1,
column: 15,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load, ctx: Load,
}, },
}, ),
attr: "y",
ctx: Store,
}, },
}, },
op: Add, ),
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 14,
},
end_location: Some(
Location {
row: 1,
column: 15,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
},
},
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,44 +15,50 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: AugAssign { node: AugAssign(
target: Located { StmtAugAssign {
location: Location { target: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 1, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 1,
ctx: Store, },
}, ),
}, custom: (),
op: Add, node: Name(
value: Located { ExprName {
location: Location { id: "x",
row: 1, ctx: Store,
column: 5, },
}, ),
end_location: Some( },
Location { op: Add,
row: 1, value: Located {
column: 6, location: Location {
}, row: 1,
), column: 5,
custom: (), },
node: Constant { end_location: Some(
value: Int( Location {
1, row: 1,
column: 6,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,133 +15,149 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: AugAssign { node: AugAssign(
target: Located { StmtAugAssign {
location: Location { target: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 4, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Subscript {
value: Located {
location: Location {
row: 1, row: 1,
column: 0, column: 4,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Subscript(
column: 1, ExprSubscript {
value: Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
), slice: Located {
custom: (), location: Location {
node: Name { row: 1,
id: "x", column: 2,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
ctx: Store,
},
),
},
op: Add,
value: Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
},
],
ctx: Load, ctx: Load,
}, },
}, ),
slice: Located {
location: Location {
row: 1,
column: 2,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Name {
id: "y",
ctx: Load,
},
},
ctx: Store,
}, },
}, },
op: Add, ),
value: Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant {
value: Int(
2,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
},
],
ctx: Load,
},
},
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,43 +15,49 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Delete { node: Delete(
targets: [ StmtDelete {
Located { targets: [
location: Location { Located {
row: 1, location: Location {
column: 4,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 4,
}, },
), end_location: Some(
custom: (), Location {
node: Attribute {
value: Located {
location: Location {
row: 1, row: 1,
column: 4, column: 7,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Attribute(
column: 5, ExprAttribute {
value: Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 5,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
), attr: "y",
custom: (), ctx: Del,
node: Name {
id: "x",
ctx: Load,
}, },
}, ),
attr: "y",
ctx: Del,
}, },
}, ],
], },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Delete { node: Delete(
targets: [ StmtDelete {
Located { targets: [
location: Location { Located {
row: 1, location: Location {
column: 4,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 5, column: 4,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 5,
ctx: Del, },
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Del,
},
),
}, },
}, ],
], },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/context.rs source: parser/src/context.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,59 +15,67 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Delete { node: Delete(
targets: [ StmtDelete {
Located { targets: [
location: Location { Located {
row: 1, location: Location {
column: 4,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 8, column: 4,
}, },
), end_location: Some(
custom: (), Location {
node: Subscript {
value: Located {
location: Location {
row: 1, row: 1,
column: 4, column: 8,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Subscript(
column: 5, ExprSubscript {
value: Located {
location: Location {
row: 1,
column: 4,
},
end_location: Some(
Location {
row: 1,
column: 5,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
), slice: Located {
custom: (), location: Location {
node: Name { row: 1,
id: "x", column: 6,
ctx: Load, },
}, end_location: Some(
}, Location {
slice: Located { row: 1,
location: Location { column: 7,
row: 1, },
column: 6, ),
}, custom: (),
end_location: Some( node: Name(
Location { ExprName {
row: 1, id: "y",
column: 7, ctx: Load,
},
),
}, },
), ctx: Del,
custom: (),
node: Name {
id: "y",
ctx: Load,
}, },
}, ),
ctx: Del,
}, },
}, ],
], },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,92 +16,94 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [], posonlyargs: [],
vararg: None, args: [],
kwonlyargs: [ vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: [
Located { Located {
location: Location { location: Location {
row: 1, row: 1,
column: 9, column: 19,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 10, column: 23,
}, },
), ),
custom: (), custom: (),
node: ArgData { node: Pass,
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
}, },
], ],
kw_defaults: [], decorator_list: [],
kwarg: None, returns: None,
defaults: [], type_comment: None,
}, },
body: [ ),
Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,131 +16,137 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [], posonlyargs: [],
vararg: None, args: [],
kwonlyargs: [ vararg: None,
Located { kwonlyargs: [
location: Location { Located {
row: 1, location: Location {
column: 9,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 10, column: 9,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 1,
arg: "a", column: 10,
annotation: None, },
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 14,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Constant {
value: Int(
20,
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "a",
Located { annotation: None,
location: Location { type_comment: None,
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 22,
}, },
), },
custom: (), Located {
node: Constant { location: Location {
value: Int( row: 1,
30, column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
), ),
kind: None, custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
}, },
}, Located {
], location: Location {
kwarg: None, row: 1,
defaults: [], column: 18,
}, },
body: [ end_location: Some(
Located { Location {
location: Location { row: 1,
row: 1, column: 19,
column: 25, },
}, ),
end_location: Some( custom: (),
Location { node: ArgData {
row: 1, arg: "c",
column: 29, annotation: None,
type_comment: None,
},
}, },
), ],
custom: (), kw_defaults: [
node: Pass, Located {
location: Location {
row: 1,
column: 14,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 20,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
kwarg: None,
defaults: [],
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 25,
},
end_location: Some(
Location {
row: 1,
column: 29,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,37 +16,39 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [], posonlyargs: [],
vararg: None, args: [],
kwonlyargs: [], vararg: None,
kw_defaults: [], kwonlyargs: [],
kwarg: None, kw_defaults: [],
defaults: [], kwarg: None,
}, defaults: [],
body: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Pass,
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,147 +16,149 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
Located { args: [
location: Location { Located {
row: 1, location: Location {
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 10, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 13, column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
}, },
}, ],
], vararg: None,
vararg: None, kwonlyargs: [
kwonlyargs: [ Located {
Located { location: Location {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 19, column: 18,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 22, column: 21,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 24,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 25, column: 24,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
}, },
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
}, },
}, ],
], kw_defaults: [],
kw_defaults: [], kwarg: None,
kwarg: None, defaults: [],
defaults: [],
},
body: [
Located {
location: Location {
row: 1,
column: 28,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: Pass,
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 28,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,186 +16,192 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
Located { args: [
location: Location { Located {
row: 1, location: Location {
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 1,
arg: "a", column: 7,
annotation: None, },
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 28,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Constant {
value: Int(
20,
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "a",
Located { annotation: None,
location: Location { type_comment: None,
row: 1,
column: 29,
},
end_location: Some(
Location {
row: 1,
column: 31,
}, },
), },
custom: (), Located {
node: Constant { location: Location {
value: Int( row: 1,
30, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
), ),
kind: None, custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
}, },
}, Located {
], location: Location {
kwarg: None, row: 1,
defaults: [], column: 12,
}, },
body: [ end_location: Some(
Located { Location {
location: Location { row: 1,
row: 1, column: 13,
column: 34, },
}, ),
end_location: Some( custom: (),
Location { node: ArgData {
row: 1, arg: "c",
column: 38, annotation: None,
type_comment: None,
},
}, },
), ],
custom: (), vararg: None,
node: Pass, kwonlyargs: [
Located {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 28,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 23,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 29,
},
end_location: Some(
Location {
row: 1,
column: 31,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
kwarg: None,
defaults: [],
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 34,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,205 +16,211 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
Located { args: [
location: Location { Located {
row: 1, location: Location {
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 1,
arg: "a", column: 7,
annotation: None, },
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "args",
annotation: None,
type_comment: None,
},
},
),
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 31,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 29,
},
),
custom: (),
node: Constant {
value: Int(
20,
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "a",
Located { annotation: None,
location: Location { type_comment: None,
row: 1,
column: 33,
},
end_location: Some(
Location {
row: 1,
column: 35,
}, },
),
custom: (),
node: Constant {
value: Int(
30,
),
kind: None,
}, },
}, Located {
], location: Location {
kwarg: None, row: 1,
defaults: [], column: 9,
}, },
body: [ end_location: Some(
Located { Location {
location: Location { row: 1,
row: 1, column: 10,
column: 38, },
}, ),
end_location: Some( custom: (),
Location { node: ArgData {
row: 1, arg: "b",
column: 42, annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "args",
annotation: None,
type_comment: None,
},
}, },
), ),
custom: (), kwonlyargs: [
node: Pass, Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 31,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 29,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 33,
},
end_location: Some(
Location {
row: 1,
column: 35,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
kwarg: None,
defaults: [],
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 38,
},
end_location: Some(
Location {
row: 1,
column: 42,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,224 +16,230 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
Located { args: [
location: Location { Located {
row: 1, location: Location {
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 1,
arg: "a", column: 7,
annotation: None, },
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "args",
annotation: None,
type_comment: None,
},
},
),
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 31,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 29,
},
),
custom: (),
node: Constant {
value: Int(
20,
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "a",
Located { annotation: None,
location: Location { type_comment: None,
row: 1,
column: 33,
},
end_location: Some(
Location {
row: 1,
column: 35,
}, },
), },
custom: (), Located {
node: Constant { location: Location {
value: Int( row: 1,
30, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "b",
], annotation: None,
kwarg: Some( type_comment: None,
Located {
location: Location {
row: 1,
column: 39,
},
end_location: Some(
Location {
row: 1,
column: 45,
}, },
),
custom: (),
node: ArgData {
arg: "kwargs",
annotation: None,
type_comment: None,
}, },
}, Located {
), location: Location {
defaults: [], row: 1,
}, column: 12,
body: [ },
Located { end_location: Some(
location: Location { Location {
row: 1, row: 1,
column: 48, column: 13,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: ArgData {
column: 52, arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "args",
annotation: None,
type_comment: None,
},
}, },
), ),
custom: (), kwonlyargs: [
node: Pass, Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 31,
},
end_location: Some(
Location {
row: 1,
column: 32,
},
),
custom: (),
node: ArgData {
arg: "f",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 29,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 33,
},
end_location: Some(
Location {
row: 1,
column: 35,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
kwarg: Some(
Located {
location: Location {
row: 1,
column: 39,
},
end_location: Some(
Location {
row: 1,
column: 45,
},
),
custom: (),
node: ArgData {
arg: "kwargs",
annotation: None,
type_comment: None,
},
},
),
defaults: [],
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 48,
},
end_location: Some(
Location {
row: 1,
column: 52,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,92 +16,94 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: [
Located { Located {
location: Location { location: Location {
row: 1, row: 1,
column: 6, column: 16,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 7, column: 20,
}, },
), ),
custom: (), custom: (),
node: ArgData { node: Pass,
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
}, },
], ],
vararg: None, decorator_list: [],
kwonlyargs: [], returns: None,
kw_defaults: [], type_comment: None,
kwarg: None,
defaults: [],
}, },
body: [ ),
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,131 +16,137 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "f", StmtFunctionDef {
args: Arguments { name: "f",
posonlyargs: [], args: Arguments {
args: [ posonlyargs: [],
Located { args: [
location: Location { Located {
row: 1, location: Location {
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 1,
arg: "a", column: 7,
annotation: None, },
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 16,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant {
value: Int(
20,
), ),
kind: None, custom: (),
}, node: ArgData {
}, arg: "a",
Located { annotation: None,
location: Location { type_comment: None,
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 19,
}, },
), },
custom: (), Located {
node: Constant { location: Location {
value: Int( row: 1,
30, column: 9,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
), ),
kind: None, custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
}, },
}, Located {
], location: Location {
}, row: 1,
body: [ column: 15,
Located { },
location: Location { end_location: Some(
row: 1, Location {
column: 22, row: 1,
}, column: 16,
end_location: Some( },
Location { ),
row: 1, custom: (),
column: 26, node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
}, },
), ],
custom: (), vararg: None,
node: Pass, kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 1,
column: 11,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
}, },
], body: [
decorator_list: [], Located {
returns: None, location: Location {
type_comment: None, row: 1,
}, column: 22,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,106 +16,112 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 20, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 19, column: 20,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 20, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,145 +16,155 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 26, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Int(
20,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Constant {
value: Int(
30,
),
kind: None,
},
},
],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 25, column: 26,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 26, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [
Located {
location: Location {
row: 1,
column: 15,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,51 +16,57 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 9, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 8, column: 9,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 9, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,143 +16,149 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 26, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 25, column: 26,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 26, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [
Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: ArgData {
arg: "d",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: ArgData {
arg: "e",
annotation: None,
type_comment: None,
},
},
],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1,
column: 25,
},
end_location: Some(
Location {
row: 1,
column: 26,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
0,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
0,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,106 +16,112 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 17, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 16, column: 17,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 17, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/function.rs source: parser/src/function.rs
expression: parse_ast expression: parse_ast
--- ---
Ok( Ok(
@ -16,145 +16,155 @@ Ok(
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 23, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Int(
20,
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Constant {
value: Int(
30,
),
kind: None,
},
},
],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 22, column: 23,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 23, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "a",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "b",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: ArgData {
arg: "c",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 18,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
],
},
body: Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
}, },
}, ),
}, },
}, },
}, ),
}, },
], ],
) )

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,108 +14,120 @@ Located {
}, },
), ),
custom: (), custom: (),
node: Dict { node: Dict(
keys: [ ExprDict {
Some( keys: [
Some(
Located {
location: Location {
row: 1,
column: 1,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"a",
),
kind: None,
},
),
},
),
None,
Some(
Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"d",
),
kind: None,
},
),
},
),
],
values: [
Located { Located {
location: Location { location: Location {
row: 1, row: 1,
column: 1, column: 6,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 4, column: 9,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"a", value: Str(
), "b",
kind: None, ),
}, kind: None,
},
),
}, },
),
None,
Some(
Located { Located {
location: Location { location: Location {
row: 1, row: 1,
column: 16, column: 13,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 19, column: 14,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Name(
value: Str( ExprName {
"d", id: "c",
), ctx: Load,
kind: None, },
},
},
),
],
values: [
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant {
value: Str(
"b",
), ),
kind: None,
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 14, column: 21,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "c", column: 24,
ctx: Load, },
}, ),
}, custom: (),
Located { node: Constant(
location: Location { ExprConstant {
row: 1, value: Str(
column: 21, "e",
}, ),
end_location: Some( kind: None,
Location { },
row: 1,
column: 24,
},
),
custom: (),
node: Constant {
value: Str(
"e",
), ),
kind: None,
}, },
}, ],
], },
}, ),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,320 +14,358 @@ Located {
}, },
), ),
custom: (), custom: (),
node: Call { node: Call(
func: Located { ExprCall {
location: Location { func: Located {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Attribute {
value: Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Constant {
value: Str(
" ",
),
kind: None,
},
},
attr: "join",
ctx: Load,
},
},
args: [
Located {
location: Location { location: Location {
row: 2, row: 1,
column: 4, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 6, row: 1,
column: 5, column: 8,
}, },
), ),
custom: (), custom: (),
node: GeneratorExp { node: Attribute(
elt: Located { ExprAttribute {
location: Location { value: Located {
row: 2, location: Location {
column: 4, row: 1,
}, column: 0,
end_location: Some(
Location {
row: 2,
column: 7,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "sql", column: 3,
ctx: Load, },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
" ",
),
kind: None,
},
),
}, },
attr: "join",
ctx: Load,
}, },
generators: [ ),
Comprehension {
target: Located {
location: Location {
row: 3,
column: 8,
},
end_location: Some(
Location {
row: 3,
column: 11,
},
),
custom: (),
node: Name {
id: "sql",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 3,
column: 15,
},
end_location: Some(
Location {
row: 6,
column: 5,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 45,
},
),
custom: (),
node: IfExp {
test: Located {
location: Location {
row: 4,
column: 30,
},
end_location: Some(
Location {
row: 4,
column: 35,
},
),
custom: (),
node: Name {
id: "limit",
ctx: Load,
},
},
body: Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 26,
},
),
custom: (),
node: BinOp {
left: Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 18,
},
),
custom: (),
node: Constant {
value: Str(
"LIMIT %d",
),
kind: None,
},
},
op: Mod,
right: Located {
location: Location {
row: 4,
column: 21,
},
end_location: Some(
Location {
row: 4,
column: 26,
},
),
custom: (),
node: Name {
id: "limit",
ctx: Load,
},
},
},
},
orelse: Located {
location: Location {
row: 4,
column: 41,
},
end_location: Some(
Location {
row: 4,
column: 45,
},
),
custom: (),
node: Constant {
value: None,
kind: None,
},
},
},
},
Located {
location: Location {
row: 5,
column: 8,
},
end_location: Some(
Location {
row: 5,
column: 50,
},
),
custom: (),
node: IfExp {
test: Located {
location: Location {
row: 5,
column: 34,
},
end_location: Some(
Location {
row: 5,
column: 40,
},
),
custom: (),
node: Name {
id: "offset",
ctx: Load,
},
},
body: Located {
location: Location {
row: 5,
column: 9,
},
end_location: Some(
Location {
row: 5,
column: 29,
},
),
custom: (),
node: BinOp {
left: Located {
location: Location {
row: 5,
column: 9,
},
end_location: Some(
Location {
row: 5,
column: 20,
},
),
custom: (),
node: Constant {
value: Str(
"OFFSET %d",
),
kind: None,
},
},
op: Mod,
right: Located {
location: Location {
row: 5,
column: 23,
},
end_location: Some(
Location {
row: 5,
column: 29,
},
),
custom: (),
node: Name {
id: "offset",
ctx: Load,
},
},
},
},
orelse: Located {
location: Location {
row: 5,
column: 46,
},
end_location: Some(
Location {
row: 5,
column: 50,
},
),
custom: (),
node: Constant {
value: None,
kind: None,
},
},
},
},
],
ctx: Load,
},
},
ifs: [],
is_async: 0,
},
],
},
}, },
], args: [
keywords: [], Located {
}, location: Location {
row: 2,
column: 4,
},
end_location: Some(
Location {
row: 6,
column: 5,
},
),
custom: (),
node: GeneratorExp(
ExprGeneratorExp {
elt: Located {
location: Location {
row: 2,
column: 4,
},
end_location: Some(
Location {
row: 2,
column: 7,
},
),
custom: (),
node: Name(
ExprName {
id: "sql",
ctx: Load,
},
),
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 3,
column: 8,
},
end_location: Some(
Location {
row: 3,
column: 11,
},
),
custom: (),
node: Name(
ExprName {
id: "sql",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 3,
column: 15,
},
end_location: Some(
Location {
row: 6,
column: 5,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 45,
},
),
custom: (),
node: IfExp(
ExprIfExp {
test: Located {
location: Location {
row: 4,
column: 30,
},
end_location: Some(
Location {
row: 4,
column: 35,
},
),
custom: (),
node: Name(
ExprName {
id: "limit",
ctx: Load,
},
),
},
body: Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 26,
},
),
custom: (),
node: BinOp(
ExprBinOp {
left: Located {
location: Location {
row: 4,
column: 8,
},
end_location: Some(
Location {
row: 4,
column: 18,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"LIMIT %d",
),
kind: None,
},
),
},
op: Mod,
right: Located {
location: Location {
row: 4,
column: 21,
},
end_location: Some(
Location {
row: 4,
column: 26,
},
),
custom: (),
node: Name(
ExprName {
id: "limit",
ctx: Load,
},
),
},
},
),
},
orelse: Located {
location: Location {
row: 4,
column: 41,
},
end_location: Some(
Location {
row: 4,
column: 45,
},
),
custom: (),
node: Constant(
ExprConstant {
value: None,
kind: None,
},
),
},
},
),
},
Located {
location: Location {
row: 5,
column: 8,
},
end_location: Some(
Location {
row: 5,
column: 50,
},
),
custom: (),
node: IfExp(
ExprIfExp {
test: Located {
location: Location {
row: 5,
column: 34,
},
end_location: Some(
Location {
row: 5,
column: 40,
},
),
custom: (),
node: Name(
ExprName {
id: "offset",
ctx: Load,
},
),
},
body: Located {
location: Location {
row: 5,
column: 9,
},
end_location: Some(
Location {
row: 5,
column: 29,
},
),
custom: (),
node: BinOp(
ExprBinOp {
left: Located {
location: Location {
row: 5,
column: 9,
},
end_location: Some(
Location {
row: 5,
column: 20,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"OFFSET %d",
),
kind: None,
},
),
},
op: Mod,
right: Located {
location: Location {
row: 5,
column: 23,
},
end_location: Some(
Location {
row: 5,
column: 29,
},
),
custom: (),
node: Name(
ExprName {
id: "offset",
ctx: Load,
},
),
},
},
),
},
orelse: Located {
location: Location {
row: 5,
column: 46,
},
end_location: Some(
Location {
row: 5,
column: 50,
},
),
custom: (),
node: Constant(
ExprConstant {
value: None,
kind: None,
},
),
},
},
),
},
],
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
},
],
keywords: [],
},
),
} }

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,43 +14,49 @@ Located {
}, },
), ),
custom: (), custom: (),
node: BoolOp { node: BoolOp(
op: And, ExprBoolOp {
values: [ op: And,
Located { values: [
location: Location { Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 1, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 1,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "y", column: 7,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
}, },
}, ],
], },
}, ),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,43 +14,49 @@ Located {
}, },
), ),
custom: (), custom: (),
node: BoolOp { node: BoolOp(
op: Or, ExprBoolOp {
values: [ op: Or,
Located { values: [
location: Location { Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 1, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 1,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 6, column: 5,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "y", column: 6,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
}, },
}, ],
], },
}, ),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: "parse_program(source, \"<test>\").unwrap()" expression: "parse_program(source, \"<test>\").unwrap()"
--- ---
[ [
@ -15,212 +15,224 @@ expression: "parse_program(source, \"<test>\").unwrap()"
}, },
), ),
custom: (), custom: (),
node: ClassDef { node: ClassDef(
name: "Foo", StmtClassDef {
bases: [ name: "Foo",
Located { bases: [
location: Location { Located {
row: 1, location: Location {
column: 10,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 11, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "A", column: 11,
ctx: Load,
},
},
Located {
location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Name {
id: "B",
ctx: Load,
},
},
],
keywords: [],
body: [
Located {
location: Location {
row: 2,
column: 1,
},
end_location: Some(
Location {
row: 3,
column: 6,
},
),
custom: (),
node: FunctionDef {
name: "__init__",
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 2,
column: 14,
},
end_location: Some(
Location {
row: 2,
column: 18,
},
),
custom: (),
node: ArgData {
arg: "self",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: [
Located {
location: Location {
row: 3,
column: 2,
},
end_location: Some(
Location {
row: 3,
column: 6,
},
),
custom: (),
node: Pass,
}, },
], ),
decorator_list: [], custom: (),
returns: None, node: Name(
type_comment: None, ExprName {
id: "A",
ctx: Load,
},
),
}, },
}, Located {
Located { location: Location {
location: Location { row: 1,
row: 4, column: 13,
column: 1,
},
end_location: Some(
Location {
row: 5,
column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: FunctionDef { row: 1,
name: "method_with_default", column: 14,
args: Arguments { },
posonlyargs: [], ),
args: [ custom: (),
Located { node: Name(
location: Location { ExprName {
row: 4, id: "B",
column: 25, ctx: Load,
}, },
end_location: Some( ),
Location { },
row: 4, ],
column: 29, keywords: [],
body: [
Located {
location: Location {
row: 2,
column: 1,
},
end_location: Some(
Location {
row: 3,
column: 6,
},
),
custom: (),
node: FunctionDef(
StmtFunctionDef {
name: "__init__",
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 2,
column: 14,
},
end_location: Some(
Location {
row: 2,
column: 18,
},
),
custom: (),
node: ArgData {
arg: "self",
annotation: None,
type_comment: None,
},
}, },
), ],
custom: (), vararg: None,
node: ArgData { kwonlyargs: [],
arg: "self", kw_defaults: [],
annotation: None, kwarg: None,
type_comment: None, defaults: [],
},
}, },
Located { body: [
location: Location { Located {
row: 4, location: Location {
column: 31, row: 3,
}, column: 2,
end_location: Some(
Location {
row: 4,
column: 34,
}, },
), end_location: Some(
custom: (), Location {
node: ArgData { row: 3,
arg: "arg", column: 6,
annotation: None, },
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 4,
column: 35,
},
end_location: Some(
Location {
row: 4,
column: 44,
},
),
custom: (),
node: Constant {
value: Str(
"default",
), ),
kind: None, custom: (),
node: Pass,
}, },
}, ],
], decorator_list: [],
}, returns: None,
body: [ type_comment: None,
Located {
location: Location {
row: 5,
column: 2,
},
end_location: Some(
Location {
row: 5,
column: 6,
},
),
custom: (),
node: Pass,
}, },
], ),
decorator_list: [],
returns: None,
type_comment: None,
}, },
}, Located {
], location: Location {
decorator_list: [], row: 4,
}, column: 1,
},
end_location: Some(
Location {
row: 5,
column: 6,
},
),
custom: (),
node: FunctionDef(
StmtFunctionDef {
name: "method_with_default",
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 4,
column: 25,
},
end_location: Some(
Location {
row: 4,
column: 29,
},
),
custom: (),
node: ArgData {
arg: "self",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 4,
column: 31,
},
end_location: Some(
Location {
row: 4,
column: 34,
},
),
custom: (),
node: ArgData {
arg: "arg",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [
Located {
location: Location {
row: 4,
column: 35,
},
end_location: Some(
Location {
row: 4,
column: 44,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"default",
),
kind: None,
},
),
},
],
},
body: [
Located {
location: Location {
row: 5,
column: 2,
},
end_location: Some(
Location {
row: 5,
column: 6,
},
),
custom: (),
node: Pass,
},
],
decorator_list: [],
returns: None,
type_comment: None,
},
),
},
],
decorator_list: [],
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,80 +14,90 @@ Located {
}, },
), ),
custom: (), custom: (),
node: DictComp { node: DictComp(
key: Located { ExprDictComp {
location: Location { key: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 3, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: Name {
id: "x1",
ctx: Load,
},
},
value: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Name {
id: "x2",
ctx: Load,
},
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1, row: 1,
column: 12, column: 3,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Name(
column: 13, ExprName {
}, id: "x1",
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load, ctx: Load,
}, },
}, ),
ifs: [],
is_async: 0,
}, },
], value: Located {
}, location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Name(
ExprName {
id: "x2",
ctx: Load,
},
),
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,249 +14,277 @@ Located {
}, },
), ),
custom: (), custom: (),
node: ListComp { node: ListComp(
elt: Located { ExprListComp {
location: Location { elt: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 2, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 2,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Name(
ExprName {
id: "y2",
ctx: Store,
},
),
},
],
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
Comprehension {
target: Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Name(
ExprName {
id: "a",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 28,
},
),
custom: (),
node: Name(
ExprName {
id: "b",
ctx: Load,
},
),
},
ifs: [
Located {
location: Location {
row: 1,
column: 32,
},
end_location: Some(
Location {
row: 1,
column: 37,
},
),
custom: (),
node: Compare(
ExprCompare {
left: Located {
location: Location {
row: 1,
column: 32,
},
end_location: Some(
Location {
row: 1,
column: 33,
},
),
custom: (),
node: Name(
ExprName {
id: "a",
ctx: Load,
},
),
},
ops: [
Lt,
],
comparators: [
Located {
location: Location {
row: 1,
column: 36,
},
end_location: Some(
Location {
row: 1,
column: 37,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
5,
),
kind: None,
},
),
},
],
},
),
},
Located {
location: Location {
row: 1,
column: 41,
},
end_location: Some(
Location {
row: 1,
column: 47,
},
),
custom: (),
node: Compare(
ExprCompare {
left: Located {
location: Location {
row: 1,
column: 41,
},
end_location: Some(
Location {
row: 1,
column: 42,
},
),
custom: (),
node: Name(
ExprName {
id: "a",
ctx: Load,
},
),
},
ops: [
Gt,
],
comparators: [
Located {
location: Location {
row: 1,
column: 45,
},
end_location: Some(
Location {
row: 1,
column: 47,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
10,
),
kind: None,
},
),
},
],
},
),
},
],
is_async: 0,
},
],
}, },
generators: [ ),
Comprehension {
target: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Name {
id: "y2",
ctx: Store,
},
},
],
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load,
},
},
ifs: [],
is_async: 0,
},
Comprehension {
target: Located {
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 23,
},
),
custom: (),
node: Name {
id: "a",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 27,
},
end_location: Some(
Location {
row: 1,
column: 28,
},
),
custom: (),
node: Name {
id: "b",
ctx: Load,
},
},
ifs: [
Located {
location: Location {
row: 1,
column: 32,
},
end_location: Some(
Location {
row: 1,
column: 37,
},
),
custom: (),
node: Compare {
left: Located {
location: Location {
row: 1,
column: 32,
},
end_location: Some(
Location {
row: 1,
column: 33,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ops: [
Lt,
],
comparators: [
Located {
location: Location {
row: 1,
column: 36,
},
end_location: Some(
Location {
row: 1,
column: 37,
},
),
custom: (),
node: Constant {
value: Int(
5,
),
kind: None,
},
},
],
},
},
Located {
location: Location {
row: 1,
column: 41,
},
end_location: Some(
Location {
row: 1,
column: 47,
},
),
custom: (),
node: Compare {
left: Located {
location: Location {
row: 1,
column: 41,
},
end_location: Some(
Location {
row: 1,
column: 42,
},
),
custom: (),
node: Name {
id: "a",
ctx: Load,
},
},
ops: [
Gt,
],
comparators: [
Located {
location: Location {
row: 1,
column: 45,
},
end_location: Some(
Location {
row: 1,
column: 47,
},
),
custom: (),
node: Constant {
value: Int(
10,
),
kind: None,
},
},
],
},
},
],
is_async: 0,
},
],
},
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,43 +15,49 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 14, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 14,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Str(
"Hello world",
),
kind: None,
},
}, },
], ),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
),
},
],
},
),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,63 +14,71 @@ Located {
}, },
), ),
custom: (), custom: (),
node: GeneratorExp { node: GeneratorExp(
elt: Located { ExprGeneratorExp {
location: Location { elt: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 2, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: Name {
id: "x",
ctx: Load,
},
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1, row: 1,
column: 7, column: 2,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Name(
column: 8, ExprName {
}, id: "x",
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load, ctx: Load,
}, },
}, ),
ifs: [],
is_async: 0,
}, },
], generators: [
}, Comprehension {
target: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,110 +15,107 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: If { node: If(
test: Located { StmtIf {
location: Location { test: Located {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
body: [
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 6, column: 3,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 8, column: 4,
}, },
), ),
custom: (), custom: (),
node: Expr { node: Constant(
value: Located { ExprConstant {
location: Location { value: Int(
row: 1, 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
), ),
custom: (), kind: None,
node: Constant {
value: Int(
10,
),
kind: None,
},
}, },
}, ),
}, },
], body: [
orelse: [ Located {
Located { location: Location {
location: Location { row: 1,
row: 2, column: 6,
column: 0,
},
end_location: Some(
Location {
row: 3,
column: 8,
}, },
), end_location: Some(
custom: (), Location {
node: If { row: 1,
test: Located { column: 8,
location: Location {
row: 2,
column: 5,
}, },
end_location: Some( ),
Location { custom: (),
row: 2, node: Expr(
column: 6, StmtExpr {
}, value: Located {
), location: Location {
custom: (), row: 1,
node: Constant { column: 6,
value: Int(
2,
),
kind: None,
},
},
body: [
Located {
location: Location {
row: 2,
column: 8,
},
end_location: Some(
Location {
row: 2,
column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Expr { row: 1,
value: Located { column: 8,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
10,
),
kind: None,
},
),
},
},
),
},
],
orelse: [
Located {
location: Location {
row: 2,
column: 0,
},
end_location: Some(
Location {
row: 3,
column: 8,
},
),
custom: (),
node: If(
StmtIf {
test: Located {
location: Location {
row: 2,
column: 5,
},
end_location: Some(
Location {
row: 2,
column: 6,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
body: [
Located {
location: Location { location: Location {
row: 2, row: 2,
column: 8, column: 8,
@ -130,31 +127,35 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Expr(
value: Int( StmtExpr {
20, value: Located {
), location: Location {
kind: None, row: 2,
}, column: 8,
},
end_location: Some(
Location {
row: 2,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
20,
),
kind: None,
},
),
},
},
),
}, },
}, ],
}, orelse: [
], Located {
orelse: [
Located {
location: Location {
row: 3,
column: 6,
},
end_location: Some(
Location {
row: 3,
column: 8,
},
),
custom: (),
node: Expr {
value: Located {
location: Location { location: Location {
row: 3, row: 3,
column: 6, column: 6,
@ -166,19 +167,38 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Expr(
value: Int( StmtExpr {
30, value: Located {
), location: Location {
kind: None, row: 3,
}, column: 6,
},
end_location: Some(
Location {
row: 3,
column: 8,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
30,
),
kind: None,
},
),
},
},
),
}, },
}, ],
}, },
], ),
}, },
}, ],
], },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,112 +14,126 @@ Located {
}, },
), ),
custom: (), custom: (),
node: GeneratorExp { node: GeneratorExp(
elt: Located { ExprGeneratorExp {
location: Location { elt: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 14, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: IfExp {
test: Located {
location: Location {
row: 1, row: 1,
column: 6, column: 14,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: IfExp(
column: 7, ExprIfExp {
test: Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
}, },
), body: Located {
custom: (), location: Location {
node: Name { row: 1,
id: "y", column: 1,
ctx: Load, },
}, end_location: Some(
}, Location {
body: Located { row: 1,
location: Location { column: 2,
row: 1, },
column: 1, ),
}, custom: (),
end_location: Some( node: Name(
Location { ExprName {
row: 1, id: "x",
column: 2, ctx: Load,
},
),
}, },
), orelse: Located {
custom: (), location: Location {
node: Name { row: 1,
id: "x", column: 13,
ctx: Load, },
}, end_location: Some(
}, Location {
orelse: Located { row: 1,
location: Location { column: 14,
row: 1, },
column: 13, ),
}, custom: (),
end_location: Some( node: Name(
Location { ExprName {
row: 1, id: "y",
column: 14, ctx: Load,
},
),
}, },
),
custom: (),
node: Name {
id: "y",
ctx: Load,
}, },
}, ),
}, },
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 24,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
}, },
generators: [ ),
Comprehension {
target: Located {
location: Location {
row: 1,
column: 19,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 24,
},
end_location: Some(
Location {
row: 1,
column: 25,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load,
},
},
ifs: [],
is_async: 0,
},
],
},
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,79 +15,69 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 32, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Call {
func: Located {
location: Location {
row: 1, row: 1,
column: 0, column: 32,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Call(
column: 7, ExprCall {
}, func: Located {
), location: Location {
custom: (),
node: Name {
id: "my_func",
ctx: Load,
},
},
args: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 20, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 7,
"positional", },
), ),
kind: None, custom: (),
}, node: Name(
}, ExprName {
], id: "my_func",
keywords: [ ctx: Load,
Located { },
location: Location {
row: 1,
column: 22,
},
end_location: Some(
Location {
row: 1,
column: 31,
},
),
custom: (),
node: KeywordData {
arg: Some(
"keyword",
), ),
value: Located { },
args: [
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 30, column: 8,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"positional",
),
kind: None,
},
),
},
],
keywords: [
Located {
location: Location {
row: 1,
column: 22,
}, },
end_location: Some( end_location: Some(
Location { Location {
@ -96,18 +86,38 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: KeywordData {
value: Int( arg: Some(
2, "keyword",
), ),
kind: None, value: Located {
location: Location {
row: 1,
column: 30,
},
end_location: Some(
Location {
row: 1,
column: 31,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
}, },
}, },
}, ],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,102 +15,73 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 18, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Lambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "x",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "y",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: Located {
location: Location {
row: 1, row: 1,
column: 13, column: 18,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Lambda(
column: 18, ExprLambda {
args: Arguments {
posonlyargs: [],
args: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: ArgData {
arg: "x",
annotation: None,
type_comment: None,
},
},
Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: ArgData {
arg: "y",
annotation: None,
type_comment: None,
},
},
],
vararg: None,
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
}, },
), body: Located {
custom: (),
node: BinOp {
left: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 13, column: 13,
}, },
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Name {
id: "x",
ctx: Load,
},
},
op: Mult,
right: Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
@ -118,15 +89,54 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Name { node: BinOp(
id: "y", ExprBinOp {
ctx: Load, left: Located {
}, location: Location {
row: 1,
column: 13,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
op: Mult,
right: Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 18,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
},
),
}, },
}, },
}, ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,63 +14,71 @@ Located {
}, },
), ),
custom: (), custom: (),
node: ListComp { node: ListComp(
elt: Located { ExprListComp {
location: Location { elt: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 2, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: Name {
id: "x",
ctx: Load,
},
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1, row: 1,
column: 7, column: 2,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Name(
column: 8, ExprName {
}, id: "x",
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load, ctx: Load,
}, },
}, ),
ifs: [],
is_async: 0,
}, },
], generators: [
}, Comprehension {
target: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
},
iter: Located {
location: Location {
row: 1,
column: 12,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
},
],
},
),
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,72 +14,45 @@ Located {
}, },
), ),
custom: (), custom: (),
node: GeneratorExp { node: GeneratorExp(
elt: Located { ExprGeneratorExp {
location: Location { elt: Located {
row: 1, location: Location {
column: 1,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 11, column: 1,
}, },
), end_location: Some(
custom: (), Location {
node: NamedExpr {
target: Located {
location: Location {
row: 1, row: 1,
column: 1, column: 11,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: NamedExpr(
column: 2, ExprNamedExpr {
}, target: Located {
),
custom: (),
node: Name {
id: "x",
ctx: Store,
},
},
value: Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: BinOp {
left: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 6, column: 1,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 7, column: 2,
}, },
), ),
custom: (), custom: (),
node: Name { node: Name(
id: "y", ExprName {
ctx: Load, id: "x",
}, ctx: Store,
},
),
}, },
op: Add, value: Located {
right: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 10, column: 6,
}, },
end_location: Some( end_location: Some(
Location { Location {
@ -88,56 +61,99 @@ Located {
}, },
), ),
custom: (), custom: (),
node: Constant { node: BinOp(
value: Int( ExprBinOp {
1, left: Located {
), location: Location {
kind: None, row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Load,
},
),
},
op: Add,
right: Located {
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
},
),
},
},
),
},
generators: [
Comprehension {
target: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
}, },
}, ),
custom: (),
node: Name(
ExprName {
id: "y",
ctx: Store,
},
),
}, },
iter: Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: Name(
ExprName {
id: "z",
ctx: Load,
},
),
},
ifs: [],
is_async: 0,
}, },
}, ],
}, },
generators: [ ),
Comprehension {
target: Located {
location: Location {
row: 1,
column: 16,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Name {
id: "y",
ctx: Store,
},
},
iter: Located {
location: Location {
row: 1,
column: 21,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: Name {
id: "z",
ctx: Load,
},
},
ifs: [],
is_async: 0,
},
],
},
} }

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,80 +15,90 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 23, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Call {
func: Located {
location: Location {
row: 1, row: 1,
column: 0, column: 23,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Call(
column: 5, ExprCall {
}, func: Located {
), location: Location {
custom: (),
node: Name {
id: "print",
ctx: Load,
},
},
args: [
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 19, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 5,
"Hello world", },
),
custom: (),
node: Name(
ExprName {
id: "print",
ctx: Load,
},
), ),
kind: None,
}, },
}, args: [
Located { Located {
location: Location { location: Location {
row: 1, row: 1,
column: 21, column: 6,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 22, column: 19,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
),
}, },
), Located {
custom: (), location: Location {
node: Constant { row: 1,
value: Int( column: 21,
2, },
), end_location: Some(
kind: None, Location {
}, row: 1,
column: 22,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
],
keywords: [],
}, },
], ),
keywords: [],
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,61 +15,69 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 20, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Call {
func: Located {
location: Location {
row: 1, row: 1,
column: 0, column: 20,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Call(
column: 5, ExprCall {
}, func: Located {
), location: Location {
custom: (),
node: Name {
id: "print",
ctx: Load,
},
},
args: [
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 19, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 5,
"Hello world", },
),
custom: (),
node: Name(
ExprName {
id: "print",
ctx: Load,
},
), ),
kind: None,
}, },
args: [
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 19,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
),
},
],
keywords: [],
}, },
], ),
keywords: [],
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 13, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 13,
"Hello world", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: "parse_program(source, \"<test>\").unwrap()" expression: "parse_program(source, \"<test>\").unwrap()"
--- ---
[ [
@ -15,118 +15,132 @@ expression: "parse_program(source, \"<test>\").unwrap()"
}, },
), ),
custom: (), custom: (),
node: Assign { node: Assign(
targets: [ StmtAssign {
Located { targets: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Tuple(
ExprTuple {
elts: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 1,
},
),
custom: (),
node: Name(
ExprName {
id: "a",
ctx: Store,
},
),
},
Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Name(
ExprName {
id: "b",
ctx: Store,
},
),
},
],
ctx: Store,
},
),
},
],
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 7,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 4, column: 11,
}, },
), ),
custom: (), custom: (),
node: Tuple { node: Tuple(
elts: [ ExprTuple {
Located { elts: [
location: Location { Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 1, column: 7,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "a", column: 8,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
4,
),
kind: None,
},
),
}, },
}, Located {
Located { location: Location {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 4, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "b", column: 11,
ctx: Store, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
5,
),
kind: None,
},
),
}, },
}, ],
], ctx: Load,
ctx: Store,
},
},
],
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Tuple {
elts: [
Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant {
value: Int(
4,
),
kind: None,
},
}, },
Located { ),
location: Location {
row: 1,
column: 10,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant {
value: Int(
5,
),
kind: None,
},
},
],
ctx: Load,
}, },
type_comment: None,
}, },
type_comment: None, ),
},
}, },
] ]

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
Located { Located {
@ -14,102 +14,114 @@ Located {
}, },
), ),
custom: (), custom: (),
node: Subscript { node: Subscript(
value: Located { ExprSubscript {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 1, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "x", column: 1,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
}, },
}, slice: Located {
slice: Located { location: Location {
location: Location {
row: 1,
column: 2,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 7, column: 2,
}, },
), end_location: Some(
custom: (), Location {
node: Slice { row: 1,
lower: Some( column: 7,
Located {
location: Location {
row: 1,
column: 2,
},
end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
}, },
), ),
upper: Some( custom: (),
Located { node: Slice(
location: Location { ExprSlice {
row: 1, lower: Some(
column: 4, Located {
}, location: Location {
end_location: Some( row: 1,
Location { column: 2,
row: 1, },
column: 5, end_location: Some(
Location {
row: 1,
column: 3,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
}, },
), ),
custom: (), upper: Some(
node: Constant { Located {
value: Int( location: Location {
2, row: 1,
), column: 4,
kind: None, },
}, end_location: Some(
}, Location {
), row: 1,
step: Some( column: 5,
Located { },
location: Location { ),
row: 1, custom: (),
column: 6, node: Constant(
}, ExprConstant {
end_location: Some( value: Int(
Location { 2,
row: 1, ),
column: 7, kind: None,
},
),
},
),
step: Some(
Located {
location: Location {
row: 1,
column: 6,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
3,
),
kind: None,
},
),
}, },
), ),
custom: (),
node: Constant {
value: Int(
3,
),
kind: None,
},
}, },
), ),
}, },
ctx: Load,
}, },
ctx: Load, ),
},
} }

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,36 +15,25 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Try { node: Try(
body: [ StmtTry {
Located { body: [
location: Location { Located {
row: 2, location: Location {
column: 4,
},
end_location: Some(
Location {
row: 2, row: 2,
column: 23, column: 4,
}, },
), end_location: Some(
custom: (), Location {
node: Raise { row: 2,
exc: Some( column: 23,
Located { },
location: Location { ),
row: 2, custom: (),
column: 10, node: Raise(
}, StmtRaise {
end_location: Some( exc: Some(
Location { Located {
row: 2,
column: 23,
},
),
custom: (),
node: Call {
func: Located {
location: Location { location: Location {
row: 2, row: 2,
column: 10, column: 10,
@ -52,95 +41,105 @@ expression: parse_ast
end_location: Some( end_location: Some(
Location { Location {
row: 2, row: 2,
column: 20, column: 23,
}, },
), ),
custom: (), custom: (),
node: Name { node: Call(
id: "ValueError", ExprCall {
ctx: Load, func: Located {
}, location: Location {
}, row: 2,
args: [ column: 10,
Located { },
location: Location { end_location: Some(
row: 2, Location {
column: 21, row: 2,
}, column: 20,
end_location: Some( },
Location { ),
row: 2, custom: (),
column: 22, node: Name(
ExprName {
id: "ValueError",
ctx: Load,
},
),
}, },
), args: [
custom: (), Located {
node: Constant { location: Location {
value: Int( row: 2,
1, column: 21,
), },
kind: None, end_location: Some(
Location {
row: 2,
column: 22,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
),
},
],
keywords: [],
}, },
}, ),
], },
keywords: [], ),
}, cause: None,
}, },
), ),
cause: None,
}, },
}, ],
], handlers: [
handlers: [ Located {
Located { location: Location {
location: Location { row: 3,
row: 3, column: 0,
column: 0,
},
end_location: Some(
Location {
row: 4,
column: 30,
}, },
), end_location: Some(
custom: (), Location {
node: ExceptHandler { row: 4,
type_: Some( column: 30,
Located {
location: Location {
row: 3,
column: 7,
},
end_location: Some(
Location {
row: 3,
column: 16,
},
),
custom: (),
node: Name {
id: "TypeError",
ctx: Load,
},
}, },
), ),
name: Some( custom: (),
"e", node: ExceptHandler(
), ExcepthandlerExceptHandler {
body: [ type_: Some(
Located { Located {
location: Location { location: Location {
row: 4, row: 3,
column: 4, column: 7,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 4, row: 3,
column: 30, column: 16,
},
),
custom: (),
node: Name(
ExprName {
id: "TypeError",
ctx: Load,
},
),
}, },
), ),
custom: (), name: Some(
node: Expr { "e",
value: Located { ),
body: [
Located {
location: Location { location: Location {
row: 4, row: 4,
column: 4, column: 4,
@ -152,189 +151,211 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Call { node: Expr(
func: Located { StmtExpr {
location: Location { value: Located {
row: 4,
column: 4,
},
end_location: Some(
Location {
row: 4,
column: 9,
},
),
custom: (),
node: Name {
id: "print",
ctx: Load,
},
},
args: [
Located {
location: Location { location: Location {
row: 4, row: 4,
column: 10, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 4, row: 4,
column: 29, column: 30,
}, },
), ),
custom: (), custom: (),
node: JoinedStr { node: Call(
values: [ ExprCall {
Located { func: Located {
location: Location { location: Location {
row: 4, row: 4,
column: 10, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 4, row: 4,
column: 29, column: 9,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Name(
value: Str( ExprName {
"caught ", id: "print",
), ctx: Load,
kind: None, },
}, ),
}, },
Located { args: [
location: Location { Located {
row: 4, location: Location {
column: 10,
},
end_location: Some(
Location {
row: 4, row: 4,
column: 29, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: FormattedValue {
value: Located {
location: Location {
row: 4, row: 4,
column: 20, column: 29,
}, },
end_location: Some( ),
Location { custom: (),
row: 4, node: JoinedStr(
column: 27, ExprJoinedStr {
}, values: [
),
custom: (),
node: Call {
func: Located {
location: Location {
row: 4,
column: 20,
},
end_location: Some(
Location {
row: 4,
column: 24,
},
),
custom: (),
node: Name {
id: "type",
ctx: Load,
},
},
args: [
Located { Located {
location: Location { location: Location {
row: 4, row: 4,
column: 25, column: 10,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 4, row: 4,
column: 26, column: 29,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "e", ExprConstant {
ctx: Load, value: Str(
"caught ",
),
kind: None,
},
),
},
Located {
location: Location {
row: 4,
column: 10,
}, },
end_location: Some(
Location {
row: 4,
column: 29,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 4,
column: 20,
},
end_location: Some(
Location {
row: 4,
column: 27,
},
),
custom: (),
node: Call(
ExprCall {
func: Located {
location: Location {
row: 4,
column: 20,
},
end_location: Some(
Location {
row: 4,
column: 24,
},
),
custom: (),
node: Name(
ExprName {
id: "type",
ctx: Load,
},
),
},
args: [
Located {
location: Location {
row: 4,
column: 25,
},
end_location: Some(
Location {
row: 4,
column: 26,
},
),
custom: (),
node: Name(
ExprName {
id: "e",
ctx: Load,
},
),
},
],
keywords: [],
},
),
},
conversion: 0,
format_spec: None,
},
),
}, },
], ],
keywords: [],
}, },
}, ),
conversion: 0,
format_spec: None,
}, },
}, ],
], keywords: [],
}, },
),
}, },
], },
keywords: [], ),
},
}, },
}, ],
}, },
], ),
}, },
}, Located {
Located { location: Location {
location: Location { row: 5,
row: 5, column: 0,
column: 0,
},
end_location: Some(
Location {
row: 6,
column: 30,
}, },
), end_location: Some(
custom: (), Location {
node: ExceptHandler { row: 6,
type_: Some( column: 30,
Located {
location: Location {
row: 5,
column: 7,
},
end_location: Some(
Location {
row: 5,
column: 14,
},
),
custom: (),
node: Name {
id: "OSError",
ctx: Load,
},
}, },
), ),
name: Some( custom: (),
"e", node: ExceptHandler(
), ExcepthandlerExceptHandler {
body: [ type_: Some(
Located { Located {
location: Location { location: Location {
row: 6, row: 5,
column: 4, column: 7,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 6, row: 5,
column: 30, column: 14,
},
),
custom: (),
node: Name(
ExprName {
id: "OSError",
ctx: Load,
},
),
}, },
), ),
custom: (), name: Some(
node: Expr { "e",
value: Located { ),
body: [
Located {
location: Location { location: Location {
row: 6, row: 6,
column: 4, column: 4,
@ -346,142 +367,175 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Call { node: Expr(
func: Located { StmtExpr {
location: Location { value: Located {
row: 6,
column: 4,
},
end_location: Some(
Location {
row: 6,
column: 9,
},
),
custom: (),
node: Name {
id: "print",
ctx: Load,
},
},
args: [
Located {
location: Location { location: Location {
row: 6, row: 6,
column: 10, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 6, row: 6,
column: 29, column: 30,
}, },
), ),
custom: (), custom: (),
node: JoinedStr { node: Call(
values: [ ExprCall {
Located { func: Located {
location: Location { location: Location {
row: 6, row: 6,
column: 10, column: 4,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 6, row: 6,
column: 29, column: 9,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Name(
value: Str( ExprName {
"caught ", id: "print",
), ctx: Load,
kind: None, },
}, ),
}, },
Located { args: [
location: Location { Located {
row: 6, location: Location {
column: 10,
},
end_location: Some(
Location {
row: 6, row: 6,
column: 29, column: 10,
}, },
), end_location: Some(
custom: (), Location {
node: FormattedValue {
value: Located {
location: Location {
row: 6, row: 6,
column: 20, column: 29,
}, },
end_location: Some( ),
Location { custom: (),
row: 6, node: JoinedStr(
column: 27, ExprJoinedStr {
}, values: [
),
custom: (),
node: Call {
func: Located {
location: Location {
row: 6,
column: 20,
},
end_location: Some(
Location {
row: 6,
column: 24,
},
),
custom: (),
node: Name {
id: "type",
ctx: Load,
},
},
args: [
Located { Located {
location: Location { location: Location {
row: 6, row: 6,
column: 25, column: 10,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 6, row: 6,
column: 26, column: 29,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "e", ExprConstant {
ctx: Load, value: Str(
"caught ",
),
kind: None,
},
),
},
Located {
location: Location {
row: 6,
column: 10,
}, },
end_location: Some(
Location {
row: 6,
column: 29,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 6,
column: 20,
},
end_location: Some(
Location {
row: 6,
column: 27,
},
),
custom: (),
node: Call(
ExprCall {
func: Located {
location: Location {
row: 6,
column: 20,
},
end_location: Some(
Location {
row: 6,
column: 24,
},
),
custom: (),
node: Name(
ExprName {
id: "type",
ctx: Load,
},
),
},
args: [
Located {
location: Location {
row: 6,
column: 25,
},
end_location: Some(
Location {
row: 6,
column: 26,
},
),
custom: (),
node: Name(
ExprName {
id: "e",
ctx: Load,
},
),
},
],
keywords: [],
},
),
},
conversion: 0,
format_spec: None,
},
),
}, },
], ],
keywords: [],
}, },
}, ),
conversion: 0,
format_spec: None,
}, },
}, ],
], keywords: [],
}, },
),
}, },
], },
keywords: [], ),
},
}, },
}, ],
}, },
], ),
}, },
}, ],
], orelse: [],
orelse: [], finalbody: [],
finalbody: [], },
}, ),
}, },
] ]

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/parser.rs source: parser/src/parser.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,153 +15,152 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FunctionDef { node: FunctionDef(
name: "args_to_tuple", StmtFunctionDef {
args: Arguments { name: "args_to_tuple",
posonlyargs: [], args: Arguments {
args: [], posonlyargs: [],
vararg: Some( args: [],
vararg: Some(
Located {
location: Location {
row: 2,
column: 19,
},
end_location: Some(
Location {
row: 2,
column: 28,
},
),
custom: (),
node: ArgData {
arg: "args",
annotation: Some(
Located {
location: Location {
row: 2,
column: 25,
},
end_location: Some(
Location {
row: 2,
column: 28,
},
),
custom: (),
node: Starred(
ExprStarred {
value: Located {
location: Location {
row: 2,
column: 26,
},
end_location: Some(
Location {
row: 2,
column: 28,
},
),
custom: (),
node: Name(
ExprName {
id: "Ts",
ctx: Load,
},
),
},
ctx: Load,
},
),
},
),
type_comment: None,
},
},
),
kwonlyargs: [],
kw_defaults: [],
kwarg: None,
defaults: [],
},
body: [
Located { Located {
location: Location { location: Location {
row: 2, row: 2,
column: 19, column: 45,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 2, row: 2,
column: 28, column: 48,
}, },
), ),
custom: (), custom: (),
node: ArgData { node: Expr(
arg: "args", StmtExpr {
annotation: Some( value: Located {
Located {
location: Location { location: Location {
row: 2, row: 2,
column: 25, column: 45,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 2, row: 2,
column: 28, column: 48,
}, },
), ),
custom: (), custom: (),
node: Starred { node: Constant(
value: Located { ExprConstant {
location: Location { value: Ellipsis,
row: 2, kind: None,
column: 26,
},
end_location: Some(
Location {
row: 2,
column: 28,
},
),
custom: (),
node: Name {
id: "Ts",
ctx: Load,
},
}, },
ctx: Load, ),
},
}, },
), },
type_comment: None, ),
},
}, },
), ],
kwonlyargs: [], decorator_list: [],
kw_defaults: [], returns: Some(
kwarg: None, Located {
defaults: [], location: Location {
},
body: [
Located {
location: Location {
row: 2,
column: 45,
},
end_location: Some(
Location {
row: 2, row: 2,
column: 48, column: 33,
}, },
), end_location: Some(
custom: (), Location {
node: Expr {
value: Located {
location: Location {
row: 2, row: 2,
column: 45, column: 43,
}, },
end_location: Some( ),
Location { custom: (),
row: 2, node: Subscript(
column: 48, ExprSubscript {
},
),
custom: (),
node: Constant {
value: Ellipsis,
kind: None,
},
},
},
},
],
decorator_list: [],
returns: Some(
Located {
location: Location {
row: 2,
column: 33,
},
end_location: Some(
Location {
row: 2,
column: 43,
},
),
custom: (),
node: Subscript {
value: Located {
location: Location {
row: 2,
column: 33,
},
end_location: Some(
Location {
row: 2,
column: 38,
},
),
custom: (),
node: Name {
id: "Tuple",
ctx: Load,
},
},
slice: Located {
location: Location {
row: 2,
column: 39,
},
end_location: Some(
Location {
row: 2,
column: 42,
},
),
custom: (),
node: Starred {
value: Located { value: Located {
location: Location { location: Location {
row: 2, row: 2,
column: 40, column: 33,
},
end_location: Some(
Location {
row: 2,
column: 38,
},
),
custom: (),
node: Name(
ExprName {
id: "Tuple",
ctx: Load,
},
),
},
slice: Located {
location: Location {
row: 2,
column: 39,
}, },
end_location: Some( end_location: Some(
Location { Location {
@ -170,19 +169,38 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Name { node: Starred(
id: "Ts", ExprStarred {
ctx: Load, value: Located {
}, location: Location {
row: 2,
column: 40,
},
end_location: Some(
Location {
row: 2,
column: 42,
},
),
custom: (),
node: Name(
ExprName {
id: "Ts",
ctx: Load,
},
),
},
ctx: Load,
},
),
}, },
ctx: Load, ctx: Load,
}, },
}, ),
ctx: Load,
}, },
}, ),
), type_comment: None,
type_comment: None, },
}, ),
}, },
] ]

File diff suppressed because it is too large Load diff

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 15, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 15,
"\u{8}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{8}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 9, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 9,
"\u{7}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{7}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 21, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 21,
"\r", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\r",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 45, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 45,
"\u{89}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{89}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 12, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 12,
"\u{7f}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{7f}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,283 +15,287 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 738, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Bytes( column: 738,
[ },
0, ),
1, custom: (),
2, node: Constant(
3, ExprConstant {
4, value: Bytes(
5, [
6, 0,
7, 1,
8, 2,
9, 3,
10, 4,
11, 5,
12, 6,
13, 7,
14, 8,
15, 9,
16, 10,
17, 11,
18, 12,
19, 13,
20, 14,
21, 15,
22, 16,
23, 17,
24, 18,
25, 19,
26, 20,
27, 21,
28, 22,
29, 23,
30, 24,
31, 25,
32, 26,
33, 27,
34, 28,
35, 29,
36, 30,
37, 31,
38, 32,
39, 33,
40, 34,
41, 35,
42, 36,
43, 37,
44, 38,
45, 39,
46, 40,
47, 41,
48, 42,
49, 43,
50, 44,
51, 45,
52, 46,
53, 47,
54, 48,
55, 49,
56, 50,
57, 51,
58, 52,
59, 53,
60, 54,
61, 55,
62, 56,
63, 57,
64, 58,
65, 59,
66, 60,
67, 61,
68, 62,
69, 63,
70, 64,
71, 65,
72, 66,
73, 67,
74, 68,
75, 69,
76, 70,
77, 71,
78, 72,
79, 73,
80, 74,
81, 75,
82, 76,
83, 77,
84, 78,
85, 79,
86, 80,
87, 81,
88, 82,
89, 83,
90, 84,
91, 85,
92, 86,
93, 87,
94, 88,
95, 89,
96, 90,
97, 91,
98, 92,
99, 93,
100, 94,
101, 95,
102, 96,
103, 97,
104, 98,
105, 99,
106, 100,
107, 101,
108, 102,
109, 103,
110, 104,
111, 105,
112, 106,
113, 107,
114, 108,
115, 109,
116, 110,
117, 111,
118, 112,
119, 113,
120, 114,
121, 115,
122, 116,
123, 117,
124, 118,
125, 119,
126, 120,
127, 121,
128, 122,
129, 123,
130, 124,
131, 125,
132, 126,
133, 127,
134, 128,
135, 129,
136, 130,
137, 131,
138, 132,
139, 133,
140, 134,
141, 135,
142, 136,
143, 137,
144, 138,
145, 139,
146, 140,
147, 141,
148, 142,
149, 143,
150, 144,
151, 145,
152, 146,
153, 147,
154, 148,
155, 149,
156, 150,
157, 151,
158, 152,
159, 153,
160, 154,
161, 155,
162, 156,
163, 157,
164, 158,
165, 159,
166, 160,
167, 161,
168, 162,
169, 163,
170, 164,
171, 165,
172, 166,
173, 167,
174, 168,
175, 169,
176, 170,
177, 171,
178, 172,
179, 173,
180, 174,
181, 175,
182, 176,
183, 177,
184, 178,
185, 179,
186, 180,
187, 181,
188, 182,
189, 183,
190, 184,
191, 185,
192, 186,
193, 187,
194, 188,
195, 189,
196, 190,
197, 191,
198, 192,
199, 193,
200, 194,
201, 195,
202, 196,
203, 197,
204, 198,
205, 199,
206, 200,
207, 201,
208, 202,
209, 203,
210, 204,
211, 205,
212, 206,
213, 207,
214, 208,
215, 209,
216, 210,
217, 211,
218, 212,
219, 213,
220, 214,
221, 215,
222, 216,
223, 217,
224, 218,
225, 219,
226, 220,
227, 221,
228, 222,
229, 223,
230, 224,
231, 225,
232, 226,
233, 227,
234, 228,
235, 229,
236, 230,
237, 231,
238, 232,
239, 233,
240, 234,
241, 235,
242, 236,
243, 237,
244, 238,
245, 239,
246, 240,
247, 241,
248, 242,
249, 243,
250, 244,
251, 245,
252, 246,
253, 247,
254, 248,
255, 249,
], 250,
251,
252,
253,
254,
255,
],
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 12, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 12,
"\u{1b}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{1b}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,37 +15,41 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 13, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Bytes( column: 13,
[ },
111, ),
109, custom: (),
107, node: Constant(
109, ExprConstant {
111, value: Bytes(
107, [
92, 111,
88, 109,
97, 107,
97, 109,
], 111,
107,
92,
88,
97,
97,
],
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,32 +15,36 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 14, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Bytes( column: 14,
[ },
35, ),
97, custom: (),
4, node: Constant(
83, ExprConstant {
52, value: Bytes(
], [
35,
97,
4,
83,
52,
],
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 15, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 15,
"\u{c}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{c}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,77 +15,87 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 8, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 8,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant {
value: Str(
"\\",
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: JoinedStr(
column: 0, ExprJoinedStr {
}, values: [
end_location: Some( Located {
Location {
row: 1,
column: 8,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 5, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 8,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "x", ExprConstant {
ctx: Load, value: Str(
}, "\\",
),
kind: None,
},
),
}, },
conversion: 0, Located {
format_spec: None, location: Location {
}, row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 0,
format_spec: None,
},
),
},
],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,77 +15,87 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 8, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 8,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: Constant {
value: Str(
"\n",
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: JoinedStr(
column: 0, ExprJoinedStr {
}, values: [
end_location: Some( Located {
Location {
row: 1,
column: 8,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 5, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 6, column: 8,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "x", ExprConstant {
ctx: Load, value: Str(
}, "\n",
),
kind: None,
},
),
}, },
conversion: 0, Located {
format_spec: None, location: Location {
}, row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 8,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 5,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 0,
format_spec: None,
},
),
},
],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,77 +15,87 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0, row: 1,
}, column: 0,
end_location: Some(
Location {
row: 2,
column: 4,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 2,
values: [ column: 4,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 2,
column: 4,
},
),
custom: (),
node: Constant {
value: Str(
"\\\n",
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: JoinedStr(
column: 0, ExprJoinedStr {
}, values: [
end_location: Some( Located {
Location {
row: 2,
column: 4,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location { location: Location {
row: 2, row: 1,
column: 1, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 2, row: 2,
column: 2, column: 4,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "x", ExprConstant {
ctx: Load, value: Str(
}, "\\\n",
),
kind: None,
},
),
}, },
conversion: 0, Located {
format_spec: None, location: Location {
}, row: 1,
column: 0,
},
end_location: Some(
Location {
row: 2,
column: 4,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 2,
column: 1,
},
end_location: Some(
Location {
row: 2,
column: 2,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 0,
format_spec: None,
},
),
},
],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,64 +15,72 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"user=", value: Str(
), "user=",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant {
value: Str(
"",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
), ),
custom: (), kind: None,
node: Name {
id: "user",
ctx: Load,
},
}, },
conversion: 114, ),
format_spec: None, },
Located {
location: Location {
row: 1,
column: 0,
}, },
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
),
custom: (),
node: Name(
ExprName {
id: "user",
ctx: Load,
},
),
},
conversion: 114,
format_spec: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,84 +15,14 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"mix ", value: Str(
), "mix ",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant {
value: Str(
"user=",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant {
value: Str(
"",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
), ),
custom: (), kind: None,
node: Name {
id: "user",
ctx: Load,
},
}, },
conversion: 114, ),
format_spec: None,
},
}, },
Located { Located {
location: Location { location: Location {
@ -106,83 +36,173 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
" with text and ", value: Str(
), "user=",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant {
value: Str(
"second=",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant {
value: Str(
"",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 29,
},
end_location: Some(
Location {
row: 1,
column: 35,
},
), ),
custom: (), kind: None,
node: Name {
id: "second",
ctx: Load,
},
}, },
conversion: 114, ),
format_spec: None, },
Located {
location: Location {
row: 1,
column: 0,
}, },
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 7,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Name(
ExprName {
id: "user",
ctx: Load,
},
),
},
conversion: 114,
format_spec: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
" with text and ",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"second=",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 38,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 29,
},
end_location: Some(
Location {
row: 1,
column: 35,
},
),
custom: (),
node: Name(
ExprName {
id: "second",
ctx: Load,
},
),
},
conversion: 114,
format_spec: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,101 +15,113 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"user=", value: Str(
), "user=",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Str(
"",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 7,
},
), ),
custom: (), kind: None,
node: Name {
id: "user",
ctx: Load,
},
}, },
conversion: 0, ),
format_spec: Some( },
Located { Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 3,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 14, column: 7,
}, },
), ),
custom: (), custom: (),
node: JoinedStr { node: Name(
values: [ ExprName {
Located { id: "user",
location: Location { ctx: Load,
row: 1, },
column: 0, ),
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant {
value: Str(
">10",
),
kind: None,
},
},
],
},
}, },
), conversion: 0,
}, format_spec: Some(
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 14,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
">10",
),
kind: None,
},
),
},
],
},
),
},
),
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,77 +15,87 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0, row: 1,
}, column: 0,
end_location: Some(
Location {
row: 2,
column: 6,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 2,
values: [ column: 6,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 2,
column: 6,
},
),
custom: (),
node: Constant {
value: Str(
"\n",
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: JoinedStr(
column: 0, ExprJoinedStr {
}, values: [
end_location: Some( Located {
Location {
row: 2,
column: 6,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location { location: Location {
row: 2, row: 1,
column: 1, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 2, row: 2,
column: 2, column: 6,
}, },
), ),
custom: (), custom: (),
node: Name { node: Constant(
id: "x", ExprConstant {
ctx: Load, value: Str(
}, "\n",
),
kind: None,
},
),
}, },
conversion: 0, Located {
format_spec: None, location: Location {
}, row: 1,
column: 0,
},
end_location: Some(
Location {
row: 2,
column: 6,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 2,
column: 1,
},
end_location: Some(
Location {
row: 2,
column: 2,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 0,
format_spec: None,
},
),
},
],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 9, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 9,
"\u{88}", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"\u{88}",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,43 +15,49 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 17, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 17,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Str(
"Hello world",
),
kind: None,
},
}, },
], ),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
),
},
],
},
),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,43 +15,49 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 17, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 17,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant {
value: Str(
"Hello world",
),
kind: None,
},
}, },
], ),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 17,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
),
},
],
},
),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,79 +15,89 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 22, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: JoinedStr { row: 1,
values: [ column: 22,
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: Constant {
value: Str(
"Hello world",
),
kind: None,
},
}, },
Located { ),
location: Location { custom: (),
row: 1, node: JoinedStr(
column: 9, ExprJoinedStr {
}, values: [
end_location: Some( Located {
Location {
row: 1,
column: 22,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location { location: Location {
row: 1, row: 1,
column: 17, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 20, column: 22,
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"!", value: Str(
), "Hello world",
kind: None, ),
}, kind: None,
},
),
}, },
conversion: 0, Located {
format_spec: None, location: Location {
}, row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 22,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 17,
},
end_location: Some(
Location {
row: 1,
column: 20,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"!",
),
kind: None,
},
),
},
conversion: 0,
format_spec: None,
},
),
},
],
}, },
], ),
}, },
}, },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,27 +15,31 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1, location: Location {
column: 3,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 4, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "a", column: 4,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "a",
ctx: Load,
},
),
}, },
conversion: 0,
format_spec: None,
}, },
conversion: 0, ),
format_spec: None,
},
}, },
Located { Located {
location: Location { location: Location {
@ -49,27 +53,31 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1, location: Location {
column: 7,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 8, column: 7,
}, },
), end_location: Some(
custom: (), Location {
node: Name { row: 1,
id: "b", column: 8,
ctx: Load, },
),
custom: (),
node: Name(
ExprName {
id: "b",
ctx: Load,
},
),
}, },
conversion: 0,
format_spec: None,
}, },
conversion: 0, ),
format_spec: None,
},
}, },
Located { Located {
location: Location { location: Location {
@ -83,11 +91,13 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"{foo}", value: Str(
), "{foo}",
kind: None, ),
}, kind: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,67 +15,75 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1, location: Location {
column: 3,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 11, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Compare {
left: Located {
location: Location {
row: 1, row: 1,
column: 3, column: 11,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Compare(
column: 5, ExprCompare {
}, left: Located {
), location: Location {
custom: (),
node: Constant {
value: Int(
42,
),
kind: None,
},
},
ops: [
Eq,
],
comparators: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 11, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Int( column: 5,
42, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
42,
),
kind: None,
},
), ),
kind: None,
}, },
ops: [
Eq,
],
comparators: [
Located {
location: Location {
row: 1,
column: 9,
},
end_location: Some(
Location {
row: 1,
column: 11,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
42,
),
kind: None,
},
),
},
],
}, },
], ),
}, },
conversion: 0,
format_spec: None,
}, },
conversion: 0, ),
format_spec: None,
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,78 +15,88 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name {
id: "foo",
ctx: Load,
},
},
conversion: 0,
format_spec: Some(
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 3,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 15, column: 6,
}, },
), ),
custom: (), custom: (),
node: JoinedStr { node: Name(
values: [ ExprName {
Located { id: "foo",
location: Location { ctx: Load,
row: 1, },
column: 0, ),
}, },
end_location: Some( conversion: 0,
Location { format_spec: Some(
row: 1, Located {
column: 15, location: Location {
}, row: 1,
), column: 0,
custom: (), },
node: FormattedValue { end_location: Some(
value: Located { Location {
row: 1,
column: 15,
},
),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 8, column: 0,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 12, column: 15,
}, },
), ),
custom: (), custom: (),
node: Name { node: FormattedValue(
id: "spec", ExprFormattedValue {
ctx: Load, value: Located {
}, location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 12,
},
),
custom: (),
node: Name(
ExprName {
id: "spec",
ctx: Load,
},
),
},
conversion: 0,
format_spec: None,
},
),
}, },
conversion: 0, ],
format_spec: None,
},
}, },
], ),
}, },
}, ),
), },
}, ),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,67 +15,75 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1, location: Location {
column: 3,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 9, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Compare {
left: Located {
location: Location {
row: 1, row: 1,
column: 3, column: 9,
}, },
end_location: Some( ),
Location { custom: (),
row: 1, node: Compare(
column: 4, ExprCompare {
}, left: Located {
), location: Location {
custom: (),
node: Constant {
value: Int(
1,
),
kind: None,
},
},
ops: [
NotEq,
],
comparators: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 9, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Int( column: 4,
2, },
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
1,
),
kind: None,
},
), ),
kind: None,
}, },
ops: [
NotEq,
],
comparators: [
Located {
location: Location {
row: 1,
column: 8,
},
end_location: Some(
Location {
row: 1,
column: 9,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Int(
2,
),
kind: None,
},
),
},
],
}, },
], ),
}, },
conversion: 0,
format_spec: None,
}, },
conversion: 0, ),
format_spec: None,
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,63 +15,71 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 6,
},
),
custom: (),
node: Name {
id: "foo",
ctx: Load,
},
},
conversion: 0,
format_spec: Some(
Located {
location: Location { location: Location {
row: 1, row: 1,
column: 0, column: 3,
}, },
end_location: Some( end_location: Some(
Location { Location {
row: 1, row: 1,
column: 13, column: 6,
}, },
), ),
custom: (), custom: (),
node: JoinedStr { node: Name(
values: [ ExprName {
Located { id: "foo",
location: Location { ctx: Load,
row: 1, },
column: 0, ),
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant {
value: Str(
"spec",
),
kind: None,
},
},
],
},
}, },
), conversion: 0,
}, format_spec: Some(
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: JoinedStr(
ExprJoinedStr {
values: [
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 13,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"spec",
),
kind: None,
},
),
},
],
},
),
},
),
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,64 +15,72 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"x =", value: Str(
), "x =",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant {
value: Str(
"",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
), ),
custom: (), kind: None,
node: Name {
id: "x",
ctx: Load,
},
}, },
conversion: 114, ),
format_spec: None, },
Located {
location: Location {
row: 1,
column: 0,
}, },
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 114,
format_spec: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,64 +15,72 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Constant { node: Constant(
value: Str( ExprConstant {
"x=", value: Str(
), "x=",
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant {
value: Str(
" ",
),
kind: None,
},
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
), ),
custom: (), kind: None,
node: Name {
id: "x",
ctx: Load,
},
}, },
conversion: 114, ),
format_spec: None, },
Located {
location: Location {
row: 1,
column: 0,
}, },
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
" ",
),
kind: None,
},
),
},
Located {
location: Location {
row: 1,
column: 0,
},
end_location: Some(
Location {
row: 1,
column: 10,
},
),
custom: (),
node: FormattedValue(
ExprFormattedValue {
value: Located {
location: Location {
row: 1,
column: 3,
},
end_location: Some(
Location {
row: 1,
column: 4,
},
),
custom: (),
node: Name(
ExprName {
id: "x",
ctx: Load,
},
),
},
conversion: 114,
format_spec: None,
},
),
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,25 +15,29 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: FormattedValue { node: FormattedValue(
value: Located { ExprFormattedValue {
location: Location { value: Located {
row: 1, location: Location {
column: 3,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 8, column: 3,
}, },
), end_location: Some(
custom: (), Location {
node: Yield { row: 1,
value: None, column: 8,
},
),
custom: (),
node: Yield(
ExprYield {
value: None,
},
),
}, },
conversion: 0,
format_spec: None,
}, },
conversion: 0, ),
format_spec: None,
},
}, },
] ]

View file

@ -1,5 +1,5 @@
--- ---
source: compiler/parser/src/string.rs source: parser/src/string.rs
expression: parse_ast expression: parse_ast
--- ---
[ [
@ -15,26 +15,30 @@ expression: parse_ast
}, },
), ),
custom: (), custom: (),
node: Expr { node: Expr(
value: Located { StmtExpr {
location: Location { value: Located {
row: 1, location: Location {
column: 0,
},
end_location: Some(
Location {
row: 1, row: 1,
column: 16, column: 0,
}, },
), end_location: Some(
custom: (), Location {
node: Constant { row: 1,
value: Str( column: 16,
"Hello world", },
),
custom: (),
node: Constant(
ExprConstant {
value: Str(
"Hello world",
),
kind: None,
},
), ),
kind: None,
}, },
}, },
}, ),
}, },
] ]

Some files were not shown because too many files have changed in this diff Show more