Make String.aes a stdlib + add more string functions

This means moving the FATE operations to StringInternal and adding to/from_list (and Char.to/from_int
+ Char.to_upper/lower).
This commit is contained in:
Hans Svensson
2020-02-21 09:45:11 +01:00
parent 6682b24156
commit b9acf24dca
12 changed files with 151 additions and 18 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
include "String.aes"
contract BytesToX =
entrypoint to_int(b : bytes(42)) : int = Bytes.to_int(b)
+1 -1
View File
@@ -1,4 +1,4 @@
include "String.aes"
contract FunctionArguments =
entrypoint sum(n : int, m: int) =
+14
View File
@@ -0,0 +1,14 @@
include "String.aes"
contract StringX =
entrypoint test() =
let s1 = "a string"
let s2 = "another string"
let s = String.concat(s1, s2)
String.sha256(s)
String.length(s1)
String.from_list(String.to_list(s))
String.split(4, s1)
String.at(2, s2)
String.tokens(s, ",")
String.to_upper(s1)
String.to_lower(s2)
+1
View File
@@ -1,3 +1,4 @@
include "String.aes"
contract Remote =
record rstate = { i : int, s : string, m : map(int, int) }
+1
View File
@@ -1,3 +1,4 @@
include "String.aes"
contract Strings =
entrypoint str_len(s) = String.length(s)
entrypoint str_concat(s1, s2) = String.concat(s1, s2)
+1
View File
@@ -7,6 +7,7 @@
// AENS.transfer
// AENS.revoke
// Oracle.extend
include "String.aes"
contract UnappliedBuiltins =
entrypoint main() = ()
type o = oracle(int, int)