1
0
forked from GitHub/gf-core

new Prelude functions for optional commas

This commit is contained in:
aarne
2014-05-23 13:16:57 +00:00
parent f658ed7f9c
commit 81c59721b2

View File

@@ -115,8 +115,12 @@ oper
-- Embed between commas, where the latter one disappears in front of other punctuation
embedInCommas : Str -> Str = \s -> SOFT_BIND ++ "," ++ s ++ endComma ;
endComma : Str = pre {"," | "." => []; "" => SOFT_BIND ++ ","; _ => []} ;
embedInCommas : Str -> Str = \s -> bindComma ++ s ++ endComma ;
endComma : Str = pre {"," | "." => []; "" => bindComma ; _ => []} ;
bindComma : Str = SOFT_BIND ++ "," ;
optComma : Str = bindComma | [] ;
optCommaSS : SS -> SS = \s -> ss (s.s ++ optComma) ;
--2 Miscellaneous