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