github.com/tetratelabs/wazero@v1.7.3-0.20240513003603-48f702e154b5/internal/integration_test/spectest/v2/testdata/token.wast (about) 1 ;; Test tokenization 2 3 (assert_malformed 4 (module quote "(func (drop (i32.const0)))") 5 "unknown operator" 6 ) 7 (assert_malformed 8 (module quote "(func br 0drop)") 9 "unknown operator" 10 ) 11 12 13 ;; Tokens can be delimited by parentheses 14 15 (module 16 (func(nop)) 17 ) 18 (module 19 (func (nop)nop) 20 ) 21 (module 22 (func nop(nop)) 23 ) 24 (module 25 (func(nop)(nop)) 26 ) 27 (module 28 (func $f(nop)) 29 ) 30 (module 31 (func br 0(nop)) 32 ) 33 (module 34 (table 1 funcref) 35 (func) 36 (elem (i32.const 0)0) 37 ) 38 (module 39 (table 1 funcref) 40 (func $f) 41 (elem (i32.const 0)$f) 42 ) 43 (module 44 (memory 1) 45 (data (i32.const 0)"a") 46 ) 47 (module 48 (import "spectest" "print"(func)) 49 ) 50 51 52 ;; Tokens can be delimited by comments 53 54 (module 55 (func;;bla 56 ) 57 ) 58 (module 59 (func (nop);;bla 60 ) 61 ) 62 (module 63 (func nop;;bla 64 ) 65 ) 66 (module 67 (func $f;;bla 68 ) 69 ) 70 (module 71 (func br 0;;bla 72 ) 73 ) 74 (module 75 (data "a";;bla 76 ) 77 ) 78 79 80 ;; Space required between symbols and non-parenthesis tokens 81 82 (module 83 (func (block $l (i32.const 0) (br_table 0 $l))) 84 ) 85 (assert_malformed 86 (module quote 87 "(func (block $l (i32.const 0) (br_table 0$l)))" 88 ) 89 "unknown operator" 90 ) 91 92 (module 93 (func (block $l (i32.const 0) (br_table $l 0))) 94 ) 95 (assert_malformed 96 (module quote 97 "(func (block $l (i32.const 0) (br_table $l0)))" 98 ) 99 "unknown label" 100 ) 101 102 (module 103 (func (block $l (i32.const 0) (br_table $l $l))) 104 ) 105 (assert_malformed 106 (module quote 107 "(func (block $l (i32.const 0) (br_table $l$l)))" 108 ) 109 "unknown label" 110 ) 111 112 (module 113 (func (block $l0 (i32.const 0) (br_table $l0))) 114 ) 115 (module 116 (func (block $l$l (i32.const 0) (br_table $l$l))) 117 ) 118 119 120 ;; Space required between strings and non-parenthesis tokens 121 122 (module 123 (data "a") 124 ) 125 (assert_malformed 126 (module quote 127 "(data\"a\")" 128 ) 129 "unknown operator" 130 ) 131 132 (module 133 (data $l "a") 134 ) 135 (assert_malformed 136 (module quote 137 "(data $l\"a\")" 138 ) 139 "unknown operator" 140 ) 141 142 (module 143 (data $l " a") 144 ) 145 (assert_malformed 146 (module quote 147 "(data $l\" a\")" 148 ) 149 "unknown operator" 150 ) 151 152 (module 153 (data $l "a ") 154 ) 155 (assert_malformed 156 (module quote 157 "(data $l\"a \")" 158 ) 159 "unknown operator" 160 ) 161 162 (module 163 (data $l "a " "b") 164 ) 165 (assert_malformed 166 (module quote 167 "(data $l\"a \"\"b\")" 168 ) 169 "unknown operator" 170 ) 171 172 (module 173 (data $l "") 174 ) 175 (assert_malformed 176 (module quote 177 "(data $l\"\")" 178 ) 179 "unknown operator" 180 ) 181 182 (module 183 (data $l " ") 184 ) 185 (assert_malformed 186 (module quote 187 "(data $l\" \")" 188 ) 189 "unknown operator" 190 ) 191 192 (module 193 (data $l " ") 194 ) 195 (assert_malformed 196 (module quote 197 "(data $l\" \")" 198 ) 199 "unknown operator" 200 ) 201 202 (module 203 (data "a" "b") 204 ) 205 (assert_malformed 206 (module quote 207 "(data \"a\"\"b\")" 208 ) 209 "unknown operator" 210 ) 211 212 (module 213 (data "a" " b") 214 ) 215 (assert_malformed 216 (module quote 217 "(data \"a\"\" b\")" 218 ) 219 "unknown operator" 220 ) 221 222 (module 223 (data "a " "b") 224 ) 225 (assert_malformed 226 (module quote 227 "(data \"a \"\"b\")" 228 ) 229 "unknown operator" 230 ) 231 232 (module 233 (data "" "") 234 ) 235 (assert_malformed 236 (module quote 237 "(data \"\"\"\")" 238 ) 239 "unknown operator" 240 ) 241 242 (module 243 (data "" " ") 244 ) 245 (assert_malformed 246 (module quote 247 "(data \"\"\" \")" 248 ) 249 "unknown operator" 250 ) 251 252 (module 253 (data " " "") 254 ) 255 (assert_malformed 256 (module quote 257 "(data \" \"\"\")" 258 ) 259 "unknown operator" 260 ) 261 262 263 (assert_malformed 264 (module quote 265 "(func \"a\"x)" 266 ) 267 "unknown operator" 268 ) 269 (assert_malformed 270 (module quote 271 "(func \"a\"0)" 272 ) 273 "unknown operator" 274 ) 275 (assert_malformed 276 (module quote 277 "(func 0\"a\")" 278 ) 279 "unknown operator" 280 ) 281 (assert_malformed 282 (module quote 283 "(func \"a\"$x)" 284 ) 285 "unknown operator" 286 )