Category talk:Wren-pattern: Difference between revisions

Content added Content deleted
m (→‎Source code: Typos and other minor errors.)
(Adjustments to now recognize 'µ' as an extended lower case letter.)
Line 82: Line 82:
class name contents
class name contents


a alphabetic a-z A-z and codes: 192-214, 216-223, 224-246 and 248-255.
a alphabetic a-z A-z and codes: 181, 192-214, 216-222, 223-246 and 248-255.
c control \x00-\x1f, \x7f and \x80-\x9f (codes 0-31, 127 and 128-159)
c control \x00-\x1f, \x7f and \x80-\x9f (codes 0-31, 127 and 128-159)
g graphic all printable except space and non-breaking space (codes 33-126 and 161-255)
g graphic all printable except space and non-breaking space (codes 33-126 and 161-255)
l lower case a-z and codes: 223-246, 248-255
l lower case a-z and codes: 181, 223-246, 248-255
m m class as class l plus 0-9
m m class as class l plus 0-9
n n class +-± (sign plus code 177)
n n class +-± (sign plus code 177)
Line 302: Line 302:
// extended classes
// extended classes
__fns2 = [
__fns2 = [
Fn.new { |c| __fns2[11].call(c) || __fns2[20].call(c) }, // a
Fn.new { |c| __fns2[11].call(c) || __fns2[20].call(c) }, // a
Fn.new { |c| c == 48 || c == 49 }, // b
Fn.new { |c| c == 48 || c == 49 }, // b
Fn.new { |c| c < 32 || (c >= 127 && c < 160) }, // c
Fn.new { |c| c < 32 || (c >= 127 && c < 160) }, // c
Fn.new { |c| c >= 48 && c <= 57 }, // d
Fn.new { |c| c >= 48 && c <= 57 }, // d
Fn.new { |c| (c >= 48 && c <= 57) || ".+-Ee".codePoints.contains(c) }, // e
Fn.new { |c| (c >= 48 && c <= 57) || ".+-Ee".codePoints.contains(c) }, // e
Fn.new { |c| (c >= 48 && c <= 57) || c == 46 }, // f
Fn.new { |c| (c >= 48 && c <= 57) || c == 46 }, // f
Fn.new { |c| (c >= 33 && c < 127) || (c >= 161 && c <= 255) }, // g
Fn.new { |c| (c >= 33 && c < 127) || (c >= 161 && c <= 255) }, // g
Fn.new { |c| (c >= 48 && c <= 57) || (c >= 65 && c <= 70) || (c >= 97 && c <= 102) }, // h
Fn.new { |c| (c >= 48 && c <= 57) || (c >= 65 && c <= 70) || (c >= 97 && c <= 102) }, // h
Fn.new { |c, p| p.i.codePoints.contains(c) }, // i
Fn.new { |c, p| p.i.codePoints.contains(c) }, // i
Fn.new { |c, p| p.j.codePoints.contains(c) }, // j
Fn.new { |c, p| p.j.codePoints.contains(c) }, // j
Fn.new { |c, p| p.k.codePoints.contains(c) }, // k
Fn.new { |c, p| p.k.codePoints.contains(c) }, // k
Fn.new { |c| (c >= 97 && c <= 122) || (c >= 223 && c <= 255 && c != 247) }, // l
Fn.new { |c| (c >= 97 && c <= 122) || c == 181 || (c >= 223 && c <= 255 && c != 247) }, // l
Fn.new { |c| __fns2[11].call(c) || (c >= 48 && c <= 57) }, // m
Fn.new { |c| __fns2[11].call(c) || (c >= 48 && c <= 57) }, // m
Fn.new { |c| c == 43 || c == 45 || c == 177 }, // n
Fn.new { |c| c == 43 || c == 45 || c == 177 }, // n
Fn.new { |c| c >= 48 && c <= 55 }, // o
Fn.new { |c| c >= 48 && c <= 55 }, // o
Fn.new { |c| __fns2[6].call(c) && !__fns2[22].call(c) }, // p
Fn.new { |c| __fns2[6].call(c) && !__fns2[22].call(c) }, // p
Fn.new { |c| c == 34 || c == 39 || c == 96 || c == 171 || c == 187 }, // q
Fn.new { |c| c == 34 || c == 39 || c == 96 || c == 171 || c == 187 }, // q
Fn.new { |c| c < 256 }, // r
Fn.new { |c| c < 256 }, // r
Fn.new { |c| c == 32 || (c >= 9 && c <= 13) || c == 160 }, // s
Fn.new { |c| c == 32 || (c >= 9 && c <= 13) || c == 160 }, // s
Fn.new { |c| __fns2[15].call || __fns2[18].call }, // t
Fn.new { |c| __fns2[15].call || __fns2[18].call }, // t
Fn.new { |c| (c >= 65 && c <= 90) || (c >= 192 && c <= 222 && c != 215) }, // u
Fn.new { |c| (c >= 65 && c <= 90) || (c >= 192 && c <= 222 && c != 215) }, // u
Fn.new { |c| __fns2[20].call(c) || (c >= 48 && c <= 57) }, // v
Fn.new { |c| __fns2[20].call(c) || (c >= 48 && c <= 57) }, // v
Fn.new { |c| (c >= 48 && c <= 57) || __fns2[0].call(c) }, // w
Fn.new { |c| (c >= 48 && c <= 57) || __fns2[0].call(c) }, // w
Fn.new { |c| __fns2[22].call(c) || c == 95 }, // x
Fn.new { |c| __fns2[22].call(c) || c == 95 }, // x
Fn.new { |c| __fns2[22].call(c) || c == 95 || c == 39 || c == 45 || c == 173 }, // y
Fn.new { |c| __fns2[22].call(c) || c == 95 || c == 39 || c == 45 || c == 173 }, // y
Fn.new { |c| true } // z
Fn.new { |c| true } // z
]
]


Line 398: Line 398:
tokens.add(d)
tokens.add(d)
tokens.add(d + 32)
tokens.add(d + 32)
} else if (__fns2[11].call(d) && d != 223 && d != 255) {
} else if (__fns2[11].call(d) && d != 181 && d != 223 && d != 255) {
tokens.add(-c)
tokens.add(-c)
tokens.add(d)
tokens.add(d)
tokens.add(d - 32)
tokens.add(d - 32)
} else {
} else {
tokens.add(d)
tokens.add(d)