Skip to content

Commit

Permalink
tag support (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
vuvoth authored Oct 27, 2024
1 parent bcea566 commit adf10fc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 36 deletions.
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() {

}
}

0 comments on commit adf10fc

Please sign in to comment.