mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-08 05:35:22 +00:00
Merge pull request #11 from youknowone/refactor-asdl
Refactor ast to hold data as seperated type
This commit is contained in:
commit
7b8844bd3e
112 changed files with 23490 additions and 20218 deletions
5
.gitattributes
vendored
Normal file
5
.gitattributes
vendored
Normal file
|
@ -0,0 +1,5 @@
|
|||
parser/src/python.rs linguist-generated
|
||||
**/*.snap linguist-generated -merge
|
||||
**/*.lalrpop text eol=LF
|
||||
**/*.py text working-tree-encoding=UTF-8 eol=LF
|
||||
**/*.rs text working-tree-encoding=UTF-8 eol=LF
|
131
ast/asdl_rs.py
131
ast/asdl_rs.py
|
@ -131,6 +131,9 @@ class FindUserdataTypesVisitor(asdl.VisitorBase):
|
|||
if is_simple(sum):
|
||||
info.has_userdata = False
|
||||
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:
|
||||
info.boxed = True
|
||||
if sum.attributes:
|
||||
|
@ -205,16 +208,49 @@ class StructVisitor(TypeInfoEmitVisitor):
|
|||
|
||||
def sum_with_constructors(self, sum, name, depth):
|
||||
typeinfo = self.typeinfo[name]
|
||||
generics, generics_applied = self.get_generics(name, "U = ()", "U")
|
||||
enumname = rustname = get_rust_type(name)
|
||||
# all the attributes right now are for location, so if it has attrs we
|
||||
# can just wrap it in Located<>
|
||||
if sum.attributes:
|
||||
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(f"pub enum {enumname}{generics} {{", depth)
|
||||
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)
|
||||
if sum.attributes:
|
||||
self.emit(
|
||||
|
@ -238,13 +274,18 @@ class StructVisitor(TypeInfoEmitVisitor):
|
|||
if fieldtype and fieldtype.has_userdata:
|
||||
typ = f"{typ}<U>"
|
||||
# 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}>"
|
||||
if field.opt or (
|
||||
# When a dictionary literal contains dictionary unpacking (e.g., `{**d}`),
|
||||
# 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>>`.
|
||||
constructor == "Dict" and field.name == "keys"
|
||||
constructor == "Dict"
|
||||
and field.name == "keys"
|
||||
):
|
||||
typ = f"Option<{typ}>"
|
||||
if field.seq:
|
||||
|
@ -344,14 +385,21 @@ class FoldImplVisitor(TypeInfoEmitVisitor):
|
|||
)
|
||||
if is_located:
|
||||
self.emit("fold_located(folder, node, |folder, node| {", depth)
|
||||
enumname += "Kind"
|
||||
rustname = enumname + "Kind"
|
||||
else:
|
||||
rustname = enumname
|
||||
self.emit("match node {", depth + 1)
|
||||
for cons in sum.types:
|
||||
fields_pattern = self.make_pattern(cons.fields)
|
||||
self.emit(
|
||||
f"{enumname}::{cons.name} {{ {fields_pattern} }} => {{", depth + 2
|
||||
fields_pattern = self.make_pattern(
|
||||
enumname, rustname, cons.name, cons.fields
|
||||
)
|
||||
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 + 1)
|
||||
if is_located:
|
||||
|
@ -381,23 +429,33 @@ class FoldImplVisitor(TypeInfoEmitVisitor):
|
|||
)
|
||||
if is_located:
|
||||
self.emit("fold_located(folder, node, |folder, node| {", depth)
|
||||
structname += "Data"
|
||||
fields_pattern = self.make_pattern(product.fields)
|
||||
self.emit(f"let {structname} {{ {fields_pattern} }} = node;", depth + 1)
|
||||
self.gen_construction(structname, product.fields, depth + 1)
|
||||
rustname = structname + "Data"
|
||||
else:
|
||||
rustname = structname
|
||||
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:
|
||||
self.emit("})", depth)
|
||||
self.emit("}", depth)
|
||||
|
||||
def make_pattern(self, fields):
|
||||
return ",".join(rust_field(f.name) for f in fields)
|
||||
def make_pattern(self, rustname, pyname, fieldname, fields):
|
||||
if fields:
|
||||
header = f"{pyname}::{fieldname}({rustname}{fieldname}"
|
||||
footer = ")"
|
||||
else:
|
||||
header = f"{pyname}::{fieldname}"
|
||||
footer = ""
|
||||
|
||||
def gen_construction(self, cons_path, fields, depth):
|
||||
self.emit(f"Ok({cons_path} {{", depth)
|
||||
body = ",".join(rust_field(f.name) for f in fields)
|
||||
return header, body, footer
|
||||
|
||||
def gen_construction(self, header, fields, footer, depth):
|
||||
self.emit(f"Ok({header} {{", depth)
|
||||
for field in fields:
|
||||
name = rust_field(field.name)
|
||||
self.emit(f"{name}: Foldable::fold({name}, folder)?,", depth + 1)
|
||||
self.emit("})", depth)
|
||||
self.emit(f"}}{footer})", depth)
|
||||
|
||||
|
||||
class FoldModuleVisitor(TypeInfoEmitVisitor):
|
||||
|
@ -514,33 +572,36 @@ class TraitImplVisitor(EmitVisitor):
|
|||
self.visit(type.value, type.name, depth)
|
||||
|
||||
def visitSum(self, sum, name, depth):
|
||||
enumname = get_rust_type(name)
|
||||
rustname = enumname = get_rust_type(name)
|
||||
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("}", depth)
|
||||
self.emit(f"impl Node for ast::{enumname} {{", depth)
|
||||
self.emit(f"impl Node for ast::{rustname} {{", depth)
|
||||
self.emit(
|
||||
"fn ast_to_object(self, _vm: &VirtualMachine) -> PyObjectRef {", depth + 1
|
||||
)
|
||||
self.emit("match self {", depth + 2)
|
||||
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 + 1)
|
||||
self.emit(
|
||||
"fn ast_from_object(_vm: &VirtualMachine, _object: PyObjectRef) -> PyResult<Self> {",
|
||||
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)
|
||||
|
||||
def constructor_to_object(self, cons, enumname, depth):
|
||||
fields_pattern = self.make_pattern(cons.fields)
|
||||
self.emit(f"ast::{enumname}::{cons.name} {{ {fields_pattern} }} => {{", depth)
|
||||
def constructor_to_object(self, cons, enumname, rustname, depth):
|
||||
self.emit(f"ast::{rustname}::{cons.name}", 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.emit("}", depth)
|
||||
|
||||
|
@ -586,7 +647,7 @@ class TraitImplVisitor(EmitVisitor):
|
|||
def make_pattern(self, 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:
|
||||
self.extract_location(sumname, depth)
|
||||
|
||||
|
@ -594,7 +655,12 @@ class TraitImplVisitor(EmitVisitor):
|
|||
self.emit("Ok(", depth)
|
||||
for cons in sum.types:
|
||||
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("{", depth)
|
||||
|
@ -610,13 +676,16 @@ class TraitImplVisitor(EmitVisitor):
|
|||
self.gen_construction(structname, product, prodname, depth + 1)
|
||||
self.emit(")", depth)
|
||||
|
||||
def gen_construction(self, cons_path, cons, name, depth):
|
||||
self.emit(f"ast::{cons_path} {{", depth)
|
||||
def gen_construction_fields(self, cons, name, depth):
|
||||
for field in cons.fields:
|
||||
self.emit(
|
||||
f"{rust_field(field.name)}: {self.decode_field(field, name)},",
|
||||
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)
|
||||
|
||||
def extract_location(self, typename, depth):
|
||||
|
|
1558
ast/src/ast_gen.rs
1558
ast/src/ast_gen.rs
File diff suppressed because it is too large
Load diff
|
@ -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> {
|
||||
match node.node {
|
||||
crate::ExprKind::Tuple { elts, ctx } => {
|
||||
crate::ExprKind::Tuple(crate::ExprTuple { elts, ctx }) => {
|
||||
let elts = elts
|
||||
.into_iter()
|
||||
.map(|x| self.fold_expr(x))
|
||||
|
@ -112,16 +112,16 @@ impl<U> crate::fold::Fold<U> for ConstantOptimizer {
|
|||
let tuple = elts
|
||||
.into_iter()
|
||||
.map(|e| match e.node {
|
||||
crate::ExprKind::Constant { value, .. } => value,
|
||||
crate::ExprKind::Constant(crate::ExprConstant { value, .. }) => value,
|
||||
_ => unreachable!(),
|
||||
})
|
||||
.collect();
|
||||
crate::ExprKind::Constant {
|
||||
crate::ExprKind::Constant(crate::ExprConstant {
|
||||
value: Constant::Tuple(tuple),
|
||||
kind: None,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
crate::ExprKind::Tuple { elts, ctx }
|
||||
crate::ExprKind::Tuple(crate::ExprTuple { elts, ctx })
|
||||
};
|
||||
Ok(crate::Expr {
|
||||
node: expr,
|
||||
|
@ -151,66 +151,73 @@ mod tests {
|
|||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Tuple {
|
||||
node: ExprTuple {
|
||||
ctx: ExprContext::Load,
|
||||
elts: vec![
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: BigInt::from(1).into(),
|
||||
kind: None,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: BigInt::from(2).into(),
|
||||
kind: None,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Tuple {
|
||||
node: ExprTuple {
|
||||
ctx: ExprContext::Load,
|
||||
elts: vec![
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: BigInt::from(3).into(),
|
||||
kind: None,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: BigInt::from(4).into(),
|
||||
kind: None,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
Located {
|
||||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: BigInt::from(5).into(),
|
||||
kind: None,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
};
|
||||
let new_ast = ConstantOptimizer::new()
|
||||
.fold_expr(ast)
|
||||
|
@ -221,7 +228,7 @@ mod tests {
|
|||
location: start,
|
||||
end_location: end,
|
||||
custom,
|
||||
node: ExprKind::Constant {
|
||||
node: ExprConstant {
|
||||
value: Constant::Tuple(vec![
|
||||
BigInt::from(1).into(),
|
||||
BigInt::from(2).into(),
|
||||
|
@ -232,7 +239,8 @@ mod tests {
|
|||
])
|
||||
]),
|
||||
kind: None
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
}
|
||||
);
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ impl<U> ExprKind<U> {
|
|||
ExprKind::Compare { .. } => "comparison",
|
||||
ExprKind::Attribute { .. } => "attribute",
|
||||
ExprKind::Call { .. } => "function call",
|
||||
ExprKind::Constant { value, .. } => match value {
|
||||
ExprKind::Constant(crate::ExprConstant { value, .. }) => match value {
|
||||
Constant::Str(_)
|
||||
| Constant::Int(_)
|
||||
| Constant::Float(_)
|
||||
|
@ -40,7 +40,7 @@ impl<U> ExprKind<U> {
|
|||
ExprKind::GeneratorExp { .. } => "generator expression",
|
||||
ExprKind::Starred { .. } => "starred",
|
||||
ExprKind::Slice { .. } => "slice",
|
||||
ExprKind::JoinedStr { values } => {
|
||||
ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
|
||||
if values
|
||||
.iter()
|
||||
.any(|e| matches!(e.node, ExprKind::JoinedStr { .. }))
|
||||
|
|
|
@ -71,7 +71,7 @@ impl<'a> Unparser<'a> {
|
|||
}};
|
||||
}
|
||||
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));
|
||||
group_if!(prec, {
|
||||
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, {
|
||||
self.unparse_expr(target, precedence::ATOM)?;
|
||||
self.p(" := ")?;
|
||||
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 (op, prec) = op_prec!(
|
||||
bin,
|
||||
|
@ -114,7 +114,7 @@ impl<'a> Unparser<'a> {
|
|||
self.unparse_expr(right, prec + !right_associative as u8)?;
|
||||
})
|
||||
}
|
||||
ExprKind::UnaryOp { op, operand } => {
|
||||
ExprKind::UnaryOp(crate::ExprUnaryOp { op, operand }) => {
|
||||
let (op, prec) = op_prec!(
|
||||
un,
|
||||
op,
|
||||
|
@ -129,7 +129,7 @@ impl<'a> Unparser<'a> {
|
|||
self.unparse_expr(operand, prec)?;
|
||||
})
|
||||
}
|
||||
ExprKind::Lambda { args, body } => {
|
||||
ExprKind::Lambda(crate::ExprLambda { args, body }) => {
|
||||
group_if!(precedence::TEST, {
|
||||
let pos = args.args.len() + args.posonlyargs.len();
|
||||
self.p(if pos > 0 { "lambda " } else { "lambda" })?;
|
||||
|
@ -137,7 +137,7 @@ impl<'a> Unparser<'a> {
|
|||
write!(self, ": {}", **body)?;
|
||||
})
|
||||
}
|
||||
ExprKind::IfExp { test, body, orelse } => {
|
||||
ExprKind::IfExp(crate::ExprIfExp { test, body, orelse }) => {
|
||||
group_if!(precedence::TEST, {
|
||||
self.unparse_expr(body, precedence::TEST + 1)?;
|
||||
self.p(" if ")?;
|
||||
|
@ -146,7 +146,7 @@ impl<'a> Unparser<'a> {
|
|||
self.unparse_expr(orelse, precedence::TEST)?;
|
||||
})
|
||||
}
|
||||
ExprKind::Dict { keys, values } => {
|
||||
ExprKind::Dict(crate::ExprDict { keys, values }) => {
|
||||
self.p("{")?;
|
||||
let mut first = true;
|
||||
let (packed, unpacked) = values.split_at(keys.len());
|
||||
|
@ -164,7 +164,7 @@ impl<'a> Unparser<'a> {
|
|||
}
|
||||
self.p("}")?;
|
||||
}
|
||||
ExprKind::Set { elts } => {
|
||||
ExprKind::Set(crate::ExprSet { elts }) => {
|
||||
self.p("{")?;
|
||||
let mut first = true;
|
||||
for v in elts {
|
||||
|
@ -173,23 +173,23 @@ impl<'a> Unparser<'a> {
|
|||
}
|
||||
self.p("}")?;
|
||||
}
|
||||
ExprKind::ListComp { elt, generators } => {
|
||||
ExprKind::ListComp(crate::ExprListComp { elt, generators }) => {
|
||||
self.p("[")?;
|
||||
self.unparse_expr(elt, precedence::TEST)?;
|
||||
self.unparse_comp(generators)?;
|
||||
self.p("]")?;
|
||||
}
|
||||
ExprKind::SetComp { elt, generators } => {
|
||||
ExprKind::SetComp(crate::ExprSetComp { elt, generators }) => {
|
||||
self.p("{")?;
|
||||
self.unparse_expr(elt, precedence::TEST)?;
|
||||
self.unparse_comp(generators)?;
|
||||
self.p("}")?;
|
||||
}
|
||||
ExprKind::DictComp {
|
||||
ExprKind::DictComp(crate::ExprDictComp {
|
||||
key,
|
||||
value,
|
||||
generators,
|
||||
} => {
|
||||
}) => {
|
||||
self.p("{")?;
|
||||
self.unparse_expr(key, precedence::TEST)?;
|
||||
self.p(": ")?;
|
||||
|
@ -197,33 +197,33 @@ impl<'a> Unparser<'a> {
|
|||
self.unparse_comp(generators)?;
|
||||
self.p("}")?;
|
||||
}
|
||||
ExprKind::GeneratorExp { elt, generators } => {
|
||||
ExprKind::GeneratorExp(crate::ExprGeneratorExp { elt, generators }) => {
|
||||
self.p("(")?;
|
||||
self.unparse_expr(elt, precedence::TEST)?;
|
||||
self.unparse_comp(generators)?;
|
||||
self.p(")")?;
|
||||
}
|
||||
ExprKind::Await { value } => {
|
||||
ExprKind::Await(crate::ExprAwait { value }) => {
|
||||
group_if!(precedence::AWAIT, {
|
||||
self.p("await ")?;
|
||||
self.unparse_expr(value, precedence::ATOM)?;
|
||||
})
|
||||
}
|
||||
ExprKind::Yield { value } => {
|
||||
ExprKind::Yield(crate::ExprYield { value }) => {
|
||||
if let Some(value) = value {
|
||||
write!(self, "(yield {})", **value)?;
|
||||
} else {
|
||||
self.p("(yield)")?;
|
||||
}
|
||||
}
|
||||
ExprKind::YieldFrom { value } => {
|
||||
ExprKind::YieldFrom(crate::ExprYieldFrom { value }) => {
|
||||
write!(self, "(yield from {})", **value)?;
|
||||
}
|
||||
ExprKind::Compare {
|
||||
ExprKind::Compare(crate::ExprCompare {
|
||||
left,
|
||||
ops,
|
||||
comparators,
|
||||
} => {
|
||||
}) => {
|
||||
group_if!(precedence::CMP, {
|
||||
let new_lvl = precedence::CMP + 1;
|
||||
self.unparse_expr(left, new_lvl)?;
|
||||
|
@ -245,16 +245,16 @@ impl<'a> Unparser<'a> {
|
|||
}
|
||||
})
|
||||
}
|
||||
ExprKind::Call {
|
||||
ExprKind::Call(crate::ExprCall {
|
||||
func,
|
||||
args,
|
||||
keywords,
|
||||
} => {
|
||||
}) => {
|
||||
self.unparse_expr(func, precedence::ATOM)?;
|
||||
self.p("(")?;
|
||||
if let (
|
||||
[Expr {
|
||||
node: ExprKind::GeneratorExp { elt, generators },
|
||||
node: ExprKind::GeneratorExp(crate::ExprGeneratorExp { elt, generators }),
|
||||
..
|
||||
}],
|
||||
[],
|
||||
|
@ -282,13 +282,15 @@ impl<'a> Unparser<'a> {
|
|||
}
|
||||
self.p(")")?;
|
||||
}
|
||||
ExprKind::FormattedValue {
|
||||
ExprKind::FormattedValue(crate::ExprFormattedValue {
|
||||
value,
|
||||
conversion,
|
||||
format_spec,
|
||||
} => self.unparse_formatted(value, *conversion, format_spec.as_deref())?,
|
||||
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, false)?,
|
||||
ExprKind::Constant { value, kind } => {
|
||||
}) => self.unparse_formatted(value, *conversion, format_spec.as_deref())?,
|
||||
ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
|
||||
self.unparse_joined_str(values, false)?
|
||||
}
|
||||
ExprKind::Constant(crate::ExprConstant { value, kind }) => {
|
||||
if let Some(kind) = kind {
|
||||
self.p(kind)?;
|
||||
}
|
||||
|
@ -304,12 +306,12 @@ impl<'a> Unparser<'a> {
|
|||
_ => fmt::Display::fmt(value, &mut self.f)?,
|
||||
}
|
||||
}
|
||||
ExprKind::Attribute { value, attr, .. } => {
|
||||
ExprKind::Attribute(crate::ExprAttribute { value, attr, .. }) => {
|
||||
self.unparse_expr(value, precedence::ATOM)?;
|
||||
let period = if let ExprKind::Constant {
|
||||
let period = if let ExprKind::Constant(crate::ExprConstant {
|
||||
value: Constant::Int(_),
|
||||
..
|
||||
} = &value.node
|
||||
}) = &value.node
|
||||
{
|
||||
" ."
|
||||
} else {
|
||||
|
@ -318,10 +320,10 @@ impl<'a> Unparser<'a> {
|
|||
self.p(period)?;
|
||||
self.p(attr)?;
|
||||
}
|
||||
ExprKind::Subscript { value, slice, .. } => {
|
||||
ExprKind::Subscript(crate::ExprSubscript { value, slice, .. }) => {
|
||||
self.unparse_expr(value, precedence::ATOM)?;
|
||||
let mut lvl = precedence::TUPLE;
|
||||
if let ExprKind::Tuple { elts, .. } = &slice.node {
|
||||
if let ExprKind::Tuple(crate::ExprTuple { elts, .. }) = &slice.node {
|
||||
if elts
|
||||
.iter()
|
||||
.any(|expr| matches!(expr.node, ExprKind::Starred { .. }))
|
||||
|
@ -333,12 +335,12 @@ impl<'a> Unparser<'a> {
|
|||
self.unparse_expr(slice, lvl)?;
|
||||
self.p("]")?;
|
||||
}
|
||||
ExprKind::Starred { value, .. } => {
|
||||
ExprKind::Starred(crate::ExprStarred { value, .. }) => {
|
||||
self.p("*")?;
|
||||
self.unparse_expr(value, precedence::EXPR)?;
|
||||
}
|
||||
ExprKind::Name { id, .. } => self.p(id)?,
|
||||
ExprKind::List { elts, .. } => {
|
||||
ExprKind::Name(crate::ExprName { id, .. }) => self.p(id)?,
|
||||
ExprKind::List(crate::ExprList { elts, .. }) => {
|
||||
self.p("[")?;
|
||||
let mut first = true;
|
||||
for elt in elts {
|
||||
|
@ -347,7 +349,7 @@ impl<'a> Unparser<'a> {
|
|||
}
|
||||
self.p("]")?;
|
||||
}
|
||||
ExprKind::Tuple { elts, .. } => {
|
||||
ExprKind::Tuple(crate::ExprTuple { elts, .. }) => {
|
||||
if elts.is_empty() {
|
||||
self.p("()")?;
|
||||
} 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 {
|
||||
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 {
|
||||
match &expr.node {
|
||||
ExprKind::Constant { value, .. } => {
|
||||
ExprKind::Constant(crate::ExprConstant { value, .. }) => {
|
||||
if let Constant::Str(s) = value {
|
||||
self.unparse_fstring_str(s)
|
||||
} else {
|
||||
unreachable!()
|
||||
}
|
||||
}
|
||||
ExprKind::JoinedStr { values } => self.unparse_joined_str(values, is_spec),
|
||||
ExprKind::FormattedValue {
|
||||
ExprKind::JoinedStr(crate::ExprJoinedStr { values }) => {
|
||||
self.unparse_joined_str(values, is_spec)
|
||||
}
|
||||
ExprKind::FormattedValue(crate::ExprFormattedValue {
|
||||
value,
|
||||
conversion,
|
||||
format_spec,
|
||||
} => self.unparse_formatted(value, *conversion, format_spec.as_deref()),
|
||||
}) => self.unparse_formatted(value, *conversion, format_spec.as_deref()),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
match expr.node {
|
||||
ExprKind::Name { id, .. } => Expr {
|
||||
node: ExprKind::Name { id, ctx },
|
||||
ExprKind::Name(ast::ExprName { id, .. }) => Expr {
|
||||
node: ast::ExprName { id, ctx }.into(),
|
||||
..expr
|
||||
},
|
||||
ExprKind::Tuple { elts, .. } => Expr {
|
||||
node: ExprKind::Tuple {
|
||||
ExprKind::Tuple(ast::ExprTuple { elts, .. }) => Expr {
|
||||
node: ast::ExprTuple {
|
||||
elts: elts
|
||||
.into_iter()
|
||||
.map(|elt| set_context(elt, ctx.clone()))
|
||||
.collect(),
|
||||
ctx,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
..expr
|
||||
},
|
||||
ExprKind::List { elts, .. } => Expr {
|
||||
node: ExprKind::List {
|
||||
ExprKind::List(ast::ExprList { elts, .. }) => Expr {
|
||||
node: ast::ExprList {
|
||||
elts: elts
|
||||
.into_iter()
|
||||
.map(|elt| set_context(elt, ctx.clone()))
|
||||
.collect(),
|
||||
ctx,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
..expr
|
||||
},
|
||||
ExprKind::Attribute { value, attr, .. } => Expr {
|
||||
node: ExprKind::Attribute { value, attr, ctx },
|
||||
ExprKind::Attribute(ast::ExprAttribute { value, attr, .. }) => Expr {
|
||||
node: ast::ExprAttribute { value, attr, ctx }.into(),
|
||||
..expr
|
||||
},
|
||||
ExprKind::Subscript { value, slice, .. } => Expr {
|
||||
node: ExprKind::Subscript { value, slice, ctx },
|
||||
ExprKind::Subscript(ast::ExprSubscript { value, slice, .. }) => Expr {
|
||||
node: ast::ExprSubscript { value, slice, ctx }.into(),
|
||||
..expr
|
||||
},
|
||||
ExprKind::Starred { value, .. } => Expr {
|
||||
node: ExprKind::Starred {
|
||||
ExprKind::Starred(ast::ExprStarred { value, .. }) => Expr {
|
||||
node: ast::ExprStarred {
|
||||
value: Box::new(set_context(*value, ctx.clone())),
|
||||
ctx,
|
||||
},
|
||||
}
|
||||
.into(),
|
||||
..expr
|
||||
},
|
||||
_ => expr,
|
||||
|
|
|
@ -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> {
|
||||
parse(source, Mode::Module, source_path).map(|top| match top {
|
||||
ast::Mod::Module { body, .. } => body,
|
||||
ast::Mod::Module(ast::ModModule { body, .. }) => body,
|
||||
_ => unreachable!(),
|
||||
})
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ pub fn parse_expression_located(
|
|||
location: Location,
|
||||
) -> Result<ast::Expr, ParseError> {
|
||||
parse_located(source, Mode::Expression, path, location).map(|top| match top {
|
||||
ast::Mod::Expression { body } => *body,
|
||||
ast::Mod::Expression(ast::ModExpression { body }) => *body,
|
||||
_ => unreachable!(),
|
||||
})
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load diff
422
parser/src/python.rs
generated
422
parser/src/python.rs
generated
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,63 +15,71 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: AnnAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: AnnAssign(
|
||||
StmtAnnAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
simple: 1,
|
||||
},
|
||||
annotation: Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,119 +15,133 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Attribute {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,117 +15,129 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: For {
|
||||
target: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: For(
|
||||
StmtFor {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 24,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
orelse: [],
|
||||
type_comment: None,
|
||||
},
|
||||
iter: Located {
|
||||
location: Location {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,137 +15,153 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 18,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: List {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
ctx: Store,
|
||||
},
|
||||
},
|
||||
],
|
||||
value: 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,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 16,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,157 +15,175 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
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,
|
||||
],
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
},
|
||||
],
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,102 +15,114 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
},
|
||||
],
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
),
|
||||
},
|
||||
type_comment: None,
|
||||
},
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,75 +15,83 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: If {
|
||||
test: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: If(
|
||||
StmtIf {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
orelse: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
orelse: [],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,157 +15,175 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
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,
|
||||
],
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
},
|
||||
],
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,56 +15,47 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Starred {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
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(
|
||||
Location {
|
||||
|
@ -73,95 +64,122 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Store,
|
||||
},
|
||||
node: Starred(
|
||||
ExprStarred {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
],
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
),
|
||||
},
|
||||
type_comment: None,
|
||||
},
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,135 +15,151 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 16,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
slice: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
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: 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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,137 +15,153 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 18,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
ctx: Store,
|
||||
},
|
||||
},
|
||||
],
|
||||
value: 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,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 16,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
3,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,66 +15,72 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: With {
|
||||
items: [
|
||||
Withitem {
|
||||
context_expr: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
optional_vars: Some(
|
||||
Located {
|
||||
node: With(
|
||||
StmtWith {
|
||||
items: [
|
||||
Withitem {
|
||||
context_expr: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
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,
|
||||
column: 17,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
type_comment: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,117 +15,131 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: AugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: AugAssign(
|
||||
StmtAugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Attribute {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
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(
|
||||
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,
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,44 +15,50 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: AugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: AugAssign(
|
||||
StmtAugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
},
|
||||
op: Add,
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
op: Add,
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,133 +15,149 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: AugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: AugAssign(
|
||||
StmtAugAssign {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
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,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,43 +15,49 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Delete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Delete(
|
||||
StmtDelete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Attribute {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
),
|
||||
custom: (),
|
||||
node: Attribute(
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
attr: "y",
|
||||
ctx: Del,
|
||||
},
|
||||
},
|
||||
attr: "y",
|
||||
ctx: Del,
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Delete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Delete(
|
||||
StmtDelete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Del,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Del,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/context.rs
|
||||
source: parser/src/context.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,59 +15,67 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Delete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Delete(
|
||||
StmtDelete {
|
||||
targets: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript(
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
slice: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
slice: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
ctx: Del,
|
||||
},
|
||||
},
|
||||
ctx: Del,
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,92 +16,94 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 19,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 23,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,131 +16,137 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
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: 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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "a",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "b",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 25,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 29,
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
],
|
||||
kw_defaults: [
|
||||
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: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 25,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 29,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,37 +16,39 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,147 +16,149 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
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,
|
||||
kwonlyargs: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 24,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
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: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 28,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 32,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 28,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 32,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,186 +16,192 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
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: [
|
||||
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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 29,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 31,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "a",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "b",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 34,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 38,
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
],
|
||||
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(
|
||||
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: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 34,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 38,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,205 +16,211 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
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: 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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 33,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 35,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "a",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 38,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 42,
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
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(
|
||||
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: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 38,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 42,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,224 +16,230 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
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: 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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 33,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 35,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "a",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
kwarg: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 39,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 45,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "b",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "kwargs",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
),
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 48,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 52,
|
||||
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: (),
|
||||
node: Pass,
|
||||
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(
|
||||
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: [],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 48,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 52,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,92 +16,94 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 16,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 20,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,131 +16,137 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "f",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
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: 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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "a",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "b",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
],
|
||||
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(
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,106 +16,112 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
column: 20,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,145 +16,155 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 25,
|
||||
column: 26,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,51 +16,57 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda {
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,143 +16,149 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 25,
|
||||
column: 26,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 26,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,106 +16,112 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 16,
|
||||
column: 17,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/function.rs
|
||||
source: parser/src/function.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Ok(
|
||||
|
@ -16,145 +16,155 @@ Ok(
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 23,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
column: 23,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 23,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,108 +14,120 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Dict {
|
||||
keys: [
|
||||
Some(
|
||||
node: Dict(
|
||||
ExprDict {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"a",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"b",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
None,
|
||||
Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 16,
|
||||
column: 13,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"d",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
),
|
||||
],
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"b",
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "c",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 21,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "c",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 24,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"e",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 24,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"e",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,320 +14,358 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 5,
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 7,
|
||||
node: Attribute(
|
||||
ExprAttribute {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "sql",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
args: [
|
||||
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
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,43 +14,49 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: BoolOp {
|
||||
op: And,
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: BoolOp(
|
||||
ExprBoolOp {
|
||||
op: And,
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,43 +14,49 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: BoolOp {
|
||||
op: Or,
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: BoolOp(
|
||||
ExprBoolOp {
|
||||
op: Or,
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: "parse_program(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
|
@ -15,212 +15,224 @@ expression: "parse_program(source, \"<test>\").unwrap()"
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ClassDef {
|
||||
name: "Foo",
|
||||
bases: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: ClassDef(
|
||||
StmtClassDef {
|
||||
name: "Foo",
|
||||
bases: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "A",
|
||||
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,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "A",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 5,
|
||||
column: 6,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "method_with_default",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 25,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 29,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "B",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
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: (),
|
||||
node: ArgData {
|
||||
arg: "self",
|
||||
annotation: None,
|
||||
type_comment: None,
|
||||
},
|
||||
],
|
||||
vararg: None,
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 31,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 34,
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
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 {
|
||||
value: Str(
|
||||
"default",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
custom: (),
|
||||
node: Pass,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
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: [],
|
||||
returns: None,
|
||||
type_comment: None,
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
decorator_list: [],
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
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: [],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,80 +14,90 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: DictComp {
|
||||
key: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: DictComp(
|
||||
ExprDictComp {
|
||||
key: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
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",
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x1",
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,249 +14,277 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: ListComp(
|
||||
ExprListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,43 +15,49 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
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(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,63 +14,71 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: GeneratorExp(
|
||||
ExprGeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 2,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
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",
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,110 +15,107 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: If {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
node: If(
|
||||
StmtIf {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
10,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
orelse: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 8,
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: If {
|
||||
test: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 5,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 10,
|
||||
),
|
||||
custom: (),
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
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 {
|
||||
row: 2,
|
||||
column: 8,
|
||||
|
@ -130,31 +127,35 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
20,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
20,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
orelse: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
],
|
||||
orelse: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 6,
|
||||
|
@ -166,19 +167,38 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
30,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
30,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,112 +14,126 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: GeneratorExp(
|
||||
ExprGeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: IfExp {
|
||||
test: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 14,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
),
|
||||
custom: (),
|
||||
node: IfExp(
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
body: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
body: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
orelse: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
orelse: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "y",
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,79 +15,69 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 32,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 32,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "my_func",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
),
|
||||
custom: (),
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"positional",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 31,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: KeywordData {
|
||||
arg: Some(
|
||||
"keyword",
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "my_func",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
value: Located {
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
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(
|
||||
Location {
|
||||
|
@ -96,18 +86,38 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
node: KeywordData {
|
||||
arg: Some(
|
||||
"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,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,102 +15,73 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
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 {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
column: 18,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 18,
|
||||
),
|
||||
custom: (),
|
||||
node: Lambda(
|
||||
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: [],
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: BinOp {
|
||||
left: Located {
|
||||
body: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
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(
|
||||
Location {
|
||||
row: 1,
|
||||
|
@ -118,15 +89,54 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
node: BinOp(
|
||||
ExprBinOp {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,63 +14,71 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: ListComp(
|
||||
ExprListComp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
generators: [
|
||||
Comprehension {
|
||||
target: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 2,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
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",
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,72 +14,45 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: GeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: GeneratorExp(
|
||||
ExprGeneratorExp {
|
||||
elt: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
column: 1,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: NamedExpr {
|
||||
target: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
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 {
|
||||
),
|
||||
custom: (),
|
||||
node: NamedExpr(
|
||||
ExprNamedExpr {
|
||||
target: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 1,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "y",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "x",
|
||||
ctx: Store,
|
||||
},
|
||||
),
|
||||
},
|
||||
op: Add,
|
||||
right: Located {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 10,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
|
@ -88,56 +61,99 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
node: BinOp(
|
||||
ExprBinOp {
|
||||
left: Located {
|
||||
location: Location {
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,80 +15,90 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 23,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 23,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
),
|
||||
custom: (),
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,61 +15,69 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 20,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
),
|
||||
custom: (),
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 19,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
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: [],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: "parse_program(source, \"<test>\").unwrap()"
|
||||
---
|
||||
[
|
||||
|
@ -15,118 +15,132 @@ expression: "parse_program(source, \"<test>\").unwrap()"
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Assign {
|
||||
targets: [
|
||||
Located {
|
||||
node: Assign(
|
||||
StmtAssign {
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 11,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Tuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Tuple(
|
||||
ExprTuple {
|
||||
elts: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
4,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "b",
|
||||
ctx: Store,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
5,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
],
|
||||
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,
|
||||
},
|
||||
],
|
||||
ctx: Load,
|
||||
},
|
||||
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
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
Located {
|
||||
|
@ -14,102 +14,114 @@ Located {
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Subscript(
|
||||
ExprSubscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
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 {
|
||||
slice: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
column: 2,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Slice {
|
||||
lower: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
upper: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
custom: (),
|
||||
node: Slice(
|
||||
ExprSlice {
|
||||
lower: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 2,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
),
|
||||
step: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
upper: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
2,
|
||||
),
|
||||
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
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,36 +15,25 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Try {
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Try(
|
||||
StmtTry {
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 23,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Raise {
|
||||
exc: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 23,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 23,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Raise(
|
||||
StmtRaise {
|
||||
exc: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 10,
|
||||
|
@ -52,95 +41,105 @@ expression: parse_ast
|
|||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 20,
|
||||
column: 23,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "ValueError",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 22,
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 20,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "ValueError",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 21,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 22,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
},
|
||||
],
|
||||
keywords: [],
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
cause: None,
|
||||
},
|
||||
),
|
||||
cause: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
handlers: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 30,
|
||||
],
|
||||
handlers: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ExceptHandler {
|
||||
type_: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 16,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "TypeError",
|
||||
ctx: Load,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 30,
|
||||
},
|
||||
),
|
||||
name: Some(
|
||||
"e",
|
||||
),
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 30,
|
||||
custom: (),
|
||||
node: ExceptHandler(
|
||||
ExcepthandlerExceptHandler {
|
||||
type_: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 3,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 3,
|
||||
column: 16,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "TypeError",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
name: Some(
|
||||
"e",
|
||||
),
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 4,
|
||||
|
@ -152,189 +151,211 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 10,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 29,
|
||||
column: 30,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 10,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 29,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"caught ",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 29,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 20,
|
||||
column: 29,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 27,
|
||||
},
|
||||
),
|
||||
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: [
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 4,
|
||||
column: 25,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 4,
|
||||
column: 26,
|
||||
column: 29,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "e",
|
||||
ctx: Load,
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
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 {
|
||||
location: Location {
|
||||
row: 5,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 30,
|
||||
Located {
|
||||
location: Location {
|
||||
row: 5,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ExceptHandler {
|
||||
type_: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 5,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 5,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "OSError",
|
||||
ctx: Load,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 30,
|
||||
},
|
||||
),
|
||||
name: Some(
|
||||
"e",
|
||||
),
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 30,
|
||||
custom: (),
|
||||
node: ExceptHandler(
|
||||
ExcepthandlerExceptHandler {
|
||||
type_: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 5,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 5,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "OSError",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
name: Some(
|
||||
"e",
|
||||
),
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 4,
|
||||
|
@ -346,142 +367,175 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Call {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
},
|
||||
args: [
|
||||
Located {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 10,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 29,
|
||||
column: 30,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
node: Call(
|
||||
ExprCall {
|
||||
func: Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 10,
|
||||
column: 4,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 29,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"caught ",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "print",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
args: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 29,
|
||||
column: 10,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 20,
|
||||
column: 29,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 27,
|
||||
},
|
||||
),
|
||||
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: [
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 6,
|
||||
column: 25,
|
||||
column: 10,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 6,
|
||||
column: 26,
|
||||
column: 29,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "e",
|
||||
ctx: Load,
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
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: [],
|
||||
finalbody: [],
|
||||
},
|
||||
],
|
||||
orelse: [],
|
||||
finalbody: [],
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/parser.rs
|
||||
source: parser/src/parser.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,153 +15,152 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FunctionDef {
|
||||
name: "args_to_tuple",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
args: [],
|
||||
vararg: Some(
|
||||
node: FunctionDef(
|
||||
StmtFunctionDef {
|
||||
name: "args_to_tuple",
|
||||
args: Arguments {
|
||||
posonlyargs: [],
|
||||
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 {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 19,
|
||||
column: 45,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 28,
|
||||
column: 48,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: ArgData {
|
||||
arg: "args",
|
||||
annotation: Some(
|
||||
Located {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 25,
|
||||
column: 45,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 28,
|
||||
column: 48,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Starred {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 26,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 28,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "Ts",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Ellipsis,
|
||||
kind: None,
|
||||
},
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
type_comment: None,
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
kwonlyargs: [],
|
||||
kw_defaults: [],
|
||||
kwarg: None,
|
||||
defaults: [],
|
||||
},
|
||||
body: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 45,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
],
|
||||
decorator_list: [],
|
||||
returns: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 48,
|
||||
column: 33,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 45,
|
||||
column: 43,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 48,
|
||||
},
|
||||
),
|
||||
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 {
|
||||
),
|
||||
custom: (),
|
||||
node: Subscript(
|
||||
ExprSubscript {
|
||||
value: Located {
|
||||
location: Location {
|
||||
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(
|
||||
Location {
|
||||
|
@ -170,19 +169,38 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "Ts",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Starred(
|
||||
ExprStarred {
|
||||
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,
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
type_comment: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{8}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{8}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{7}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{7}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\r",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 21,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\r",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 45,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{89}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 45,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{89}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{7f}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{7f}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,283 +15,287 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 738,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Bytes(
|
||||
[
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
46,
|
||||
47,
|
||||
48,
|
||||
49,
|
||||
50,
|
||||
51,
|
||||
52,
|
||||
53,
|
||||
54,
|
||||
55,
|
||||
56,
|
||||
57,
|
||||
58,
|
||||
59,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
82,
|
||||
83,
|
||||
84,
|
||||
85,
|
||||
86,
|
||||
87,
|
||||
88,
|
||||
89,
|
||||
90,
|
||||
91,
|
||||
92,
|
||||
93,
|
||||
94,
|
||||
95,
|
||||
96,
|
||||
97,
|
||||
98,
|
||||
99,
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
103,
|
||||
104,
|
||||
105,
|
||||
106,
|
||||
107,
|
||||
108,
|
||||
109,
|
||||
110,
|
||||
111,
|
||||
112,
|
||||
113,
|
||||
114,
|
||||
115,
|
||||
116,
|
||||
117,
|
||||
118,
|
||||
119,
|
||||
120,
|
||||
121,
|
||||
122,
|
||||
123,
|
||||
124,
|
||||
125,
|
||||
126,
|
||||
127,
|
||||
128,
|
||||
129,
|
||||
130,
|
||||
131,
|
||||
132,
|
||||
133,
|
||||
134,
|
||||
135,
|
||||
136,
|
||||
137,
|
||||
138,
|
||||
139,
|
||||
140,
|
||||
141,
|
||||
142,
|
||||
143,
|
||||
144,
|
||||
145,
|
||||
146,
|
||||
147,
|
||||
148,
|
||||
149,
|
||||
150,
|
||||
151,
|
||||
152,
|
||||
153,
|
||||
154,
|
||||
155,
|
||||
156,
|
||||
157,
|
||||
158,
|
||||
159,
|
||||
160,
|
||||
161,
|
||||
162,
|
||||
163,
|
||||
164,
|
||||
165,
|
||||
166,
|
||||
167,
|
||||
168,
|
||||
169,
|
||||
170,
|
||||
171,
|
||||
172,
|
||||
173,
|
||||
174,
|
||||
175,
|
||||
176,
|
||||
177,
|
||||
178,
|
||||
179,
|
||||
180,
|
||||
181,
|
||||
182,
|
||||
183,
|
||||
184,
|
||||
185,
|
||||
186,
|
||||
187,
|
||||
188,
|
||||
189,
|
||||
190,
|
||||
191,
|
||||
192,
|
||||
193,
|
||||
194,
|
||||
195,
|
||||
196,
|
||||
197,
|
||||
198,
|
||||
199,
|
||||
200,
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
209,
|
||||
210,
|
||||
211,
|
||||
212,
|
||||
213,
|
||||
214,
|
||||
215,
|
||||
216,
|
||||
217,
|
||||
218,
|
||||
219,
|
||||
220,
|
||||
221,
|
||||
222,
|
||||
223,
|
||||
224,
|
||||
225,
|
||||
226,
|
||||
227,
|
||||
228,
|
||||
229,
|
||||
230,
|
||||
231,
|
||||
232,
|
||||
233,
|
||||
234,
|
||||
235,
|
||||
236,
|
||||
237,
|
||||
238,
|
||||
239,
|
||||
240,
|
||||
241,
|
||||
242,
|
||||
243,
|
||||
244,
|
||||
245,
|
||||
246,
|
||||
247,
|
||||
248,
|
||||
249,
|
||||
250,
|
||||
251,
|
||||
252,
|
||||
253,
|
||||
254,
|
||||
255,
|
||||
],
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 738,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Bytes(
|
||||
[
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9,
|
||||
10,
|
||||
11,
|
||||
12,
|
||||
13,
|
||||
14,
|
||||
15,
|
||||
16,
|
||||
17,
|
||||
18,
|
||||
19,
|
||||
20,
|
||||
21,
|
||||
22,
|
||||
23,
|
||||
24,
|
||||
25,
|
||||
26,
|
||||
27,
|
||||
28,
|
||||
29,
|
||||
30,
|
||||
31,
|
||||
32,
|
||||
33,
|
||||
34,
|
||||
35,
|
||||
36,
|
||||
37,
|
||||
38,
|
||||
39,
|
||||
40,
|
||||
41,
|
||||
42,
|
||||
43,
|
||||
44,
|
||||
45,
|
||||
46,
|
||||
47,
|
||||
48,
|
||||
49,
|
||||
50,
|
||||
51,
|
||||
52,
|
||||
53,
|
||||
54,
|
||||
55,
|
||||
56,
|
||||
57,
|
||||
58,
|
||||
59,
|
||||
60,
|
||||
61,
|
||||
62,
|
||||
63,
|
||||
64,
|
||||
65,
|
||||
66,
|
||||
67,
|
||||
68,
|
||||
69,
|
||||
70,
|
||||
71,
|
||||
72,
|
||||
73,
|
||||
74,
|
||||
75,
|
||||
76,
|
||||
77,
|
||||
78,
|
||||
79,
|
||||
80,
|
||||
81,
|
||||
82,
|
||||
83,
|
||||
84,
|
||||
85,
|
||||
86,
|
||||
87,
|
||||
88,
|
||||
89,
|
||||
90,
|
||||
91,
|
||||
92,
|
||||
93,
|
||||
94,
|
||||
95,
|
||||
96,
|
||||
97,
|
||||
98,
|
||||
99,
|
||||
100,
|
||||
101,
|
||||
102,
|
||||
103,
|
||||
104,
|
||||
105,
|
||||
106,
|
||||
107,
|
||||
108,
|
||||
109,
|
||||
110,
|
||||
111,
|
||||
112,
|
||||
113,
|
||||
114,
|
||||
115,
|
||||
116,
|
||||
117,
|
||||
118,
|
||||
119,
|
||||
120,
|
||||
121,
|
||||
122,
|
||||
123,
|
||||
124,
|
||||
125,
|
||||
126,
|
||||
127,
|
||||
128,
|
||||
129,
|
||||
130,
|
||||
131,
|
||||
132,
|
||||
133,
|
||||
134,
|
||||
135,
|
||||
136,
|
||||
137,
|
||||
138,
|
||||
139,
|
||||
140,
|
||||
141,
|
||||
142,
|
||||
143,
|
||||
144,
|
||||
145,
|
||||
146,
|
||||
147,
|
||||
148,
|
||||
149,
|
||||
150,
|
||||
151,
|
||||
152,
|
||||
153,
|
||||
154,
|
||||
155,
|
||||
156,
|
||||
157,
|
||||
158,
|
||||
159,
|
||||
160,
|
||||
161,
|
||||
162,
|
||||
163,
|
||||
164,
|
||||
165,
|
||||
166,
|
||||
167,
|
||||
168,
|
||||
169,
|
||||
170,
|
||||
171,
|
||||
172,
|
||||
173,
|
||||
174,
|
||||
175,
|
||||
176,
|
||||
177,
|
||||
178,
|
||||
179,
|
||||
180,
|
||||
181,
|
||||
182,
|
||||
183,
|
||||
184,
|
||||
185,
|
||||
186,
|
||||
187,
|
||||
188,
|
||||
189,
|
||||
190,
|
||||
191,
|
||||
192,
|
||||
193,
|
||||
194,
|
||||
195,
|
||||
196,
|
||||
197,
|
||||
198,
|
||||
199,
|
||||
200,
|
||||
201,
|
||||
202,
|
||||
203,
|
||||
204,
|
||||
205,
|
||||
206,
|
||||
207,
|
||||
208,
|
||||
209,
|
||||
210,
|
||||
211,
|
||||
212,
|
||||
213,
|
||||
214,
|
||||
215,
|
||||
216,
|
||||
217,
|
||||
218,
|
||||
219,
|
||||
220,
|
||||
221,
|
||||
222,
|
||||
223,
|
||||
224,
|
||||
225,
|
||||
226,
|
||||
227,
|
||||
228,
|
||||
229,
|
||||
230,
|
||||
231,
|
||||
232,
|
||||
233,
|
||||
234,
|
||||
235,
|
||||
236,
|
||||
237,
|
||||
238,
|
||||
239,
|
||||
240,
|
||||
241,
|
||||
242,
|
||||
243,
|
||||
244,
|
||||
245,
|
||||
246,
|
||||
247,
|
||||
248,
|
||||
249,
|
||||
250,
|
||||
251,
|
||||
252,
|
||||
253,
|
||||
254,
|
||||
255,
|
||||
],
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{1b}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{1b}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,37 +15,41 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Bytes(
|
||||
[
|
||||
111,
|
||||
109,
|
||||
107,
|
||||
109,
|
||||
111,
|
||||
107,
|
||||
92,
|
||||
88,
|
||||
97,
|
||||
97,
|
||||
],
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Bytes(
|
||||
[
|
||||
111,
|
||||
109,
|
||||
107,
|
||||
109,
|
||||
111,
|
||||
107,
|
||||
92,
|
||||
88,
|
||||
97,
|
||||
97,
|
||||
],
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,32 +15,36 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Bytes(
|
||||
[
|
||||
35,
|
||||
97,
|
||||
4,
|
||||
83,
|
||||
52,
|
||||
],
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Bytes(
|
||||
[
|
||||
35,
|
||||
97,
|
||||
4,
|
||||
83,
|
||||
52,
|
||||
],
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{c}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{c}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,77 +15,87 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\\",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\\",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,77 +15,87 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 6,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,77 +15,87 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\\\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 1,
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 2,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\\\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,64 +15,72 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,84 +15,14 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"mix ",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
conversion: 114,
|
||||
format_spec: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
|
@ -106,83 +36,173 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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 {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "second",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,101 +15,113 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"user=",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
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 {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 14,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
">10",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "user",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,77 +15,87 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 2,
|
||||
column: 1,
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 2,
|
||||
column: 2,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\n",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,26 +15,30 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"\u{88}",
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"\u{88}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,43 +15,49 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
],
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,43 +15,49 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
},
|
||||
],
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,79 +15,89 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Expr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: Expr(
|
||||
StmtExpr {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
column: 0,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 22,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 17,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 20,
|
||||
column: 22,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"!",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"Hello world",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
Located {
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,27 +15,31 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "a",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
|
@ -49,27 +53,31 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 7,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 7,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "b",
|
||||
ctx: Load,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "b",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
Located {
|
||||
location: Location {
|
||||
|
@ -83,11 +91,13 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"{foo}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"{foo}",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,67 +15,75 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 11,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
42,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
Eq,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
),
|
||||
custom: (),
|
||||
node: Compare(
|
||||
ExprCompare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 11,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
42,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 5,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,78 +15,88 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "foo",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: Some(
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr(
|
||||
ExprJoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 12,
|
||||
column: 15,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "spec",
|
||||
ctx: Load,
|
||||
},
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
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,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
),
|
||||
},
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,67 +15,75 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Compare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
column: 9,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
1,
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
ops: [
|
||||
NotEq,
|
||||
],
|
||||
comparators: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
),
|
||||
custom: (),
|
||||
node: Compare(
|
||||
ExprCompare {
|
||||
left: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 9,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Int(
|
||||
2,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 4,
|
||||
},
|
||||
),
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,63 +15,71 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
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 {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
column: 6,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: JoinedStr {
|
||||
values: [
|
||||
Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 0,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 13,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
value: Str(
|
||||
"spec",
|
||||
),
|
||||
kind: None,
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
node: Name(
|
||||
ExprName {
|
||||
id: "foo",
|
||||
ctx: Load,
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
],
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,64 +15,72 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"x =",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,64 +15,72 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Constant {
|
||||
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,
|
||||
},
|
||||
node: Constant(
|
||||
ExprConstant {
|
||||
value: Str(
|
||||
"x=",
|
||||
),
|
||||
custom: (),
|
||||
node: Name {
|
||||
id: "x",
|
||||
ctx: Load,
|
||||
},
|
||||
kind: None,
|
||||
},
|
||||
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,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
---
|
||||
source: compiler/parser/src/string.rs
|
||||
source: parser/src/string.rs
|
||||
expression: parse_ast
|
||||
---
|
||||
[
|
||||
|
@ -15,25 +15,29 @@ expression: parse_ast
|
|||
},
|
||||
),
|
||||
custom: (),
|
||||
node: FormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 3,
|
||||
},
|
||||
end_location: Some(
|
||||
Location {
|
||||
node: FormattedValue(
|
||||
ExprFormattedValue {
|
||||
value: Located {
|
||||
location: Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
column: 3,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Yield {
|
||||
value: None,
|
||||
end_location: Some(
|
||||
Location {
|
||||
row: 1,
|
||||
column: 8,
|
||||
},
|
||||
),
|
||||
custom: (),
|
||||
node: Yield(
|
||||
ExprYield {
|
||||
value: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
conversion: 0,
|
||||
format_spec: None,
|
||||
},
|
||||
),
|
||||
},
|
||||
]
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue