-
Notifications
You must be signed in to change notification settings - Fork 271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add witx crate, to parse and validate witx #90
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess its time I learnt this newfangled language.
tools/witx-frontend/src/sexpr.rs
Outdated
@@ -0,0 +1,236 @@ | |||
pub use crate::lexer::LexError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And maybe a LICENCE at the top level? (or maybe the top level of the entire repo?)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
As a follow on to #74, I'm submitting the
witx
crate, adapted from the Lucet project (https://github.com/fastly/lucet).witx
parses 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.witx
uses stable rust, and has only two crate dependencies -failure
, a very-nearly-standard error reporting library, andclap
, a popular argument parsing library. (clap
and 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.