Skip to content

Commit f1f7ee4

Browse files
committed
Remove '/' from identifier chars -- '/' only counts as a valid
identifier when the name is literally '/' and nothing else. This will be added
1 parent 50ad2cf commit f1f7ee4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/reader.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fn cons_str(head: char, tail: &str) -> String {
8282
/// - `*`,
8383
/// - `!`,
8484
fn is_identifier_char(chr: char) -> bool {
85-
chr.is_alphanumeric() || "|?<>+-_=^%&$*!/".contains(chr)
85+
chr.is_alphanumeric() || "|?<>+-_=^%&$*!".contains(chr)
8686
}
8787

8888
/// Returns whether if a character can be in the head of an identifier.
@@ -127,16 +127,16 @@ pub fn identifier_parser(input: &str) -> IResult<&str, String> {
127127
);
128128

129129
named!(identifier_tail<&str, &str>, take_while!(is_identifier_char));
130-
131-
named!(identifier_ <&str, String>,
130+
131+
named!(identifier <&str, String>,
132132
do_parse!(
133133
head: identifier_head >>
134134
rest_input: identifier_tail >>
135135
(cons_str(head, rest_input))
136136
)
137137
);
138138

139-
identifier_(input)
139+
identifier(input)
140140
}
141141

142142
/// Parses valid Clojure symbols, whose name is a valid identifier

0 commit comments

Comments
 (0)