#![cfg_attr(can_show_location_of_runtime_parse_error, feature(proc_macro_span))]
#![deny(rust_2018_idioms, unsafe_code)]
#[allow(clippy::useless_attribute)]
extern crate proc_macro;
use proc_macro_hack::proc_macro_hack;
mod context;
mod error;
mod gtk;
mod lexer;
mod parser;
#[proc_macro_hack]
pub fn gtk(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
let stream: lexer::Tokens = input.into();
let result = parser::grammar::GtkElementParser::new().parse(stream.lexer());
match result {
Err(err) => error::parse_error(&stream, &err),
Ok(element) => gtk::expand_gtk(&element),
}
.into()
}