Skip to content

Instantly share code, notes, and snippets.

@JeffBezanson
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffBezanson/dd8e1e1a77df1373f9f5 to your computer and use it in GitHub Desktop.
Save JeffBezanson/dd8e1e1a77df1373f9f5 to your computer and use it in GitHub Desktop.
escaped symbols patch
diff --git a/src/julia-parser.scm b/src/julia-parser.scm
index 549b02f..8949495 100644
--- a/src/julia-parser.scm
+++ b/src/julia-parser.scm
@@ -1677,9 +1677,14 @@
;; symbol/expression quote
((eq? t ':)
(take-token s)
- (if (closing-token? (peek-token s))
- ':
- (list 'quote (parse-atom- s))))
+ (if (eqv? (peek-char (ts:port s)) #\")
+ ;; escaped symbol
+ (begin (read-char (ts:port s))
+ (let ((str (cadr (parse-string-literal- '_ 0 (ts:port s) s #t))))
+ (symbol str)))
+ (if (closing-token? (peek-token s))
+ ':
+ (list 'quote (parse-atom- s)))))
;; misplaced =
((eq? t '=) (error "unexpected \"=\""))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment