Skip to content

Commit

Permalink
WIP: make parser more strict. require escaping of LB & RB
Browse files Browse the repository at this point in the history
  • Loading branch information
klntsky committed Nov 23, 2024
1 parent 4cd4483 commit bd3bf0e
Show file tree
Hide file tree
Showing 11 changed files with 320 additions and 507 deletions.
46 changes: 19 additions & 27 deletions grammar/MetaPrompt.g4
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,8 @@ grammar MetaPrompt;

prompt: exprs EOF ;
exprs: expr*? ;
exprs1: expr+? ;
expr: LB expr1 RB
expr: meta_body
| text
| RB
| LB
| COMMENT_KW
| META_PROMPT
| EQ_KW
Expand All @@ -19,31 +16,26 @@ expr: LB expr1 RB
| WITH_KW
;

expr1
: meta_body
| exprs
;

meta_body
: IF_KW exprs THEN_KW exprs ELSE_KW exprs
| IF_KW exprs THEN_KW exprs
| CHOOSE_KW exprs option+ default_option?
| USE named_parameters
| META_PROMPT exprs
| COMMENT_KW exprs
| var_assignment
: IF_KW exprs THEN_KW exprs ELSE_KW exprs RB
| IF_KW exprs THEN_KW exprs RB
| CHOOSE_KW exprs option+ default_option? RB
| USE named_parameters RB
| META_PROMPT exprs RB
| COMMENT_KW exprs RB
| LB var_assignment RB
| var_optional_assignment
| VAR_NAME
| CALL call_arg1 call_arg*
| CALL call_arg*
| LB VAR_NAME RB
| CALL call_arg1 call_arg* RB
| CALL call_arg* RB
;

var_assignment
: VAR_NAME EQ_KW exprs
;

var_optional_assignment
: VAR_NAME EQ_OPTIONAL_KW exprs
: LB VAR_NAME EQ_OPTIONAL_KW exprs RB
;

call_arg1
Expand Down Expand Up @@ -74,17 +66,17 @@ LB : '[';
RB : ']';
EQ_KW : '=' ;
EQ_OPTIONAL_KW : '?=' ;
META_PROMPT : [a-zA-Z_]?[a-zA-Z0-9_]* '$' ;
COMMENT_KW : '#' ;
META_PROMPT : LB [a-zA-Z_]?[a-zA-Z0-9_]* '$' ;
COMMENT_KW : LB '#' ;
CHAR : ( ESCAPED | .);
fragment ESCAPED : ESCAPE ESCAPEE;
fragment ESCAPEE : (LB | ESCAPE);
fragment ESCAPEE : (LB | ESCAPE | RB);
fragment ESCAPE : '\\';
USE : ':use' WS+ [a-zA-Z0-9/_.-]+ WS*;
CALL : '@' [a-zA-Z_][a-zA-Z0-9_]* WS*;
USE : LB ':use' WS+ [a-zA-Z0-9/_.-]+ WS*;
CALL : LB '@' [a-zA-Z_][a-zA-Z0-9_]* WS*;
fragment WS : ' '|'\n';
IF_KW : ':if' ;
CHOOSE_KW : ':choose' ;
IF_KW : LB ':if' ;
CHOOSE_KW : LB ':choose' ;
OPTION_KW : ':option' ;
WITH_KW : ':with' ;
DEFAULT_KW : ':default' ;
Expand Down
54 changes: 10 additions & 44 deletions python/src/parse_metaprompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ def syntaxError(self, recognizer, offendingSymbol, line, column, msg, e):
raise Exception(f"Syntax error at line {line}:{column} - {msg}")


_pattern = r"\\([\[\\])(\[)?"
_pattern = r"\\([\[\\\]])"


def _escape_pattern(match):
first = match.group(1)
second = match.group(2)
if second is None:
if first == "\\":
return "\\\\"
elif first == "[":
return "["
else:
raise ValueError("Invariant violation: _escape_pattern")
else:
return match.group(1)
return first


def _process_escaping(string):
Expand All @@ -52,35 +43,18 @@ def visitExprs(self, ctx: MetaPromptParser.ExprsContext):
exprs = []
for expr in ctx.expr():
expr_items = self.visit(expr)
exprs.extend(expr_items)
return _process_expr_list(exprs)

def visitExprs1(self, ctx: MetaPromptParser.Exprs1Context):
exprs = []
for expr in ctx.expr():
expr_items = self.visit(expr)
exprs.extend(expr_items)
exprs.append(expr_items)
return _process_expr_list(exprs)

