File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -494,6 +494,7 @@ RUN(NAME test_types_02 LABELS cpython llvm c wasm)
494494RUN(NAME test_str_01 LABELS cpython llvm c)
495495RUN(NAME test_str_02 LABELS cpython llvm c)
496496RUN(NAME test_str_03 LABELS cpython llvm c)
497+ RUN(NAME test_str_04 LABELS cpython llvm c wasm)
497498RUN(NAME test_list_01 LABELS cpython llvm c)
498499RUN(NAME test_list_02 LABELS cpython llvm c)
499500RUN(NAME test_list_03 LABELS cpython llvm c NOFAST)
Original file line number Diff line number Diff line change 1+ def main0 ():
2+ x : str
3+ x = "abcdefghijkl"
4+ print (len (x ))
5+ assert len (x ) == 12
6+
7+ y : str = "123"
8+ print (len (y ))
9+ assert len (y ) == 3
10+
11+ main0 ()
Original file line number Diff line number Diff line change @@ -1935,6 +1935,15 @@ class ASRToWASMVisitor : public ASR::BaseVisitor<ASRToWASMVisitor> {
19351935 throw CodeGenError (" String Types not yet supported" );
19361936 }
19371937
1938+ void visit_StringLen (const ASR::StringLen_t & x) {
1939+ if (x.m_value ) {
1940+ visit_expr (*x.m_value );
1941+ return ;
1942+ }
1943+ this ->visit_expr (*x.m_arg );
1944+ m_wa.emit_i32_load (wasm::mem_align::b8, 4 );
1945+ }
1946+
19381947 void visit_LogicalBinOp (const ASR::LogicalBinOp_t &x) {
19391948 if (x.m_value ) {
19401949 visit_expr (*x.m_value );
You can’t perform that action at this time.
0 commit comments