mirror of
https://git.sfja.dk/Mikkel/slige.git
synced 2025-01-18 18:36:31 +00:00
desugar param
This commit is contained in:
parent
ac36353609
commit
82a2f259e1
@ -49,10 +49,10 @@ export class ArrayLiteralDesugarer implements AstVisitor {
|
|||||||
stmts: [
|
stmts: [
|
||||||
Stmt({
|
Stmt({
|
||||||
type: "let",
|
type: "let",
|
||||||
param: {
|
param: this.astCreator.param({
|
||||||
ident: "::value",
|
ident: "::value",
|
||||||
pos: npos,
|
pos: npos,
|
||||||
},
|
}),
|
||||||
value: Expr({
|
value: Expr({
|
||||||
type: "call",
|
type: "call",
|
||||||
subject: Expr({
|
subject: Expr({
|
||||||
|
@ -70,12 +70,18 @@ export class SpecialLoopDesugarer implements AstVisitor {
|
|||||||
stmts: [
|
stmts: [
|
||||||
Stmt({
|
Stmt({
|
||||||
type: "let",
|
type: "let",
|
||||||
param: { ident: "::values", pos: npos },
|
param: this.astCreator.param({
|
||||||
|
ident: "::values",
|
||||||
|
pos: npos,
|
||||||
|
}),
|
||||||
value: expr.kind.value,
|
value: expr.kind.value,
|
||||||
}),
|
}),
|
||||||
Stmt({
|
Stmt({
|
||||||
type: "let",
|
type: "let",
|
||||||
param: { ident: "::length", pos: npos },
|
param: this.astCreator.param({
|
||||||
|
ident: "::length",
|
||||||
|
pos: npos,
|
||||||
|
}),
|
||||||
value: Expr({
|
value: Expr({
|
||||||
type: "call",
|
type: "call",
|
||||||
subject: Expr({
|
subject: Expr({
|
||||||
@ -96,7 +102,10 @@ export class SpecialLoopDesugarer implements AstVisitor {
|
|||||||
}),
|
}),
|
||||||
Stmt({
|
Stmt({
|
||||||
type: "let",
|
type: "let",
|
||||||
param: { ident: "::index", pos: npos },
|
param: this.astCreator.param({
|
||||||
|
ident: "::index",
|
||||||
|
pos: npos,
|
||||||
|
}),
|
||||||
value: Expr({ type: "int", value: 0 }),
|
value: Expr({ type: "int", value: 0 }),
|
||||||
}, expr.pos),
|
}, expr.pos),
|
||||||
Stmt({
|
Stmt({
|
||||||
|
@ -52,10 +52,10 @@ export class StructLiteralDesugarer implements AstVisitor {
|
|||||||
stmts: [
|
stmts: [
|
||||||
Stmt({
|
Stmt({
|
||||||
type: "let",
|
type: "let",
|
||||||
param: {
|
param: this.astCreator.param({
|
||||||
ident: "::value",
|
ident: "::value",
|
||||||
pos: npos,
|
pos: npos,
|
||||||
},
|
}),
|
||||||
value: Expr({
|
value: Expr({
|
||||||
type: "call",
|
type: "call",
|
||||||
subject: Expr({
|
subject: Expr({
|
||||||
|
Loading…
Reference in New Issue
Block a user