mirror of
https://github.com/ton-blockchain/ton
synced 2025-03-09 15:40:10 +00:00
Add triple quotes asms (#463)
* Add python-like triple quotes for multiline strings * Add test for multiline asm * Allow asm definition duplicate * Asm duplicate: add test & fixes * Fix multiline asm * Fix asm duplicate Co-authored-by: legaii <jgates.ardux@gmail.com>
This commit is contained in:
parent
e913871f4f
commit
d23267d996
6 changed files with 123 additions and 13 deletions
26
crypto/func/test/s2.fc
Normal file
26
crypto/func/test/s2.fc
Normal file
|
@ -0,0 +1,26 @@
|
|||
slice test1() asm """
|
||||
"Test" $>s
|
||||
PUSHSLICE
|
||||
""";
|
||||
|
||||
slice test2() asm """
|
||||
"Hello"
|
||||
" "
|
||||
"World"
|
||||
$+ $+ $>s
|
||||
PUSHSLICE
|
||||
""";
|
||||
|
||||
int sdeq (slice s1, slice s2) asm """SDEQ""";
|
||||
int sdeq (slice s1, slice s2) asm "SDEQ" "";
|
||||
int sdeq (slice s1, slice s2) asm "" """
|
||||
SDEQ
|
||||
""";
|
||||
|
||||
() main() {
|
||||
slice s = test1();
|
||||
throw_unless(101, sdeq(s, "Test"));
|
||||
|
||||
slice s = test2();
|
||||
throw_unless(102, sdeq(s, "Hello World"));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue