Bug 1520001 - Updating binast generator to binjs_meta 0.5.2;r=arai

Depends on D34127

Differential Revision: https://phabricator.services.mozilla.com/D34128

--HG--
extra : moz-landing-system : lando
This commit is contained in:
David Teller 2019-06-07 18:54:59 +00:00
parent 75ea881e7f
commit ffd7cd1a22
2 changed files with 3 additions and 8 deletions

View File

@ -5,14 +5,13 @@ authors = ["David Teller <D.O.Teller@gmail.com>"]
autobins = false
[dependencies]
binjs_meta = "^0.4.3"
binjs_meta = "^0.5.2"
clap = "^2"
env_logger = "^0.5.6"
Inflector = "^0.11"
itertools = "^0.7.6"
log = "0.4"
yaml-rust = "^0.4.2"
webidl = "^0.8"
[[bin]]
name = "binast"

View File

@ -4,7 +4,6 @@ extern crate env_logger;
extern crate inflector;
extern crate itertools;
#[macro_use] extern crate log;
extern crate webidl;
extern crate yaml_rust;
use binjs_meta::export::{ ToWebidl, TypeDeanonymizer, TypeName };
@ -2355,12 +2354,9 @@ fn main() {
file.read_to_string(&mut source)
.expect("Could not read source");
println!("...parsing webidl");
let ast = webidl::parse_string(&source)
.expect("Could not parse source");
println!("...verifying grammar");
let mut builder = Importer::import(&ast);
let mut builder = Importer::import(vec![source.as_ref()])
.expect("Invalid grammar");
let fake_root = builder.node_name("@@ROOT@@"); // Unused
let null = builder.node_name(""); // Used
builder.add_interface(&null)