diff options
Diffstat (limited to 'snug-clean/src/Snug/Compile/ABI.icl')
-rw-r--r-- | snug-clean/src/Snug/Compile/ABI.icl | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/snug-clean/src/Snug/Compile/ABI.icl b/snug-clean/src/Snug/Compile/ABI.icl index 66a8d5c..225f09c 100644 --- a/snug-clean/src/Snug/Compile/ABI.icl +++ b/snug-clean/src/Snug/Compile/ABI.icl @@ -20,11 +20,15 @@ where e = case entry_point of NodeEntry -> 'n' +closureLabel :: !Namespace !SymbolIdent !Int -> Label +closureLabel ns id nargs = constructorLabel ns (concat3 id "@" (toString nargs)) + escapeLabel :: !String -> String escapeLabel s = {#c \\ c <- escape [c \\ c <-: s]} where escape [] = [] escape [c:cs] | isAlphanum c = [c:escape cs] + // Symbols allowed in snug but not in symbol names: escape ['_':cs] = ['__':escape cs] escape ['`':cs] = ['_B':escape cs] escape [':':cs] = ['_C':escape cs] @@ -36,3 +40,5 @@ where escape ['+':cs] = ['_P':escape cs] escape ['\'':cs] = ['_Q':escape cs] escape ['~':cs] = ['_T':escape cs] + // Symbols not allowed in snug but used internally: + escape ['@':cs] = ['_c':escape cs] // see closureLabel |