mirror of
https://gitlab.kit.edu/uskyk/typicalc.git
synced 2024-11-09 10:50:42 +00:00
Optimise type assumption syntax
This commit is contained in:
parent
dc69e14c04
commit
f928b2bae3
@ -19,8 +19,8 @@ function modifyValue(area: HTMLInputElement) {
|
||||
const value = parseBack(area.value);
|
||||
const start = area.selectionStart;
|
||||
const end = area.selectionEnd;
|
||||
// ignore brackets, allow '>', spaces, ':', '.' or '∀' in front and '-', spaces, '.', ':' or ';' at the end of string
|
||||
area.value = value.replace(/(^|\s+|\(|\)|>|∀|:|\.)t[0-9]+(?=\s+|\)|\(|-|:|\.|;|$)/ig, replacer);
|
||||
// ignore brackets, allow '>', spaces, ':', '.', ',' or '∀' in front and '-', spaces, '.', ':', ',' or ';' at the end of string
|
||||
area.value = value.replace(/(^|\s+|\(|\)|>|∀|:|,|\.)t[0-9]+(?=\s+|\)|\(|-|:|\.|;|,|$)/ig, replacer);
|
||||
area.selectionStart = start;
|
||||
area.selectionEnd = end;
|
||||
}
|
||||
|
@ -23,10 +23,11 @@ root.termGrammar=\u2329Term\u232A ::= (\u2329Term\u232A) | \u2329App\u232A | \u2
|
||||
\u2329Const\u232A ::= [0-9]+ | true | false
|
||||
|
||||
root.typeGrammar=\u2329Type\u232A ::= \u2329QuantifiedType\u232A | \u2329NormalType\u232A <br> \
|
||||
\u2329QuantifiedType\u232A ::= <b>∀</b>\u2329VarType\u232A<b>.</b>\u2329NormalType\u232A <br> \
|
||||
\u2329QuantifiedType\u232A ::= <b>∀</b>\u2329EnumVarType\u232A<b>.</b>\u2329NormalType\u232A <br> \
|
||||
\u2329NormalType\u232A ::= (\u2329NormalType\u232A) | \u2329NamedType\u232A | \u2329VarType\u232A | \
|
||||
\u2329FunctionType\u232A <br> \
|
||||
\u2329NamedType\u232A ::= [a-zA-Z][a-zA-Z0-9]*  \\t[0-9]+ <br> \
|
||||
\u2329EnumVarType\u232A ::= \u2329VarType\u232A <b>,</b> \u2329EnumVarType\u232A | \u2329VarType\u232A <br>\
|
||||
\u2329VarType\u232A ::= t[0-9]+ <br> \
|
||||
\u2329FunctionType\u232A ::= \u2329NormalType\u232A -> \u2329NormalType\u232A
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user