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

Commit

Permalink
wast: first import of a wast format scanner+parser
Browse files Browse the repository at this point in the history
 - `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.
  • Loading branch information
Spriithy authored Feb 27, 2020
1 parent 39e14db commit 6803234
Show file tree
Hide file tree
Showing 5 changed files with 1,115 additions and 3 deletions.
8 changes: 8 additions & 0 deletions wast/doc.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// Copyright 2017 The go-interpreter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.

// Package wast provides functions to handle wast files.
//
// See https://webassembly.github.io/spec/core/text/
package wast
Loading

0 comments on commit 6803234

Please sign in to comment.