mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Typed swap value & type order
This commit is contained in:
parent
507dd5930e
commit
a7f2362199
2 changed files with 6 additions and 6 deletions
|
|
@ -11,9 +11,9 @@ Typed = ast.abstract.Runtime {
|
||||||
expression = nil,
|
expression = nil,
|
||||||
type_expression = nil,
|
type_expression = nil,
|
||||||
|
|
||||||
init = function(self, type, expression)
|
init = function(self, expression, type)
|
||||||
self.type_expression = type
|
|
||||||
self.expression = expression
|
self.expression = expression
|
||||||
|
self.type_expression = type
|
||||||
end,
|
end,
|
||||||
|
|
||||||
_format = function(self, state, prio, ...)
|
_format = function(self, state, prio, ...)
|
||||||
|
|
@ -30,8 +30,8 @@ Typed = ast.abstract.Runtime {
|
||||||
end,
|
end,
|
||||||
|
|
||||||
traverse = function(self, fn, ...)
|
traverse = function(self, fn, ...)
|
||||||
fn(self.type_expression, ...)
|
|
||||||
fn(self.expression, ...)
|
fn(self.expression, ...)
|
||||||
|
fn(self.type_expression, ...)
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -50,9 +50,9 @@ return {
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type", "(type, value)",
|
"type", "(value, type)",
|
||||||
function(state, t, v)
|
function(state, v, t)
|
||||||
return Typed:new(t, v)
|
return Typed:new(v, t)
|
||||||
end
|
end
|
||||||
},
|
},
|
||||||
{ "true", Boolean:new(true) },
|
{ "true", Boolean:new(true) },
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue