Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Trying to trace down parse error involving #hash.

  • Loading branch information...
commit b7cea1186938b71d75b54f9c7f29bc9cad171dea 1 parent df57c00
Danny Yoo authored
2  diva-link.ss
@@ -185,7 +185,7 @@
2  dot-processing.ss
@@ -14,6 +14,7 @@
14 14 (with-handlers
15 15 ([(lambda args #t)
16 16 (lambda (exn)
  17 + (printf "~s~n" exn)
17 18 (raise
18 19 (make-voice-exn
19 20 (format "The parenthesis of the definitions text are not correctly balanced: ~a"
@@ -28,6 +29,7 @@
28 29 (with-handlers
29 30 ([(lambda args #t)
30 31 (lambda (exn)
  32 + (printf "~s~n" exn)
31 33 (raise
32 34 (make-voice-exn
33 35 (format "The parenthesis of the definitions text are not correctly balanced: ~a"
34 semi-read-syntax/semi-read-syntax.ss
@@ -130,6 +130,27 @@
130 130 (define token (position-token-token pos-token))
131 131 (define type (token-name token))
132 132 (define val (token-value token))]
  133 +
  134 + ;; Does weird prefix kluding
  135 + (define (do-weird-prefix-kludge)
  136 + (define (add-padding! padding-char len)
  137 + (hash-table-put!
  138 + ht (position-offset (position-token-start-pos pos-token)) val)
  139 + (display (make-string len padding-char)
  140 + to-op)
  141 + (when (> (string-length val) len)
  142 + (display (substring val len) to-op)))
  143 +
  144 + (cond [(or (string-prefix? "#;" val)
  145 + (string-prefix? "#s" val))
  146 + (add-padding! #\' 2)]
  147 + [(string-prefix? "#hasheq" val)
  148 + (add-padding! #\X 7)]
  149 + [(string-prefix? "#hash" val)
  150 + (add-padding! #\X 5)]
  151 + [else
  152 + (display val to-op)]))
  153 +
133 154 (cond
134 155 [(eq? type 'end)
135 156 (close-output-port to-op)]
@@ -171,18 +192,7 @@
171 192 (display "X" to-op)]
172 193
173 194 [(prefix quoter-prefix)
174   - (cond
175   - [(or (string-prefix? "#;" val) (string-prefix? "#s" val))
176   - (hash-table-put! ht (position-offset (position-token-start-pos pos-token)) val)
177   - (display "''" to-op)
178   - ;; The condition below is redundant,
179   - ;; but a workaround a bug in the ports produced by
180   - ;; make-pipe-with-specials: it can't accept
181   - ;; empty strings.
182   - (when (> (string-length val) 2)
183   - (display (substring val 2) to-op))]
184   - [else
185   - (display val to-op)])]
  195 + (do-weird-prefix-kludge)]
186 196
187 197 [(suffix)
188 198 (display val to-op)])
1  utilities.ss
@@ -436,6 +436,7 @@
436 436 (with-handlers
437 437 ([(lambda args true)
438 438 (lambda (exn)
  439 + (printf "~s~n" exn)
439 440 (raise (make-voice-exn "The parenthesis of the definitions text are not correctly balanced.")))])
440 441 (let loop ([stx (read-scheme-tree)])
441 442 (if (eof-object? stx)

0 comments on commit b7cea11

Please sign in to comment.
Something went wrong with that request. Please try again.