def visitExpr(self, ctx: MetaPromptParser.ExprContext):
exprs = []
if ctx.text() is not None:
exprs.append(self.visit(ctx.text()))
if ctx.expr1() is not None:
expr1 = self.visit(ctx.expr1())
if expr1["type"] == "meta":
exprs.append(expr1["meta"])
elif expr1["type"] == "exprs":
exprs.append({"type": "text", "text": "["})
for child in expr1["exprs"]:
exprs.append(child)
exprs.append({"type": "text", "text": "]"})
return self.visit(ctx.text())
if ctx.meta_body() is not None:
return self.visit(ctx.meta_body())
else:
# a token is in a standalone position and should be
# treaded as text
for part in [
ctx.RB(),
ctx.LB(),
ctx.COMMENT_KW(),
ctx.META_PROMPT(),
ctx.EQ_KW(),
Expand All @@ -93,15 +67,7 @@ def visitExpr(self, ctx: MetaPromptParser.ExprContext):
ctx.WITH_KW(),
]:
if part is not None:
exprs.append({"type": "text", "text": part.getText()})

return _process_expr_list(exprs)

def visitExpr1(self, ctx: MetaPromptParser.Expr1Context):
if ctx.meta_body() is not None:
return {"type": "meta", "meta": self.visit(ctx.meta_body())}
else:
return {"type": "exprs", "exprs": self.visit(ctx.exprs())}
return {"type": "text", "text": part.getText()}

def visitVar_optional_assignment(
self, ctx: MetaPromptParser.Var_optional_assignmentContext
Expand Down Expand Up @@ -193,7 +159,7 @@ def visitMeta_body(self, ctx: MetaPromptParser.Meta_bodyContext):
}

elif ctx.USE() is not None:
module_name = ctx.USE().getText().removeprefix(":use").strip()
module_name = ctx.USE().getText().removeprefix("[:use").strip()
parameters = self.visit(ctx.named_parameters())
return {
"type": "use",
Expand All @@ -202,7 +168,7 @@ def visitMeta_body(self, ctx: MetaPromptParser.Meta_bodyContext):
}

elif ctx.CALL() is not None:
function_name = ctx.CALL().getText().removeprefix("@").strip()
function_name = ctx.CALL().getText().removeprefix("[@").strip()
positional_args = []
named_args = {}

Expand Down Expand Up @@ -260,7 +226,7 @@ def use_arg(arg):
"type": "meta",
"exprs": _process_expr_list(exprs),
}
chat_id = ctx.META_PROMPT().getText()[:-1]
chat_id = ctx.META_PROMPT().getText()[1:-1]
if chat_id != "":
res["chat"] = chat_id
return res
Expand Down
10 changes: 4 additions & 6 deletions python/src/parser/MetaPrompt.interp
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ null
'='
'?='
null
'#'
null
null
null
':if'
':choose'
null
null
null
':option'
':with'
':default'
Expand Down Expand Up @@ -43,9 +43,7 @@ VAR_NAME
rule names:
prompt
exprs
exprs1
expr
expr1
meta_body
var_assignment
var_optional_assignment
Expand All @@ -58,4 +56,4 @@ text


