Skip to content
This repository was archived by the owner on May 11, 2020. It is now read-only.

Commit 6803234

Browse files
authored
wast: first import of a wast format scanner+parser
- `tokens.go`: Defines the Token type generated by the scanner and several utility functions around it - `test.wast`: A .wast test file extracted from [wasm's spec tests](https://github.com/WebAssembly/spec/blob/master/test/core/names.wast) - `scanner.go`: Implements the actual scanner and utilty functions regarding runes - `scanner_test.go`: A dead simple test case against the `test.wast` file. It doesn't verify correctness yet. - Added several new token kind constants to list different typed instructions such as `i64.reinterpret/f64` or `i32.add` - Implemented the `(*Scanner).scanTypedReserved()` method to identify well and ill-formed typed instructions - Better Scanner test interface, the test suite now takes a `-wast-file` flag that must point to the `.wast` file to Scan and test against. In order to test: - Create (or use a [`spec/test/core`](https://github.com/WebAssembly/spec/tree/master/test/core) ) wast file Updates #34.
1 parent 39e14db commit 6803234

File tree

5 files changed

+1115
-3
lines changed

5 files changed

+1115
-3
lines changed

wast/doc.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright 2017 The go-interpreter Authors. All rights reserved.
2+
// Use of this source code is governed by a BSD-style
3+
// license that can be found in the LICENSE file.
4+
5+
// Package wast provides functions to handle wast files.
6+
//
7+
// See https://webassembly.github.io/spec/core/text/
8+
package wast

0 commit comments

Comments
 (0)