Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

single char literal for space: '\ ' get munched as whitespace apparently #97

Closed
Gnurdle opened this issue Sep 21, 2024 · 2 comments
Closed
Labels
bug Something isn't working parser related to the parsing code v1 blocker Required for a v1.0.0 release

Comments

@Gnurdle
Copy link

Gnurdle commented Sep 21, 2024

(defn repair-gunky-numeric
  "fixes garbage like '- 9.0' etc "
  ([value]
   (repair-gunky-numeric value 0))
  ([value fallback]
   (cond
     (number? value) value
     (nil? value) fallback
     :else (let [cleaned (->> value name (filter #(not= % \ )) (apply str))
                 got (.parseFloat js/Number cleaned)
                 failed? (.isNaN js/Number got)]
             (if failed? fallback got)))))
             
=== 
(defn repair-gunky-numeric
  "fixes garbage like '- 9.0' etc "
  ([value]
   (repair-gunky-numeric value 0))
  ([value fallback]
   (cond
     (number? value) value
     (nil? value) fallback
     :else (let [cleaned (->> value name (filter #(not= % \)) (apply str))
                 got (.parseFloat js/Number cleaned)
                 failed? (.isNaN js/Number got)]
             (if failed? fallback got)))))

observe decimation near 'not='

@oakmac oakmac added bug Something isn't working v1 blocker Required for a v1.0.0 release parser related to the parsing code labels Sep 22, 2024
@oakmac
Copy link
Owner

oakmac commented Sep 22, 2024

Thank you for the bug report! Fixed with PR-98

This is also likely a bug with the parser in Clojure Sublimed.

@oakmac
Copy link
Owner

oakmac commented Sep 22, 2024

This is also likely a bug with the parser in Clojure Sublimed

reference Clojure-Sublimed PR-122

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working parser related to the parsing code v1 blocker Required for a v1.0.0 release
Projects
None yet
Development

No branches or pull requests

2 participants