blob: d58dba7d550953fc8d4dba5c05cce56571963789 (
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
# File storage for format strings
####################################################
# Format strings for handling double-quoted strings.
####################################################
## Format the three types of string escapes into a valid pattern.
## The three types are:
## 1) Short escapes.
## 2) Octal escapes.
## 3) Unicode escapes.
stringEscape \\(%1$s|%2$s|%3$s)
## Format the parts of a regex into one that matches java-style double-quoted strings.
## The parts are:
## 1) Anything that's not a possible escape sequence or quote.
## 2) A possible escape sequence.
doubleQuotes ("(%1$s|%2$s)*")
#####################################
# Format strings for handling doubles
#####################################
## Format a floating point exponent regex.
## The parts are:
## 1) Exponent indicator,
## 2) One or more digits.
fpExponent %1$s%2$s
## Format a decimal number with an integer part.
## The parts are:
## 1) A series of decimal digits
## 2) An exponent.
##
## The number format is:
## 1) An integer part
## 2) An optional dot
## 3) An optional decimal part
## 4) An optional exponent
fpDecimalInteger (?:%1$s(?:\.?)(?:%1$s?)(?:%2$s)?)
## Format a decimal number with no integer part.
## The parts are:
## 1) A series of decimal digits
## 2) An exponent.
##
## The number format is:
## 1) A dot
## 2) A decimal part
## 3) An optional exponent
fpDecimalDecimal (?:\.(?:%1$s)(?:%2$s)?)
## Format a hexadecimal number with no decimal part.
## The parts are:
## 1) A series of hex digits
##
## The number format is:
## 1) A hex leader.
## 2) A series of hex digits.
## 3) An optional dot.
fpHexInteger (?:0[xX]%1$s(?:\.)?)
## Format a hexadecimal number with a decimal part
## The parts are:
## 1) A series of hex digits.
##
## The number format is:
## 1) A hex leader.
## 2) A optional series of hex digits.
## 3) A dot.
## 4) A series of hex digits.
fpHexDecimal (?:0[xX]%1$s?(?:\.)%1$s)
## Format a hexadecimal leader before a prefix.
## The parts are:
## 1) A hex number with no decimal part
## 2) A hex number with a decimal part
fpHexLeader (?:%1$s|%2$s)
## Format a hexadecimal floating point number.
## The parts are:
## 1) A hexadecimal leader.
## 2) A series of decimal digits.
##
## The number format is:
## 1) A hexadecimal leader.
## 2) A exponent indicator.
## 3) An optional sign.
## 4) A series of decimal digits.
fpHexString (?:%1$s[pP][+-]?%2$s)
## Format the number part of a double.
## The parts are:
## 1) A decimal double with an integer part.
## 2) A decimal double without an integer part.
## 3) A hexadecimal double.
fpNumber (?:%1$s|%2$s|%3$s)
## Format a floating point leader.
##
## NOTE: The other parts are completed by where we're inserted.
## Format a double
## The parts are:
## 1) A leader
## 2) A number
##
## NOTE: The parens are not mismatched.
## The other one is contributed by the leader.
fpDouble %1$1(?:%2$s[fFdD]?))[\x00-\x20]*
|