mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Changed a few things
- Bumped to 0.15.0 - Add boot script - Change variable definition syntax, using a = to distinguish more cleary between identifier and value - Variables initial values are evaluated on first use instead of at parsing time - Error on variable redefinition. Means you should make sure to load saves after your scripts. - Improve string parsing, support for escape codes - Remove support for number literals with empty decimal part (42. for 42.0) as there's no distinction in Anselme and it conflicts with .function call suffix - Changed priority of : pair operator - Add type type, and type annotations to variables and function parameters - Change Lua function system to use regular Anselme functions - Defining a function from Lua is now way simpler and require providing a full Anselme function signature - Change Anselme function system - Dynamic dispatch, based on arity, type annotation and parameter names. Will select the most specific function at runtime. - Define way to overload most operators - Allow custom type to text formatters - Allow assignment to custom functions - Index operator ( renamed to () - Functions with parameters each have their own private namespace (scoping ersatz) - Internal: "custom"-mode operators now have their own expression AST type instead of cluttering the function system - Remove static type checker as it is barely useful with new function system. May or may not rewrite one in the future. - Improve error messages here and there - Internal: cleaning
This commit is contained in:
parent
4b139019c9
commit
64bc85741a
86 changed files with 2096 additions and 1012 deletions
130
test/tests/lazy boolean operators.lua
Normal file
130
test/tests/lazy boolean operators.lua
Normal file
|
|
@ -0,0 +1,130 @@
|
|||
local _={}
|
||||
_[57]={}
|
||||
_[56]={}
|
||||
_[55]={}
|
||||
_[54]={}
|
||||
_[53]={}
|
||||
_[52]={}
|
||||
_[51]={}
|
||||
_[50]={}
|
||||
_[49]={}
|
||||
_[48]={}
|
||||
_[47]={}
|
||||
_[46]={}
|
||||
_[45]={}
|
||||
_[44]={}
|
||||
_[43]={}
|
||||
_[42]={}
|
||||
_[41]={}
|
||||
_[40]={}
|
||||
_[39]={}
|
||||
_[38]={}
|
||||
_[37]={data="0 = b b 0",tags=_[57]}
|
||||
_[36]={data="b",tags=_[56]}
|
||||
_[35]={data="b",tags=_[55]}
|
||||
_[34]={data="1 = a 1",tags=_[54]}
|
||||
_[33]={data="a",tags=_[53]}
|
||||
_[32]={data="1 = b a 1",tags=_[52]}
|
||||
_[31]={data="a",tags=_[51]}
|
||||
_[30]={data="b",tags=_[50]}
|
||||
_[29]={data="1 = a 1",tags=_[49]}
|
||||
_[28]={data="a",tags=_[48]}
|
||||
_[27]={data="0 = b 0",tags=_[47]}
|
||||
_[26]={data="b",tags=_[46]}
|
||||
_[25]={data="1 = a a 1",tags=_[45]}
|
||||
_[24]={data="a",tags=_[44]}
|
||||
_[23]={data="a",tags=_[43]}
|
||||
_[22]={data="0 = b 0",tags=_[42]}
|
||||
_[21]={data="b",tags=_[41]}
|
||||
_[20]={data="0 = a b 0",tags=_[40]}
|
||||
_[19]={data="b",tags=_[39]}
|
||||
_[18]={data="a",tags=_[38]}
|
||||
_[17]={_[35],_[36],_[37]}
|
||||
_[16]={_[33],_[34]}
|
||||
_[15]={_[30],_[31],_[32]}
|
||||
_[14]={_[28],_[29]}
|
||||
_[13]={_[26],_[27]}
|
||||
_[12]={_[23],_[24],_[25]}
|
||||
_[11]={_[21],_[22]}
|
||||
_[10]={_[18],_[19],_[20]}
|
||||
_[9]={"return"}
|
||||
_[8]={"text",_[17]}
|
||||
_[7]={"text",_[16]}
|
||||
_[6]={"text",_[15]}
|
||||
_[5]={"text",_[14]}
|
||||
_[4]={"text",_[13]}
|
||||
_[3]={"text",_[12]}
|
||||
_[2]={"text",_[11]}
|
||||
_[1]={"text",_[10]}
|
||||
return {_[1],_[2],_[3],_[4],_[5],_[6],_[7],_[8],_[9]}
|
||||
--[[
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "0 = a b 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "0 = b 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "1 = a a 1",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "0 = b 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "1 = a 1",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "1 = b a 1",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "a",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "1 = a 1",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "text", { {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "b",
|
||||
tags = {}
|
||||
}, {
|
||||
data = "0 = b b 0",
|
||||
tags = {}
|
||||
} } }
|
||||
{ "return" }
|
||||
]]--
|
||||
Loading…
Add table
Add a link
Reference in a new issue