summaryrefslogtreecommitdiff
path: root/common.sml
diff options
context:
space:
mode:
authorVladimir Azarov <avm@intermediate-node.net>2025-08-04 15:12:55 +0200
committerVladimir Azarov <avm@intermediate-node.net>2025-08-04 15:12:55 +0200
commit396ebf0c76153e5e1e9dc77371bdd02b4d3d85d1 (patch)
tree3c2aab25631581d5367a6288c2eb9e0f812d76b0 /common.sml
parent671760c2b5857312cac178f24cad8686c1d4b719 (diff)
Flattening of initializers
Diffstat (limited to 'common.sml')
-rw-r--r--common.sml4
1 files changed, 2 insertions, 2 deletions
diff --git a/common.sml b/common.sml
index 4bde818..72efe93 100644
--- a/common.sml
+++ b/common.sml
@@ -169,14 +169,14 @@ fun poptN z = poptInternal false z
val Popt = fn z => bind A2 (poptInternal false "") z
val PoptS = fn z => bind A2 (poptInternal true "") z
-fun plist p l (s, parens) out =
+fun plist p l (s, parens, from) out =
let
fun f [] _ = ()
| f [e] out = Printf out A1 p e %
| f (e1 :: e2 :: tail) out =
(Printf out A1 p e1 %; Printf out `s A1 f (e2 :: tail) %)
in
- if parens andalso length l > 1 then
+ if parens andalso length l >= from then
Printf out `"(" A1 f l `")" %
else
Printf out A1 f l %