Replaced all the *Box with a generic LocBox<T>
This commit is contained in:
@@ -2,7 +2,7 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Enum(
|
||||
Enum {
|
||||
name: Ident(
|
||||
@@ -19,7 +19,7 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Enum(
|
||||
Enum {
|
||||
name: Ident(
|
||||
|
||||
@@ -2,20 +2,20 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"a",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: EqEq,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: BinOp {
|
||||
typ: Star,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -31,7 +31,7 @@ Program {
|
||||
col: 10,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -54,7 +54,7 @@ Program {
|
||||
col: 12,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -87,20 +87,20 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"b",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: EqEq,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: BinOp {
|
||||
typ: Div,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -116,7 +116,7 @@ Program {
|
||||
col: 10,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -139,10 +139,10 @@ Program {
|
||||
col: 11,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: UnOp {
|
||||
typ: Star,
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -182,22 +182,22 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"c",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: Div,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Group(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -214,10 +214,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -234,10 +234,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -254,7 +254,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -298,7 +298,7 @@ Program {
|
||||
col: 10,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -331,17 +331,17 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"d",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: Div,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -357,10 +357,10 @@ Program {
|
||||
col: 10,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -377,10 +377,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -397,10 +397,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -417,7 +417,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -471,20 +471,20 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"e",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: Div,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -501,10 +501,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -521,10 +521,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: PtrFieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -541,7 +541,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -578,7 +578,7 @@ Program {
|
||||
col: 11,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -611,20 +611,20 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"f",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: Div,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -641,10 +641,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -661,10 +661,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -681,7 +681,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -718,7 +718,7 @@ Program {
|
||||
col: 11,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -751,22 +751,22 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"g",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: BinOp {
|
||||
typ: Star,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: ArrayIndex {
|
||||
name: ExprBox {
|
||||
name: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -783,7 +783,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -806,13 +806,13 @@ Program {
|
||||
col: 11,
|
||||
},
|
||||
},
|
||||
index: ExprBox {
|
||||
index: LocBox {
|
||||
inner: UnOp {
|
||||
typ: Star,
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: FieldAccess {
|
||||
left: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -829,7 +829,7 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -866,7 +866,7 @@ Program {
|
||||
col: 13,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
|
||||
@@ -2,7 +2,7 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Fn(
|
||||
Function {
|
||||
struct_name: None,
|
||||
@@ -14,7 +14,7 @@ Program {
|
||||
Ident(
|
||||
"argc",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
"i32",
|
||||
@@ -31,7 +31,7 @@ Program {
|
||||
Ident(
|
||||
"argv",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Array {
|
||||
inner: Owned(
|
||||
@@ -51,7 +51,7 @@ Program {
|
||||
),
|
||||
],
|
||||
ret_type: Some(
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
"i32",
|
||||
@@ -70,10 +70,10 @@ Program {
|
||||
Block(
|
||||
[
|
||||
Expr(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Return(
|
||||
Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -111,7 +111,7 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Fn(
|
||||
Function {
|
||||
struct_name: Some(
|
||||
@@ -127,7 +127,7 @@ Program {
|
||||
Ident(
|
||||
"self",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -147,7 +147,7 @@ Program {
|
||||
Ident(
|
||||
"a",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -167,7 +167,7 @@ Program {
|
||||
Ident(
|
||||
"b",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -185,7 +185,7 @@ Program {
|
||||
),
|
||||
],
|
||||
ret_type: Some(
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -214,7 +214,7 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Fn(
|
||||
Function {
|
||||
struct_name: Some(
|
||||
@@ -230,7 +230,7 @@ Program {
|
||||
Ident(
|
||||
"a",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -250,7 +250,7 @@ Program {
|
||||
Ident(
|
||||
"b",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
@@ -268,7 +268,7 @@ Program {
|
||||
),
|
||||
],
|
||||
ret_type: Some(
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
|
||||
@@ -2,13 +2,13 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Expr(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: If(
|
||||
IfExpr {
|
||||
test: ExprBox {
|
||||
test: LocBox {
|
||||
inner: BinOp {
|
||||
typ: Gt,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -24,7 +24,7 @@ Program {
|
||||
col: 5,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
|
||||
@@ -2,17 +2,17 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Expr(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: ForLoop {
|
||||
init: Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Let {
|
||||
name: Ident(
|
||||
"i",
|
||||
),
|
||||
typ: None,
|
||||
val: Some(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -37,10 +37,10 @@ Program {
|
||||
},
|
||||
},
|
||||
),
|
||||
test: ExprBox {
|
||||
test: LocBox {
|
||||
inner: BinOp {
|
||||
typ: Lt,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -56,7 +56,7 @@ Program {
|
||||
col: 17,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -79,10 +79,10 @@ Program {
|
||||
col: 19,
|
||||
},
|
||||
},
|
||||
on_loop: ExprBox {
|
||||
on_loop: LocBox {
|
||||
inner: BinOp {
|
||||
typ: AddEq,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -98,7 +98,7 @@ Program {
|
||||
col: 25,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -133,12 +133,12 @@ Program {
|
||||
},
|
||||
),
|
||||
Expr(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: WhileLoop {
|
||||
test: ExprBox {
|
||||
test: LocBox {
|
||||
inner: BinOp {
|
||||
typ: Gt,
|
||||
left: ExprBox {
|
||||
left: LocBox {
|
||||
inner: Path(
|
||||
Path(
|
||||
[
|
||||
@@ -154,7 +154,7 @@ Program {
|
||||
col: 8,
|
||||
},
|
||||
},
|
||||
right: ExprBox {
|
||||
right: LocBox {
|
||||
inner: Literal(
|
||||
Number(
|
||||
Number {
|
||||
@@ -189,7 +189,7 @@ Program {
|
||||
},
|
||||
),
|
||||
Expr(
|
||||
ExprBox {
|
||||
LocBox {
|
||||
inner: InfLoop {
|
||||
body: Block(
|
||||
[],
|
||||
|
||||
@@ -2,7 +2,7 @@ Program {
|
||||
ast: Block(
|
||||
[
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Struct(
|
||||
Struct {
|
||||
name: Ident(
|
||||
@@ -19,7 +19,7 @@ Program {
|
||||
},
|
||||
),
|
||||
Statement(
|
||||
StatementBox {
|
||||
LocBox {
|
||||
inner: Struct(
|
||||
Struct {
|
||||
name: Ident(
|
||||
@@ -30,7 +30,7 @@ Program {
|
||||
Ident(
|
||||
"a",
|
||||
),
|
||||
TypeBox {
|
||||
LocBox {
|
||||
inner: Ref {
|
||||
inner: Owned(
|
||||
Ident(
|
||||
|
||||
Reference in New Issue
Block a user