blob: fed984ac55aed2e0f0a907e133a13f937a586592 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File storage for static regular expressions.
########################################################
# Regular expressions for handling double-quoted strings
########################################################
## Match a possible single character escape
possibleStringEscape \\.
## Match valid string escapes
shortFormStringEscape [btnfr"'\\]
octalStringEscape [0-3]?[0-7]{1,2}
unicodeStringEscape u[0-9a-fA-F]{4}
## Match an unescaped quote in a string.
unescapedQuote (?<!\\)\"
## Match one or more characters that aren't part of an escape or a quote.
nonStringEscape [^\\\"]+
########################################
# Double validation regular expressions.
########################################
## Unit pieces for doubles
fpDigits (?:\p{Digit}+)
fpHexDigits (?:\p{XDigit}+)
## An exponent is e or E followed by a (optionally signed) decimal integer.
fpExponent [eE][+-]?
## A double leader
##
## NOTE: The incomplete parts are finished by where it is inserted.
fpLeader [\x00-\x20]*[+-]?(?:NaN|Infinity|
######################################
# CL format string regular expressions
######################################
## Matches a format string prefix parameter
## A prefix parameter is one of
## * A signed decimal number
## * A single character preceded by a single quote
## * The letter V (or v)
## * The character #
clFormatPrefix (?:(?:[-+]?\d+|'.|[Vv]|#|%)?)
## Match a format string modifier
## A modifier is any combination of $, :, * and @; duplicates don't matter though
clFormatModifier (?:[@$:*]+)
## Matches a directive name.
## A directive name is either
## 1) A single, non-whitespace, non-/ character
## 2) A name enclosed in /'s
clFormatName (?:(?<name>[\S&&[^/]])|(?:/(?<funcname>[\S&&[^/]]+)/))
##############################################
# Miscellaneous validation regular expressions
##############################################
intLiteral \A[+\-]\d+\Z
|