mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 08:39:30 +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,
|
||||
type_expression = nil,
|
||||
|
||||
init = function(self, type, expression)
|
||||
self.type_expression = type
|
||||
init = function(self, expression, type)
|
||||
self.expression = expression
|
||||
self.type_expression = type
|
||||
end,
|
||||
|
||||
_format = function(self, state, prio, ...)
|
||||
|
|
@ -30,8 +30,8 @@ Typed = ast.abstract.Runtime {
|
|||
end,
|
||||
|
||||
traverse = function(self, fn, ...)
|
||||
fn(self.type_expression, ...)
|
||||
fn(self.expression, ...)
|
||||
fn(self.type_expression, ...)
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,9 +50,9 @@ return {
|
|||
end
|
||||
},
|
||||
{
|
||||
"type", "(type, value)",
|
||||
function(state, t, v)
|
||||
return Typed:new(t, v)
|
||||
"type", "(value, type)",
|
||||
function(state, v, t)
|
||||
return Typed:new(v, t)
|
||||
end
|
||||
},
|
||||
{ "true", Boolean:new(true) },
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue