|
4 | 4 | (defn all [kw] (partial every? (partial = kw))) |
5 | 5 | (def number (all :clojureNumber)) |
6 | 6 | (def !number (complement number)) |
7 | | -(def character (all :clojureCharacter)) |
8 | 7 | (def regexp (all :clojureRegexp)) |
| 8 | +(def !regexp (complement regexp)) |
9 | 9 | (def regexp-escape (all :clojureRegexpEscape)) |
| 10 | +(def !regexp-escape (complement regexp-escape)) |
10 | 11 |
|
11 | 12 | (defsyntaxtest number-literals-test |
12 | 13 | (with-format "%s" |
|
74 | 75 | ;; |
75 | 76 | ;; Characters |
76 | 77 | ;; x The character x |
77 | | - "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" regexp |
| 78 | + " 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz" regexp |
78 | 79 | "λ❤" regexp |
79 | 80 | ;; \\ The backslash character |
80 | 81 | "\\\\" regexp-escape |
81 | 82 | ;; \0n The character with octal value 0n (0 <= n <= 7) |
82 | 83 | "\\07" regexp-escape |
| 84 | + "\\08" !regexp-escape |
83 | 85 | ;; \0nn The character with octal value 0nn (0 <= n <= 7) |
84 | 86 | "\\077" regexp-escape |
| 87 | + "\\078" !regexp-escape |
85 | 88 | ;; \0mnn The character with octal value 0mnn (0 <= m <= 3, 0 <= n <= 7) |
86 | 89 | "\\0377" regexp-escape |
| 90 | + "\\0378" !regexp-escape |
| 91 | + "\\0400" !regexp-escape |
87 | 92 | ;; \xhh The character with hexadecimal value 0xhh |
88 | 93 | "\\xff" regexp-escape |
| 94 | + "\\xfg" !regexp-escape |
| 95 | + "\\xfff" !regexp-escape |
89 | 96 | ;; \uhhhh The character with hexadecimal value 0xhhhh |
90 | 97 | "\\uffff" regexp-escape |
| 98 | + "\\ufff" !regexp-escape |
| 99 | + "\\ufffff" !regexp-escape |
91 | 100 | ;; \x{h...h} The character with hexadecimal value 0xh...h (Character.MIN_CODE_POINT <= 0xh...h <= Character.MAX_CODE_POINT) |
92 | | - "\\x{ffff}" regexp-escape |
93 | 101 | ;; \t The tab character ('\u0009') |
94 | 102 | "\\t" regexp-escape |
| 103 | + "\\T" !regexp-escape |
95 | 104 | ;; \n The newline (line feed) character ('\u000A') |
96 | 105 | "\\n" regexp-escape |
| 106 | + "\\N" !regexp-escape |
97 | 107 | ;; \r The carriage-return character ('\u000D') |
98 | 108 | "\\r" regexp-escape |
| 109 | + "\\R" !regexp-escape |
99 | 110 | ;; \f The form-feed character ('\u000C') |
100 | 111 | "\\f" regexp-escape |
| 112 | + "\\F" !regexp-escape |
101 | 113 | ;; \a The alert (bell) character ('\u0007') |
102 | 114 | "\\a" regexp-escape |
| 115 | + "\\A" !regexp-escape |
103 | 116 | ;; \e The escape character ('\u001B') |
104 | 117 | "\\e" regexp-escape |
| 118 | + "\\E" !regexp-escape |
105 | 119 | ;; \cx The control character corresponding to x |
106 | | - "\\cF" regexp-escape |
107 | 120 | ;; |
108 | 121 | ;; Character classes |
109 | 122 | ;; [abc] a, b, or c (simple class) |
|
0 commit comments