|
41 | 41 | %% Used in tokenization and interpolation
|
42 | 42 |
|
43 | 43 | %% Numbers
|
44 |
| --define(is_hex(S), ?is_digit(S) orelse (S >= $A andalso S =< $F) orelse (S >= $a andalso S =< $f)). |
45 |
| --define(is_bin(S), S >= $0 andalso S =< $1). |
46 |
| --define(is_octal(S), S >= $0 andalso S =< $7). |
47 |
| --define(is_leading_octal(S), S >= $0 andalso S =< $3). |
| 44 | +-define(is_hex(S), (?is_digit(S) orelse (S >= $A andalso S =< $F) orelse (S >= $a andalso S =< $f))). |
| 45 | +-define(is_bin(S), (S >= $0 andalso S =< $1)). |
| 46 | +-define(is_octal(S), (S >= $0 andalso S =< $7)). |
| 47 | +-define(is_leading_octal(S), (S >= $0 andalso S =< $3)). |
48 | 48 |
|
49 | 49 | %% Digits and letters
|
50 |
| --define(is_digit(S), S >= $0 andalso S =< $9). |
51 |
| --define(is_upcase(S), S >= $A andalso S =< $Z). |
52 |
| --define(is_downcase(S), S >= $a andalso S =< $z). |
| 50 | +-define(is_digit(S), (S >= $0 andalso S =< $9)). |
| 51 | +-define(is_upcase(S), (S >= $A andalso S =< $Z)). |
| 52 | +-define(is_downcase(S), (S >= $a andalso S =< $z)). |
53 | 53 |
|
54 | 54 | %% Atoms
|
55 |
| --define(is_atom_start(S), ?is_quote(S) orelse ?is_upcase(S) orelse ?is_downcase(S) orelse (S == $_)). |
56 |
| --define(is_atom(S), ?is_identifier(S) orelse (S == $@)). |
| 55 | +-define(is_atom_start(S), (?is_quote(S) orelse ?is_upcase(S) orelse ?is_downcase(S) orelse (S == $_))). |
| 56 | +-define(is_atom(S), (?is_identifier(S) orelse (S == $@))). |
57 | 57 |
|
58 |
| --define(is_identifier(S), ?is_digit(S) orelse ?is_upcase(S) orelse ?is_downcase(S) orelse (S == $_)). |
59 |
| --define(is_sigil(S), (S == $/) orelse (S == $<) orelse (S == $") orelse (S == $') orelse |
60 |
| - (S == $[) orelse (S == $() orelse (S == ${) orelse (S == $|)). |
| 58 | +-define(is_identifier(S), (?is_digit(S) orelse ?is_upcase(S) orelse ?is_downcase(S) orelse (S == $_))). |
| 59 | +-define(is_sigil(S), ((S == $/) orelse (S == $<) orelse (S == $") orelse (S == $') orelse |
| 60 | + (S == $[) orelse (S == $() orelse (S == ${) orelse (S == $|))). |
61 | 61 |
|
62 | 62 | %% Quotes
|
63 |
| --define(is_quote(S), S == $" orelse S == $'). |
| 63 | +-define(is_quote(S), (S == $" orelse S == $')). |
64 | 64 |
|
65 | 65 | %% Spaces
|
66 |
| --define(is_horizontal_space(S), (S == $\s) orelse (S == $\t)). |
67 |
| --define(is_vertical_space(S), (S == $\r) orelse (S == $\n)). |
68 |
| --define(is_space(S), ?is_horizontal_space(S) orelse ?is_vertical_space(S)). |
69 |
| --define(is_invalid_space(S), S == 16#A0). |
| 66 | +-define(is_horizontal_space(S), ((S == $\s) orelse (S == $\t))). |
| 67 | +-define(is_vertical_space(S), ((S == $\r) orelse (S == $\n))). |
| 68 | +-define(is_space(S), (?is_horizontal_space(S) orelse ?is_vertical_space(S))). |
| 69 | +-define(is_invalid_space(S), (S == 16#A0)). |
0 commit comments