Permalink
Browse files

Merge pull request #43 from duelinmarkers/fix-dot-rule-when-member-is…

…-a-list

Handle list member-access in dot form. Fixes #33.
  • Loading branch information...
2 parents 66b318b + 2a899b4 commit dacbdd14f259c521026e56ab262968184fa68902 @jonase committed Jun 26, 2012
Showing with 6 additions and 1 deletion.
  1. +4 −1 src/kibit/rules/misc.clj
  2. +2 −0 test/kibit/test/misc.clj
View
@@ -56,7 +56,10 @@
(logic/== % (logic/llist '. obj method args))
(logic/pred obj (complement class-symbol?)))
#(logic/project [method args]
- (logic/== % `(~(symbol (str "." method)) ~obj ~@args)))])
+ (let [s? (seq? method)
+ args (if s? (rest method) args)
+ method (if s? (first method) method)]
+ (logic/== % `(~(symbol (str "." method)) ~obj ~@args))))])
(let [klass (logic/lvar)
static-method (logic/lvar)
View
@@ -19,7 +19,9 @@
'fun '(fn [args] (fun args))
'fun '(fn* [args] (fun args))
'(str x) '(.toString x)
+ '(.member obj) '(. obj member)
'(.method obj args) '(. obj method args)
+ '(.method obj args) '(. obj (method args))
'(Klass/staticMethod args) '(. Klass staticMethod args)
'(form arg) '(-> arg form)
'(:form arg) '(-> arg :form)

0 comments on commit dacbdd1

Please sign in to comment.