Skip to content

Commit

Permalink
feat: support comment tag case and pass the hello test case
Browse files Browse the repository at this point in the history
  • Loading branch information
meloalright committed Feb 4, 2024
1 parent 1265f1c commit 14bedd3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 9 additions & 0 deletions rustle/src/compiler/parse/fragments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,15 @@ fn parse_element(parser: &mut Parser) -> Option<RustleElement> {
if parser.match_str("<") {
parser.eat("<");

if parser.match_str("!--") {
parser.eat("!--");
while !Regex::new(r"-->").unwrap().is_match(&parser.content[parser.index..parser.index+3]) {
parser.index += 1;
}
parser.eat("-->");
return None;
}

let tag_name = parser.read_while_matching(&ELEMENT_TAG_NAME);
let attributes = parse_attribute_list(parser);

Expand Down
5 changes: 2 additions & 3 deletions rustle/tests/test_parsing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,8 @@ fn test_attribute_self() { test_parsing("attribute_self".to_owned()) }
fn test_attribute_template_string() { test_parsing("attribute_template_string".to_owned()) }


// #[test]
// fn test_parsing_hello() { test_parsing("hello".to_owned()) }

#[test]
fn test_parsing_hello() { test_parsing("hello".to_owned()) }

// #[test]
// fn test_parsing_reactive_assignments() { test_parsing("reactive-assignments".to_owned()) }

0 comments on commit 14bedd3

Please sign in to comment.