Archived
1
0

Mark reserved identifiers as illegal

This commit is contained in:
Jip J. Dekker 2018-02-10 16:54:04 +11:00
parent df43cb7130
commit f8ae7d0628

View File

@ -260,26 +260,30 @@ main : context {
## Keyword Patterns ## Keyword Patterns
####################################### #######################################
# TODO: Check list: ann, annotation, any, array, bool, case, constraint, diff, div, else, elseif, endif, enum, false, float, function, if, in, include, int, intersect, let, list, maximize, minimize, mod, not, of, op, output, par, predicate, record, satisfy, set, solve, string, subset, superset, symdiff, test, then, true, tuple, type, union, var, where, xor
: pattern { : pattern {
description = item keyword description = item keyword
regex \= (\b(?:ann|annotation|any|constraint|function|in|include|list|op|output|minimize|maximize|predicate|record|satisfy|solve|test|type)\b) regex \= (\b(?:annotation|constraint|function|include|op|output|minimize|maximize|predicate|satisfy|solve|test|type)\b)
styles [] = .keyword; styles [] = .keyword;
} }
: pattern { : pattern {
description = type keyword description = type keyword
regex \= (\b(?:array|set|bool|enum|float|int|of|par|string|tuple|var)\b) regex \= (\b(?:ann|array|bool|enum|float|int|list|of|par|set|string|tuple|var)\b)
styles [] = .type; styles [] = .type;
} }
: pattern { : pattern {
description = expression keyword description = expression keyword
regex \= (\b(?:for|forall|if|then|elseif|else|endif|where)\b) regex \= (\b(?:for|forall|if|then|elseif|else|endif|where|let|in)\b)
styles [] = .keyword; styles [] = .keyword;
} }
: pattern {
description = reserved identifiers
regex \= (\b(?:any|case|op|record)\b)
styles [] = .illegal;
}
####################################### #######################################
## Library Patterns ## Library Patterns
####################################### #######################################