Skip to content

Commit

Permalink
allow \minus in floating point exponents #26193
Browse files Browse the repository at this point in the history
  • Loading branch information
epithet committed May 27, 2021
1 parent ed17163 commit d96cd8e
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/julia-parser.scm
Original file line number Diff line number Diff line change
Expand Up @@ -377,13 +377,17 @@
(and (eq? pred char-hex?) ispP)
(memv c '(#\e #\E #\f)))
(begin (read-char port)
(let ((d (peek-char port)))
(let* ((d (peek-char port))
(is-minus-sign (or (eqv? d #\-) (eqv? d #\u2212))))
(if (and (not (eof-object? d))
(or (char-numeric? d) (eqv? d #\+) (eqv? d #\-)))
(or (char-numeric? d) (eqv? d #\+) is-minus-sign))
(begin (set! is-float32-literal (eqv? c #\f))
(set! is-hex-float-literal ispP)
(write-char c str)
(write-char (read-char port) str)
(if is-minus-sign
(begin (read-char port)
(write-char #\- str))
(write-char (read-char port) str))
(read-digs #t #f)
(disallow-dot))
(io.ungetc port c)))))
Expand Down

0 comments on commit d96cd8e

Please sign in to comment.