mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
[internal] update notes
This commit is contained in:
parent
b192206de0
commit
2a7e1a4be5
4 changed files with 6 additions and 25 deletions
|
|
@ -7,7 +7,7 @@ local ast = require("anselme.ast")
|
||||||
local Branched
|
local Branched
|
||||||
Branched = ast.abstract.Runtime {
|
Branched = ast.abstract.Runtime {
|
||||||
type = "branched",
|
type = "branched",
|
||||||
mutable = true,
|
mutable = true, -- 🥳
|
||||||
|
|
||||||
value = nil, -- { [branch name] = value, ... }
|
value = nil, -- { [branch name] = value, ... }
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ return infix {
|
||||||
|
|
||||||
match = function(self, str, current_priority, primary)
|
match = function(self, str, current_priority, primary)
|
||||||
local escaped = escape(self.operator)
|
local escaped = escape(self.operator)
|
||||||
-- TODO: doesn't support newline between ! and identifier, event in multiline expression
|
-- TODO: doesn't support newline between ! and identifier, even in multiline expression
|
||||||
return self.priority > current_priority and str:match("^"..escaped) and identifier:match(str:match("^"..escaped.."[ \t]*(.-)$"))
|
return self.priority > current_priority and str:match("^"..escaped) and identifier:match(str:match("^"..escaped.."[ \t]*(.-)$"))
|
||||||
end,
|
end,
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,7 @@ return class {
|
||||||
state.scope:set(discard_next_events_identifier, Nil:new()) -- fake flush the discarded events
|
state.scope:set(discard_next_events_identifier, Nil:new()) -- fake flush the discarded events
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
-- flush until no event or same type
|
-- flush until no event of same type
|
||||||
repeat
|
repeat
|
||||||
local current_type = state.scope:get(last_event_type_identifier):to_lua(state)
|
local current_type = state.scope:get(last_event_type_identifier):to_lua(state)
|
||||||
if current_type ~= nil and current_type ~= event.type then
|
if current_type ~= nil and current_type ~= event.type then
|
||||||
|
|
|
||||||
25
ideas.md
25
ideas.md
|
|
@ -16,15 +16,6 @@ Standard library.
|
||||||
- retag/add tags
|
- retag/add tags
|
||||||
* And in general, clean up everything.
|
* And in general, clean up everything.
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Default arguments and initial variables values should pass the value check associated with the variable / parameter.
|
|
||||||
Issue: dispatch is decided before evaluating default values.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Comment syntax, not sure about using -- for inline and /* for multiline.
|
|
||||||
|
|
||||||
# Can be done later
|
# Can be done later
|
||||||
|
|
||||||
Translation.
|
Translation.
|
||||||
|
|
@ -47,17 +38,14 @@ Return system.
|
||||||
|
|
||||||
Could be reused for exception handling or other purposes if accessible by the user.
|
Could be reused for exception handling or other purposes if accessible by the user.
|
||||||
|
|
||||||
|
Also, named break for nested loops.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Custom function for building text/string interpolation.
|
Custom function for building text/string interpolation.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Reduce the number of AST node types ; try to merge similar node and make simpler individuals nodes if possible by composing them.
|
|
||||||
Won't help with performance but make me feel better, and easier to extend. Anselme should be more minimal is possible.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
Static analysis tools.
|
Static analysis tools.
|
||||||
|
|
||||||
To draw a graph of branches, keep track of used variables and prune the unused ones from the Environments, pre-filter Overloads, etc.
|
To draw a graph of branches, keep track of used variables and prune the unused ones from the Environments, pre-filter Overloads, etc.
|
||||||
|
|
@ -79,14 +67,7 @@ Then again, performance has never been a goal of Anselme.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
Macros.
|
High concept ideas / stuff that sounds cool but likely not worth it.
|
||||||
|
|
||||||
Could be implemented by creating functions to build AST nodes from Anselme that can also take quotes as arguments.
|
|
||||||
That should be easy, but I don't remember why I wanted macros in the first place, so until I want them again, shrug.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
High concept ideas / stuff that sounds cool but maybe not worth it.
|
|
||||||
|
|
||||||
* Instead of using a bunch of sigils as operators, accept fancy unicode caracters.
|
* Instead of using a bunch of sigils as operators, accept fancy unicode caracters.
|
||||||
Easy to parse, but harder to write.
|
Easy to parse, but harder to write.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue