Skip to content
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

Write ASTs out as straw proposal text format #4

Open
fitzgen opened this issue May 16, 2019 · 0 comments
Open

Write ASTs out as straw proposal text format #4

fitzgen opened this issue May 16, 2019 · 0 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@fitzgen
Copy link
Member

fitzgen commented May 16, 2019

We can parse the straw proposal text format into an AST (see src/ast.rs and src/grammar.lalrpop).

We should also support taking an AST and writing it out into the straw proposal text format.

I'd define a trait like

trait Unparse {
    fn unparse<W>(&self, output: &mut W) -> std::io::Result<()>
        where W: std::io::Write;
}

and implement it for all of our AST types, and expose a top level helper utility that takes a whole ast::WebidlBindingsSection and recursively unparses the whole thing.

@fitzgen fitzgen added enhancement New feature or request help wanted Extra attention is needed labels May 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant