Add witx crate, to parse and validate witx#90
Conversation
sbc100
left a comment
There was a problem hiding this comment.
I guess its time I learnt this newfangled language.
| @@ -0,0 +1,236 @@ | |||
| pub use crate::lexer::LexError; | |||
There was a problem hiding this comment.
Should we put a copyright header at the top of each source:
/*
* Copyright 2019 WebAssembly Community Group participants
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
There was a problem hiding this comment.
And maybe a LICENCE at the top level? (or maybe the top level of the entire repo?)
There was a problem hiding this comment.
The spec interpreter doesn't have copyright notices in the source files, and I think it's a reasonable example to follow.
There was a problem hiding this comment.
Added a LICENSE file with that exact text, fixed the license field in cargo toml to leave out the llvm-exception part
|
Per @sunfishcode's suggestion, I renamed the crate to |
369d69f to
cf799b4
Compare
|
I also published this version to crates.io to reserve the package name, and added Dan as an owner. |
|
Looks good! Since we discussed this in the last meeting, let's go ahead and merge, and we can continue to iterate with PRs and issues from here. |
* import witx-frontend crate * witx-frontend: add test that wasi_unstable.witx validates * witx-frontend: better error reporting * witx-frontend: add witx-specific pointer and constpointer constructions * wasi_unstable: fix syntax of preopentype_t * witx-frontend: add LICENSE file, fix repo capitalization * rename witx-frontend to witx
* Create a structure for phased development. This PR takes the `witx` concept from WebAssembly#74 and creates a directory structure around it for enabling phased development of new APIs and changes to existing APIs. See the README.md changes for details. * Apply the validation fix from WebAssembly#90 to the new copies.
* import witx-frontend crate * witx-frontend: add test that wasi_unstable.witx validates * witx-frontend: better error reporting * witx-frontend: add witx-specific pointer and constpointer constructions * wasi_unstable: fix syntax of preopentype_t * witx-frontend: add LICENSE file, fix repo capitalization * rename witx-frontend to witx
* Create a structure for phased development. This PR takes the `witx` concept from WebAssembly#74 and creates a directory structure around it for enabling phased development of new APIs and changes to existing APIs. See the README.md changes for details. * Apply the validation fix from WebAssembly#90 to the new copies.
Add text excluding `.` and `..` from `readdir` directory iteration. In most use cases, they act as navigational mechanisms rather than meaningful contents of directories. Wasi-libc will be expected to re-add `.` and `..` when implementing the POSIX `readdir` interface. Fixes WebAssembly#90.
* import witx-frontend crate * witx-frontend: add test that wasi_unstable.witx validates * witx-frontend: better error reporting * witx-frontend: add witx-specific pointer and constpointer constructions * wasi_unstable: fix syntax of preopentype_t * witx-frontend: add LICENSE file, fix repo capitalization * rename witx-frontend to witx
* Create a structure for phased development. This PR takes the `witx` concept from WebAssembly#74 and creates a directory structure around it for enabling phased development of new APIs and changes to existing APIs. See the README.md changes for details. * Apply the validation fix from WebAssembly#90 to the new copies.
Convert `//`-style comments to `///`.
As a follow on to #74, I'm submitting the
witxcrate, adapted from the Lucet project (https://github.com/fastly/lucet).witxparses and validates a witx file into the representation given intools/witx/src/ast.rs. The validation rules are written insrc/validation.rs. The crate produces a binary,witx, which validates a witx file, or reports an error if it fails to validate.witxuses stable rust, and has only two crate dependencies -failure, a very-nearly-standard error reporting library, andclap, a popular argument parsing library. (clapand the executable could be separated out into a separate crate if necessary to drop that dependency).This PR also fixes one minor syntax error in the existing witx files. It is already useful!
After this is merged, I will make a PR to add Azure Pipelines integration to ensure that this code builds without errors, and validates all checked-in witx files, as a condition to merge each PR.