atn:
[4, 1, 18, 150, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 2, 12, 7, 12, 2, 13, 7, 13, 1, 0, 1, 0, 1, 0, 1, 1, 5, 1, 33, 8, 1, 10, 1, 12, 1, 36, 9, 1, 1, 2, 4, 2, 39, 8, 2, 11, 2, 12, 2, 40, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 3, 3, 60, 8, 3, 1, 4, 1, 4, 3, 4, 64, 8, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 4, 5, 81, 8, 5, 11, 5, 12, 5, 82, 1, 5, 3, 5, 86, 8, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 5, 5, 100, 8, 5, 10, 5, 12, 5, 103, 9, 5, 1, 5, 1, 5, 5, 5, 107, 8, 5, 10, 5, 12, 5, 110, 9, 5, 3, 5, 112, 8, 5, 1, 6, 1, 6, 1, 6, 1, 6, 1, 7, 1, 7, 1, 7, 1, 7, 1, 8, 1, 8, 3, 8, 124, 8, 8, 1, 9, 1, 9, 1, 9, 3, 9, 129, 8, 9, 1, 10, 1, 10, 1, 10, 1, 10, 1, 10, 1, 11, 1, 11, 1, 11, 1, 12, 5, 12, 140, 8, 12, 10, 12, 12, 12, 143, 9, 12, 1, 13, 4, 13, 146, 8, 13, 11, 13, 12, 13, 147, 1, 13, 2, 34, 40, 0, 14, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 0, 0, 169, 0, 28, 1, 0, 0, 0, 2, 34, 1, 0, 0, 0, 4, 38, 1, 0, 0, 0, 6, 59, 1, 0, 0, 0, 8, 63, 1, 0, 0, 0, 10, 111, 1, 0, 0, 0, 12, 113, 1, 0, 0, 0, 14, 117, 1, 0, 0, 0, 16, 123, 1, 0, 0, 0, 18, 128, 1, 0, 0, 0, 20, 130, 1, 0, 0, 0, 22, 135, 1, 0, 0, 0, 24, 141, 1, 0, 0, 0, 26, 145, 1, 0, 0, 0, 28, 29, 3, 2, 1, 0, 29, 30, 5, 0, 0, 1, 30, 1, 1, 0, 0, 0, 31, 33, 3, 6, 3, 0, 32, 31, 1, 0, 0, 0, 33, 36, 1, 0, 0, 0, 34, 35, 1, 0, 0, 0, 34, 32, 1, 0, 0, 0, 35, 3, 1, 0, 0, 0, 36, 34, 1, 0, 0, 0, 37, 39, 3, 6, 3, 0, 38, 37, 1, 0, 0, 0, 39, 40, 1, 0, 0, 0, 40, 41, 1, 0, 0, 0, 40, 38, 1, 0, 0, 0, 41, 5, 1, 0, 0, 0, 42, 43, 5, 1, 0, 0, 43, 44, 3, 8, 4, 0, 44, 45, 5, 2, 0, 0, 45, 60, 1, 0, 0, 0, 46, 60, 3, 26, 13, 0, 47, 60, 5, 2, 0, 0, 48, 60, 5, 1, 0, 0, 49, 60, 5, 6, 0, 0, 50, 60, 5, 5, 0, 0, 51, 60, 5, 3, 0, 0, 52, 60, 5, 18, 0, 0, 53, 60, 5, 11, 0, 0, 54, 60, 5, 12, 0, 0, 55, 60, 5, 14, 0, 0, 56, 60, 5, 15, 0, 0, 57, 60, 5, 9, 0, 0, 58, 60, 5, 13, 0, 0, 59, 42, 1, 0, 0, 0, 59, 46, 1, 0, 0, 0, 59, 47, 1, 0, 0, 0, 59, 48, 1, 0, 0, 0, 59, 49, 1, 0, 0, 0, 59, 50, 1, 0, 0, 0, 59, 51, 1, 0, 0, 0, 59, 52, 1, 0, 0, 0, 59, 53, 1, 0, 0, 0, 59, 54, 1, 0, 0, 0, 59, 55, 1, 0, 0, 0, 59, 56, 1, 0, 0, 0, 59, 57, 1, 0, 0, 0, 59, 58, 1, 0, 0, 0, 60, 7, 1, 0, 0, 0, 61, 64, 3, 10, 5, 0, 62, 64, 3, 2, 1, 0, 63, 61, 1, 0, 0, 0, 63, 62, 1, 0, 0, 0, 64, 9, 1, 0, 0, 0, 65, 66, 5, 10, 0, 0, 66, 67, 3, 2, 1, 0, 67, 68, 5, 16, 0, 0, 68, 69, 3, 2, 1, 0, 69, 70, 5, 17, 0, 0, 70, 71, 3, 2, 1, 0, 71, 112, 1, 0, 0, 0, 72, 73, 5, 10, 0, 0, 73, 74, 3, 2, 1, 0, 74, 75, 5, 16, 0, 0, 75, 76, 3, 2, 1, 0, 76, 112, 1, 0, 0, 0, 77, 78, 5, 11, 0, 0, 78, 80, 3, 2, 1, 0, 79, 81, 3, 20, 10, 0, 80, 79, 1, 0, 0, 0, 81, 82, 1, 0, 0, 0, 82, 80, 1, 0, 0, 0, 82, 83, 1, 0, 0, 0, 83, 85, 1, 0, 0, 0, 84, 86, 3, 22, 11, 0, 85, 84, 1, 0, 0, 0, 85, 86, 1, 0, 0, 0, 86, 112, 1, 0, 0, 0, 87, 88, 5, 8, 0, 0, 88, 112, 3, 24, 12, 0, 89, 90, 5, 5, 0, 0, 90, 112, 3, 2, 1, 0, 91, 92, 5, 6, 0, 0, 92, 112, 3, 2, 1, 0, 93, 112, 3, 12, 6, 0, 94, 112, 3, 14, 7, 0, 95, 112, 5, 18, 0, 0, 96, 97, 5, 9, 0, 0, 97, 101, 3, 16, 8, 0, 98, 100, 3, 18, 9, 0, 99, 98, 1, 0, 0, 0, 100, 103, 1, 0, 0, 0, 101, 99, 1, 0, 0, 0, 101, 102, 1, 0, 0, 0, 102, 112, 1, 0, 0, 0, 103, 101, 1, 0, 0, 0, 104, 108, 5, 9, 0, 0, 105, 107, 3, 18, 9, 0, 106, 105, 1, 0, 0, 0, 107, 110, 1, 0, 0, 0, 108, 106, 1, 0, 0, 0, 108, 109, 1, 0, 0, 0, 109, 112, 1, 0, 0, 0, 110, 108, 1, 0, 0, 0, 111, 65, 1, 0, 0, 0, 111, 72, 1, 0, 0, 0, 111, 77, 1, 0, 0, 0, 111, 87, 1, 0, 0, 0, 111, 89, 1, 0, 0, 0, 111, 91, 1, 0, 0, 0, 111, 93, 1, 0, 0, 0, 111, 94, 1, 0, 0, 0, 111, 95, 1, 0, 0, 0, 111, 96, 1, 0, 0, 0, 111, 104, 1, 0, 0, 0, 112, 11, 1, 0, 0, 0, 113, 114, 5, 18, 0, 0, 114, 115, 5, 3, 0, 0, 115, 116, 3, 2, 1, 0, 116, 13, 1, 0, 0, 0, 117, 118, 5, 18, 0, 0, 118, 119, 5, 4, 0, 0, 119, 120, 3, 2, 1, 0, 120, 15, 1, 0, 0, 0, 121, 124, 3, 12, 6, 0, 122, 124, 3, 2, 1, 0, 123, 121, 1, 0, 0, 0, 123, 122, 1, 0, 0, 0, 124, 17, 1, 0, 0, 0, 125, 129, 3, 12, 6, 0, 126, 127, 5, 13, 0, 0, 127, 129, 3, 2, 1, 0, 128, 125, 1, 0, 0, 0, 128, 126, 1, 0, 0, 0, 129, 19, 1, 0, 0, 0, 130, 131, 5, 12, 0, 0, 131, 132, 3, 2, 1, 0, 132, 133, 5, 15, 0, 0, 133, 134, 3, 2, 1, 0, 134, 21, 1, 0, 0, 0, 135, 136, 5, 14, 0, 0, 136, 137, 3, 2, 1, 0, 137, 23, 1, 0, 0, 0, 138, 140, 3, 12, 6, 0, 139, 138, 1, 0, 0, 0, 140, 143, 1, 0, 0, 0, 141, 139, 1, 0, 0, 0, 141, 142, 1, 0, 0, 0, 142, 25, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 144, 146, 5, 7, 0, 0, 145, 144, 1, 0, 0, 0, 146, 147, 1, 0, 0, 0, 147, 145, 1, 0, 0, 0, 147, 148, 1, 0, 0, 0, 148, 27, 1, 0, 0, 0, 13, 34, 40, 59, 63, 82, 85, 101, 108, 111, 123, 128, 141, 147]
[4, 1, 18, 152, 2, 0, 7, 0, 2, 1, 7, 1, 2, 2, 7, 2, 2, 3, 7, 3, 2, 4, 7, 4, 2, 5, 7, 5, 2, 6, 7, 6, 2, 7, 7, 7, 2, 8, 7, 8, 2, 9, 7, 9, 2, 10, 7, 10, 2, 11, 7, 11, 1, 0, 1, 0, 1, 0, 1, 1, 5, 1, 29, 8, 1, 10, 1, 12, 1, 32, 9, 1, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 1, 2, 3, 2, 46, 8, 2, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 4, 3, 65, 8, 3, 11, 3, 12, 3, 66, 1, 3, 3, 3, 70, 8, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 97, 8, 3, 10, 3, 12, 3, 100, 9, 3, 1, 3, 1, 3, 1, 3, 1, 3, 5, 3, 106, 8, 3, 10, 3, 12, 3, 109, 9, 3, 1, 3, 3, 3, 112, 8, 3, 1, 4, 1, 4, 1, 4, 1, 4, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 5, 1, 6, 1, 6, 3, 6, 126, 8, 6, 1, 7, 1, 7, 1, 7, 3, 7, 131, 8, 7, 1, 8, 1, 8, 1, 8, 1, 8, 1, 8, 1, 9, 1, 9, 1, 9, 1, 10, 5, 10, 142, 8, 10, 10, 10, 12, 10, 145, 9, 10, 1, 11, 4, 11, 148, 8, 11, 11, 11, 12, 11, 149, 1, 11, 1, 30, 0, 12, 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 0, 0, 169, 0, 24, 1, 0, 0, 0, 2, 30, 1, 0, 0, 0, 4, 45, 1, 0, 0, 0, 6, 111, 1, 0, 0, 0, 8, 113, 1, 0, 0, 0, 10, 117, 1, 0, 0, 0, 12, 125, 1, 0, 0, 0, 14, 130, 1, 0, 0, 0, 16, 132, 1, 0, 0, 0, 18, 137, 1, 0, 0, 0, 20, 143, 1, 0, 0, 0, 22, 147, 1, 0, 0, 0, 24, 25, 3, 2, 1, 0, 25, 26, 5, 0, 0, 1, 26, 1, 1, 0, 0, 0, 27, 29, 3, 4, 2, 0, 28, 27, 1, 0, 0, 0, 29, 32, 1, 0, 0, 0, 30, 31, 1, 0, 0, 0, 30, 28, 1, 0, 0, 0, 31, 3, 1, 0, 0, 0, 32, 30, 1, 0, 0, 0, 33, 46, 3, 6, 3, 0, 34, 46, 3, 22, 11, 0, 35, 46, 5, 6, 0, 0, 36, 46, 5, 5, 0, 0, 37, 46, 5, 3, 0, 0, 38, 46, 5, 18, 0, 0, 39, 46, 5, 11, 0, 0, 40, 46, 5, 12, 0, 0, 41, 46, 5, 14, 0, 0, 42, 46, 5, 15, 0, 0, 43, 46, 5, 9, 0, 0, 44, 46, 5, 13, 0, 0, 45, 33, 1, 0, 0, 0, 45, 34, 1, 0, 0, 0, 45, 35, 1, 0, 0, 0, 45, 36, 1, 0, 0, 0, 45, 37, 1, 0, 0, 0, 45, 38, 1, 0, 0, 0, 45, 39, 1, 0, 0, 0, 45, 40, 1, 0, 0, 0, 45, 41, 1, 0, 0, 0, 45, 42, 1, 0, 0, 0, 45, 43, 1, 0, 0, 0, 45, 44, 1, 0, 0, 0, 46, 5, 1, 0, 0, 0, 47, 48, 5, 10, 0, 0, 48, 49, 3, 2, 1, 0, 49, 50, 5, 16, 0, 0, 50, 51, 3, 2, 1, 0, 51, 52, 5, 17, 0, 0, 52, 53, 3, 2, 1, 0, 53, 54, 5, 2, 0, 0, 54, 112, 1, 0, 0, 0, 55, 56, 5, 10, 0, 0, 56, 57, 3, 2, 1, 0, 57, 58, 5, 16, 0, 0, 58, 59, 3, 2, 1, 0, 59, 60, 5, 2, 0, 0, 60, 112, 1, 0, 0, 0, 61, 62, 5, 11, 0, 0, 62, 64, 3, 2, 1, 0, 63, 65, 3, 16, 8, 0, 64, 63, 1, 0, 0, 0, 65, 66, 1, 0, 0, 0, 66, 64, 1, 0, 0, 0, 66, 67, 1, 0, 0, 0, 67, 69, 1, 0, 0, 0, 68, 70, 3, 18, 9, 0, 69, 68, 1, 0, 0, 0, 69, 70, 1, 0, 0, 0, 70, 71, 1, 0, 0, 0, 71, 72, 5, 2, 0, 0, 72, 112, 1, 0, 0, 0, 73, 74, 5, 8, 0, 0, 74, 75, 3, 20, 10, 0, 75, 76, 5, 2, 0, 0, 76, 112, 1, 0, 0, 0, 77, 78, 5, 5, 0, 0, 78, 79, 3, 2, 1, 0, 79, 80, 5, 2, 0, 0, 80, 112, 1, 0, 0, 0, 81, 82, 5, 6, 0, 0, 82, 83, 3, 2, 1, 0, 83, 84, 5, 2, 0, 0, 84, 112, 1, 0, 0, 0, 85, 86, 5, 1, 0, 0, 86, 87, 3, 8, 4, 0, 87, 88, 5, 2, 0, 0, 88, 112, 1, 0, 0, 0, 89, 112, 3, 10, 5, 0, 90, 91, 5, 1, 0, 0, 91, 92, 5, 18, 0, 0, 92, 112, 5, 2, 0, 0, 93, 94, 5, 9, 0, 0, 94, 98, 3, 12, 6, 0, 95, 97, 3, 14, 7, 0, 96, 95, 1, 0, 0, 0, 97, 100, 1, 0, 0, 0, 98, 96, 1, 0, 0, 0, 98, 99, 1, 0, 0, 0, 99, 101, 1, 0, 0, 0, 100, 98, 1, 0, 0, 0, 101, 102, 5, 2, 0, 0, 102, 112, 1, 0, 0, 0, 103, 107, 5, 9, 0, 0, 104, 106, 3, 14, 7, 0, 105, 104, 1, 0, 0, 0, 106, 109, 1, 0, 0, 0, 107, 105, 1, 0, 0, 0, 107, 108, 1, 0, 0, 0, 108, 110, 1, 0, 0, 0, 109, 107, 1, 0, 0, 0, 110, 112, 5, 2, 0, 0, 111, 47, 1, 0, 0, 0, 111, 55, 1, 0, 0, 0, 111, 61, 1, 0, 0, 0, 111, 73, 1, 0, 0, 0, 111, 77, 1, 0, 0, 0, 111, 81, 1, 0, 0, 0, 111, 85, 1, 0, 0, 0, 111, 89, 1, 0, 0, 0, 111, 90, 1, 0, 0, 0, 111, 93, 1, 0, 0, 0, 111, 103, 1, 0, 0, 0, 112, 7, 1, 0, 0, 0, 113, 114, 5, 18, 0, 0, 114, 115, 5, 3, 0, 0, 115, 116, 3, 2, 1, 0, 116, 9, 1, 0, 0, 0, 117, 118, 5, 1, 0, 0, 118, 119, 5, 18, 0, 0, 119, 120, 5, 4, 0, 0, 120, 121, 3, 2, 1, 0, 121, 122, 5, 2, 0, 0, 122, 11, 1, 0, 0, 0, 123, 126, 3, 8, 4, 0, 124, 126, 3, 2, 1, 0, 125, 123, 1, 0, 0, 0, 125, 124, 1, 0, 0, 0, 126, 13, 1, 0, 0, 0, 127, 131, 3, 8, 4, 0, 128, 129, 5, 13, 0, 0, 129, 131, 3, 2, 1, 0, 130, 127, 1, 0, 0, 0, 130, 128, 1, 0, 0, 0, 131, 15, 1, 0, 0, 0, 132, 133, 5, 12, 0, 0, 133, 134, 3, 2, 1, 0, 134, 135, 5, 15, 0, 0, 135, 136, 3, 2, 1, 0, 136, 17, 1, 0, 0, 0, 137, 138, 5, 14, 0, 0, 138, 139, 3, 2, 1, 0, 139, 19, 1, 0, 0, 0, 140, 142, 3, 8, 4, 0, 141, 140, 1, 0, 0, 0, 142, 145, 1, 0, 0, 0, 143, 141, 1, 0, 0, 0, 143, 144, 1, 0, 0, 0, 144, 21, 1, 0, 0, 0, 145, 143, 1, 0, 0, 0, 146, 148, 5, 7, 0, 0, 147, 146, 1, 0, 0, 0, 148, 149, 1, 0, 0, 0, 149, 147, 1, 0, 0, 0, 149, 150, 1, 0, 0, 0, 150, 23, 1, 0, 0, 0, 11, 30, 45, 66, 69, 98, 107, 111, 125, 130, 143, 149]
3 changes: 0 additions & 3 deletions python/src/parser/MetaPrompt.tokens
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ VAR_NAME=18
']'=2
'='=3
'?='=4
'#'=6
':if'=10
':choose'=11
':option'=12
':with'=13
':default'=14
Expand Down
Loading

0 comments on commit bd3bf0e

Please sign in to comment.