21 val malformed: symbol |
21 val malformed: symbol |
22 val end_malformed: symbol |
22 val end_malformed: symbol |
23 val is_regular: symbol -> bool |
23 val is_regular: symbol -> bool |
24 val is_ascii: symbol -> bool |
24 val is_ascii: symbol -> bool |
25 val is_ascii_letter: symbol -> bool |
25 val is_ascii_letter: symbol -> bool |
26 val is_hex_letter: symbol -> bool |
|
27 val is_ascii_digit: symbol -> bool |
26 val is_ascii_digit: symbol -> bool |
|
27 val is_ascii_hex: symbol -> bool |
28 val is_ascii_quasi: symbol -> bool |
28 val is_ascii_quasi: symbol -> bool |
29 val is_ascii_blank: symbol -> bool |
29 val is_ascii_blank: symbol -> bool |
30 val is_ascii_lower: symbol -> bool |
30 val is_ascii_lower: symbol -> bool |
31 val is_ascii_upper: symbol -> bool |
31 val is_ascii_upper: symbol -> bool |
32 val to_ascii_lower: symbol -> symbol |
32 val to_ascii_lower: symbol -> symbol |
125 fun is_ascii_letter s = |
125 fun is_ascii_letter s = |
126 is_char s andalso |
126 is_char s andalso |
127 (ord "A" <= ord s andalso ord s <= ord "Z" orelse |
127 (ord "A" <= ord s andalso ord s <= ord "Z" orelse |
128 ord "a" <= ord s andalso ord s <= ord "z"); |
128 ord "a" <= ord s andalso ord s <= ord "z"); |
129 |
129 |
130 fun is_hex_letter s = |
|
131 is_char s andalso |
|
132 (ord "A" <= ord s andalso ord s <= ord "F" orelse |
|
133 ord "a" <= ord s andalso ord s <= ord "f"); |
|
134 |
|
135 fun is_ascii_digit s = |
130 fun is_ascii_digit s = |
136 is_char s andalso ord "0" <= ord s andalso ord s <= ord "9"; |
131 is_char s andalso ord "0" <= ord s andalso ord s <= ord "9"; |
|
132 |
|
133 fun is_ascii_hex s = |
|
134 is_char s andalso |
|
135 (ord "0" <= ord s andalso ord s <= ord "9" orelse |
|
136 ord "A" <= ord s andalso ord s <= ord "F" orelse |
|
137 ord "a" <= ord s andalso ord s <= ord "f"); |
137 |
138 |
138 fun is_ascii_quasi "_" = true |
139 fun is_ascii_quasi "_" = true |
139 | is_ascii_quasi "'" = true |
140 | is_ascii_quasi "'" = true |
140 | is_ascii_quasi _ = false; |
141 | is_ascii_quasi _ = false; |
141 |
142 |
142 val is_ascii_blank = |
143 val is_ascii_blank = |
143 fn " " => true | "\t" => true | "\n" => true | "\^L" => true | "\^M" => true |
144 fn " " => true | "\t" => true | "\n" => true | "\^K" => true | "\^L" => true | "\^M" => true |
144 | _ => false; |
145 | _ => false; |
145 |
146 |
146 fun is_ascii_lower s = is_char s andalso (ord "a" <= ord s andalso ord s <= ord "z"); |
147 fun is_ascii_lower s = is_char s andalso (ord "a" <= ord s andalso ord s <= ord "z"); |
147 fun is_ascii_upper s = is_char s andalso (ord "A" <= ord s andalso ord s <= ord "Z"); |
148 fun is_ascii_upper s = is_char s andalso (ord "A" <= ord s andalso ord s <= ord "Z"); |
148 |
149 |