Skip to content

Commit

Permalink
WIP WIP WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
oakmac committed Oct 20, 2024
1 parent 943bc59 commit 4055d74
Show file tree
Hide file tree
Showing 3 changed files with 71 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/standard-clojure-style.js
Original file line number Diff line number Diff line change
Expand Up @@ -3144,6 +3144,10 @@
outTxt = strConcat(outTxt, ' ')
isImportKeywordPrinted = true
} else if (isFirstPlatform) {
if (!isImportKeywordPrinted) {
outTxt = strConcat(outTxt, '\n (:import')
isImportKeywordPrinted = true
}
outTxt = strConcat3(outTxt, '\n #?@(', platformStr)
outTxt = strConcat(outTxt, '\n [')
isFirstPlatform = false
Expand Down
3 changes: 2 additions & 1 deletion test/format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,10 @@ test('All test_format/ cases should have unique names', () => {

// dev convenience: set this to true and add specific test cases
// only those cases will run
const onlyRunSpecificTests = false
const onlyRunSpecificTests = true
const specificTests = new Set()
// specificTests.add('your test case here')
specificTests.add('portal.runtime.cson 1')

const ignoreSomeTests = true
const ignoreTests = new Set()
Expand Down
65 changes: 65 additions & 0 deletions test_format/ns.eno
Original file line number Diff line number Diff line change
Expand Up @@ -1590,3 +1590,68 @@
#?(:clj (def ^:dynamic *unchecked-if* false))
#?(:clj (def ^:dynamic *unchecked-arrays* false))
--Expected

# portal.runtime.cson 1

--Input
(ns ^:no-doc portal.runtime.cson
"Clojure/Script Object Notation"
(:refer-clojure :exclude [read])
#?(:clj (:require [portal.runtime.json-buffer :as json])
:cljr (:require [portal.runtime.json-buffer :as json])
:joyride
(:require
[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m])
:org.babashka/nbb
(:require
[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m])
:cljs
(:require
[goog.crypt.base64 :as Base64]
[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m]))
#?(:clj (:import [java.net URL]
[java.util Base64 Date UUID])
:joyride (:import)
:org.babashka/nbb (:import)
:cljs (:import [goog.math Long])))

(defprotocol ToJson (-to-json [value buffer]))
--Input

--Expected
(ns portal.runtime.cson
"Clojure/Script Object Notation"
{:no-doc true}
(:refer-clojure :exclude [read])
(:require
#?@(:clj
[[portal.runtime.json-buffer :as json]]

:cljr
[[portal.runtime.json-buffer :as json]]

:cljs
[[goog.crypt.base64 :as Base64]
[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m]]

:joyride
[[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m]]

:org.babashka/nbb
[[portal.runtime.json-buffer :as json]
[portal.runtime.macros :as m]]))
(:import
#?@(:clj
[(java.net URL)
(java.util Base64 Date UUID)]

:cljs
[(goog.math Long)])))

(defprotocol ToJson (-to-json [value buffer]))
--Expected

0 comments on commit 4055d74

Please sign in to comment.