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

tag support #58

Merged
merged 1 commit into from
Oct 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 0 additions & 36 deletions crates/parser/src/grammar/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,39 +37,3 @@ pub fn block(p: &mut Parser) {
}
}

// #[cfg(test)]
// mod tests {

// use crate::{
// ast::{AstBlock, AstNode},
// grammar::entry::Scope,
// syntax_node::SyntaxNode,
// };

// use super::*;
// #[test]
// fn parse_block_test() {
// let source = r#"
// {
// var x, y;
// var (x, y);
// var (x, y) = a + b;
// var a = x, b = y;
// var a = x, b = y;

// signal a;
// signal a, b;
// signal (a, b);
// signal (a, b) = a - b;
// a <== 12 + 1
// a ==>b
// }
// "#;
// let green_node = Parser::parse_scope(source, Scope::Block);
// let syntax_node = SyntaxNode::new_root(green_node);

// if let Some(ast_block) = AstBlock::cast(syntax_node) {
// println!("{:?}", ast_block.statement_list().unwrap().syntax().kind());
// }
// }
// }
13 changes: 13 additions & 0 deletions crates/parser/src/grammar/declaration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@ fn signal_header(p: &mut Parser) -> Option<bool> {
res = Some(false);
}
p.advance();

if p.at(LCurly) {
p.expect(Identifier);
p.expect(RCurly);
}
}
p.close(m, SignalHeader);
res
Expand Down Expand Up @@ -120,3 +125,11 @@ pub(super) fn declaration(p: &mut Parser) {
_ => unreachable!(),
}
}

#[cfg(test)]
mod declar_tests {
#[test]
fn signal_with_tag() {

}
}
Loading