Commit 0ac29ef 1 parent b9e6a57 commit 0ac29ef Copy full SHA for 0ac29ef
File tree 3 files changed +51
-1
lines changed
3 files changed +51
-1
lines changed Original file line number Diff line number Diff line change 1632
1632
let prevNodeIsNewline = false
1633
1633
let lineOfLastCommentRecording = - 1
1634
1634
let insidePrefixList = false
1635
+ let prefixListParenNestingDepth = - 1
1635
1636
let prefixListPrefix = null
1636
1637
let prefixListLineNo = - 1
1637
1638
const prefixListComments = { }
1784
1785
if ( insideRequireForm && requireSymbolIdx > 0 ) {
1785
1786
requireSymbolIdx = - 1
1786
1787
}
1787
- if ( insideRequireForm && insidePrefixList ) {
1788
+
1789
+ if ( insideRequireForm && insidePrefixList && prefixListParenNestingDepth !== - 1 && parenNestingDepth === dec ( prefixListParenNestingDepth ) ) {
1788
1790
insidePrefixList = false
1789
1791
prefixListPrefix = null
1792
+ prefixListParenNestingDepth = - 1
1790
1793
}
1794
+
1791
1795
if ( insideReaderConditional && parenNestingDepth === dec ( readerConditionalParenNestingDepth ) ) {
1792
1796
insideReaderConditional = false
1793
1797
currentReaderConditionalPlatform = null
2319
2323
if ( isPrefixList ) {
2320
2324
const prefixListId = createId ( )
2321
2325
insidePrefixList = true
2326
+ prefixListParenNestingDepth = parenNestingDepth
2322
2327
prefixListLineNo = lineNo
2323
2328
prefixListPrefix = node . text
2324
2329
currentPrefixListId = prefixListId
Original file line number Diff line number Diff line change 1985
1985
(:require
1986
1986
[garden.selectors :refer [&] :rename {& parent}]))
1987
1987
--Expected
1988
+
1989
+ # GitHub Issue #191 - expand nested prefix lists
1990
+
1991
+ --Input
1992
+ (ns com.example.my-app
1993
+ (:require
1994
+ [com.example.my-app.foo
1995
+ [bar :as bar :refer [fred]] ;; a comment
1996
+ [baz :refer [qux] :as plugh]])) ;; another comment
1997
+ --Input
1998
+
1999
+ --Expected
2000
+ (ns com.example.my-app
2001
+ (:require
2002
+ [com.example.my-app.foo.bar :as bar :refer [fred]] ;; a comment
2003
+ [com.example.my-app.foo.baz :as plugh :refer [qux]])) ;; another comment
2004
+ --Expected
Original file line number Diff line number Diff line change 3232
3232
]
3233
3233
}
3234
3234
--Expected
3235
+
3236
+ # GitHub Issue #191 - expand nested prefix lists
3237
+
3238
+ --Input
3239
+ (ns com.example.my-app
3240
+ (:require
3241
+ [com.example.my-app.foo
3242
+ [bar :as bar]
3243
+ [baz :refer [qux]]]))
3244
+ --Input
3245
+
3246
+ --Expected
3247
+ {
3248
+ "nsSymbol": "com.example.my-app",
3249
+ "requires": [
3250
+ {
3251
+ "symbol": "com.example.my-app.foo.bar",
3252
+ "as": "bar"
3253
+ },
3254
+ {
3255
+ "symbol": "com.example.my-app.foo.baz",
3256
+ "refer": [
3257
+ {"symbol": "qux"}
3258
+ ]
3259
+ }
3260
+ ]
3261
+ }
3262
+ --Expected
You can’t perform that action at this time.
0 commit comments