Permalink
Browse files

Ast-symbol is symbol.

  • Loading branch information...
1 parent ee01cfc commit b7aceb75583bbc81c56b1e5b2306d93067ed6bf2 @tcrayford tcrayford committed Sep 11, 2010
@@ -26,7 +26,7 @@
"Creates an ast representing the new function"
(format-ast
(ast/list-without-whitespace
- (ast/ast-symbol 'defn)
+ (ast/symbol 'defn)
name
(ast/parsley-vector args)
(ast/strip-whitespace body))))
@@ -1,6 +1,6 @@
(ns clojure-refactoring.local-binding
(:use clojure.walk
- [clojure-refactoring.support core parsley formatter]
+ [clojure-refactoring.support core formatter]
[clojure.contrib.seq-utils :only (find-first)]
[clojure-refactoring.support.parsley :only [defparsed-fn]])
(:require [clojure-refactoring.support.parsley :as ast]))
@@ -34,7 +34,7 @@
(if (ast/parsley-binding-node? form)
(modify-existing-let-block form value var-name)
(ast/list-without-whitespace
- (ast/ast-symbol 'let)
+ (ast/symbol 'let)
ast/parsley-whitespace
(ast/parsley-vector
[var-name value])
@@ -6,12 +6,14 @@
[clojure.contrib.def :only [defonce-]]
[clojure.contrib.seq-utils :only [find-first]]
[clojure.contrib.str-utils :only [str-join]])
+ (:refer-clojure :exclude [symbol])
+ (:require [clojure.core :as core])
(:require [clojure-refactoring.support.parser :as parser]))
(defn make-node [tag content]
{:tag tag :content content})
-(defn ast-symbol [sym]
+(defn symbol [sym]
(make-node :atom (list (name sym))))
(def parsley-empty-map (make-node :map (list "{" "}")))
@@ -75,7 +77,7 @@
ast))
(defn replace-symbol-in-ast-node [old new ast]
- (parsley-tree-replace (ast-symbol old) (ast-symbol new) ast))
+ (parsley-tree-replace (symbol old) (symbol new) ast))
(defn- parsley-get-first-node [ast]
(if (map? ast) ast (first ast)))
@@ -174,7 +176,7 @@
(def parsley-binding-node?
(all-of? map?
(tag= :list)
- (comp binding-forms symbol
+ (comp binding-forms core/symbol
#(apply str %) :content second :content)))
(defn- expand-args-with-parse1 [args]
@@ -64,7 +64,7 @@ based on what type of threading is going to be"
(defn thread-ast [thread-type ast]
(apply ast/list-without-whitespace
- `(~(ast/ast-symbol thread-type)
+ `(~(ast/symbol thread-type)
~@(->> (thread-with-type thread-type ast)
ast/relevant-content))))

0 comments on commit b7aceb7

Please sign in to comment.