Skip to content

Commit

Permalink
Revert "CLJ-1252 - fix bug in keyword regex that allowed keywords sta…
Browse files Browse the repository at this point in the history
…rting with a number"

This reverts commit 39aa021.
  • Loading branch information
stuarthalloway committed Oct 31, 2013
1 parent 9257ef6 commit 249479e
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/EdnReader.java
Expand Up @@ -24,7 +24,7 @@ public class EdnReader{

static IFn[] macros = new IFn[256];
static IFn[] dispatchMacros = new IFn[256];
static Pattern symbolPat = Pattern.compile("[:]?+([\\D&&[^/]].*/)?([\\D&&[^/]][^/]*)");
static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^/]].*/)?([\\D&&[^/]][^/]*)");
static Pattern intPat =
Pattern.compile(
"([-+]?)(?:(0)|([1-9][0-9]*)|0[xX]([0-9A-Fa-f]+)|0([0-7]+)|([1-9][0-9]?)[rR]([0-9A-Za-z]+)|0[0-9]+)(N)?");
Expand Down
2 changes: 1 addition & 1 deletion src/jvm/clojure/lang/LispReader.java
Expand Up @@ -59,7 +59,7 @@ public class LispReader{
static IFn[] macros = new IFn[256];
static IFn[] dispatchMacros = new IFn[256];
//static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^:/]][^:/]*/)?[\\D&&[^:/]][^:/]*");
static Pattern symbolPat = Pattern.compile("[:]?+([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)");
static Pattern symbolPat = Pattern.compile("[:]?([\\D&&[^/]].*/)?(/|[\\D&&[^/]][^/]*)");
//static Pattern varPat = Pattern.compile("([\\D&&[^:\\.]][^:\\.]*):([\\D&&[^:\\.]][^:\\.]*)");
//static Pattern intPat = Pattern.compile("[-+]?[0-9]+\\.?");
static Pattern intPat =
Expand Down
6 changes: 3 additions & 3 deletions test/clojure/test_clojure/control.clj
Expand Up @@ -324,7 +324,7 @@
:set #{3 2 1}
:set (sorted-set 2 1 3))))
(testing "test number equivalence"
(is (= :one (case 1N 1 :one :else))))
(is (= :1 (case 1N 1 :1 :else))))
(testing "test warn when boxing/hashing expr for all-ints case"
(should-print-err-message
#"Performance warning, .*:\d+ - case has int tests, but tested expression is not primitive..*\r?\n"
Expand All @@ -348,10 +348,10 @@
(should-not-reflect (Long. (case 1 1 1))) ; new Long(long)
(should-not-reflect (Long. (case 1 1 "1")))) ; new Long(String)
(testing "non-equivalence of chars and nums"
(are [result input] (= result (case input 97 :got97 :else))
(are [result input] (= result (case input 97 :97 :else))
:else \a
:else (char \a)
:got97 (int \a))
:97 (int \a))
(are [result input] (= result (case input \a :a :else))
:else 97
:else 97N
Expand Down
4 changes: 1 addition & 3 deletions test/clojure/test_clojure/reader.clj
Expand Up @@ -353,9 +353,7 @@
(are [err msg form] (thrown-with-msg? err msg (read-string form))
Exception #"Invalid token: foo:" "foo:"
Exception #"Invalid token: :bar/" ":bar/"
Exception #"Invalid token: ::does.not/exist" "::does.not/exist"
Exception #"Invalid token: :5" ":5"))

Exception #"Invalid token: ::does.not/exist" "::does.not/exist"))
;; Lists

(deftest t-Lists)
Expand Down

0 comments on commit 249479e

Please sign in to comment.