Ignore:
Timestamp:
06/09/17 08:50:52 (6 years ago)
Author:
Mark Evenson
Message:

Refactor JAVAPARSER dependencies out of JSS

JAVAPARSER needs ABCL-ASDF to load its Maven artifact, but ABCL-ASDF
needs JSS. Therefore we refactor these dependencies into the ASDF
infrastructure rather than dealing with CL:REQUIRE, which isn't going
to work anyways unless there is another mechanism to load Maven
artifacts.

The JAVAPARSER system is not working due to dependency on the missing
symbols CL-USER::REPLACE-ALL and CL-USER::TREE-REPLACE, but that was
the case before this patch as Alan mistakenly didn't include it in his
submitted patch series.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/jss/javaparser.lisp

    r15062 r15065  
    6363    symbol))
    6464
     65(eval-when (:compile-toplevel :load-toplevel :execute)
     66  (defun read-invoke/javaparser (stream char arg)
     67    (if (eql arg 1)
     68        (if (ignore-errors (jclass "com.github.javaparser.ParseStart")) ;; chosen randomly, TODO memoize
     69            (read-sharp-java-expression stream)
     70            ;; Deal with possiblity of not loading jar
     71            (error "Cannot load javaparser code needed for the #1 macro"))
     72  (progn
     73    (unread-char char stream)
     74    (let ((name (read stream)))
     75      (if (or (find #\. name) (find #\{ name))
     76    (jss-transform-to-field name)
     77    (let ((object-var (gensym))
     78          (args-var (gensym)))
     79      `(lambda (,object-var &rest ,args-var)
     80         (invoke-restargs ,name  ,object-var ,args-var ,(eql arg 0)))))))))
     81  (set-dispatch-macro-character #\# #\" 'read-invoke/javaparser))
    6582
    6683
Note: See TracChangeset for help on using the changeset viewer.