mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
[internal] minor cleaning
This commit is contained in:
parent
cee00eb13d
commit
d2a973d734
3 changed files with 4 additions and 3 deletions
|
|
@ -1,10 +1,11 @@
|
||||||
local ast = require("anselme.ast")
|
local ast = require("anselme.ast")
|
||||||
local ArgumentTuple
|
local ArgumentTuple
|
||||||
|
local Event = ast.abstract.Event
|
||||||
|
|
||||||
local operator_priority = require("anselme.common").operator_priority
|
local operator_priority = require("anselme.common").operator_priority
|
||||||
|
|
||||||
local Choice
|
local Choice
|
||||||
Choice = ast.abstract.Runtime {
|
Choice = ast.abstract.Runtime(Event) {
|
||||||
type = "choice",
|
type = "choice",
|
||||||
|
|
||||||
text = nil,
|
text = nil,
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ local primary = require("anselme.parser.expression.primary.primary")
|
||||||
|
|
||||||
local Identifier = require("anselme.ast.Identifier")
|
local Identifier = require("anselme.ast.Identifier")
|
||||||
|
|
||||||
local disallowed_set = ("\n.~`^+-=<>/[]*{}|\\_!?,;:()\"@&$#%"):gsub("[^%w]", "%%%1")
|
local disallowed_set = ("\n+-*/%^=<>[]{}()|\\_.,`!?;:~\"@&$#"):gsub("[^%w]", "%%%1")
|
||||||
local identifier_pattern = "[ \t]*[^0-9%s'"..disallowed_set.."][^"..disallowed_set.."]*"
|
local identifier_pattern = "[ \t]*[^0-9%s'"..disallowed_set.."][^"..disallowed_set.."]*"
|
||||||
|
|
||||||
local common = require("anselme.common")
|
local common = require("anselme.common")
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@ return {
|
||||||
|
|
||||||
-- choice
|
-- choice
|
||||||
{
|
{
|
||||||
"write choice", "(text::is text, fn=attached block(keep return=true))",
|
"write choice", "(text::is text, fn=attached block(keep return=true, default=($()())))",
|
||||||
function(state, text, func)
|
function(state, text, func)
|
||||||
if func:contains_current_resume_target(state) then
|
if func:contains_current_resume_target(state) then
|
||||||
func:call(state, ArgumentTuple:new())
|
func:call(state, ArgumentTuple:new())
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue