Skip to content

Commit

Permalink
fixed final error
Browse files Browse the repository at this point in the history
  • Loading branch information
jaytaph committed Sep 21, 2024
1 parent 76b2d13 commit 38e208e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/bin/gosub-parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ fn main() -> Result<()> {

// Create a new document that will be filled in by the parser
let doc_handle: DocumentHandle<DocumentImpl<Css3System>, Css3System> = <DocumentBuilder as gosub_shared::traits::document::DocumentBuilder<Css3System>>::new_document(Some(url));
let parse_errors = Html5Parser::parse_document(&mut stream, doc_handle.clone(), None)?;
let parse_errors = Html5Parser::<DocumentImpl<Css3System>, Css3System>::parse_document(&mut stream, doc_handle.clone(), None)?;

println!("Found {} stylesheets", doc_handle.get().stylesheets.len());
for sheet in &doc_handle.get().stylesheets {
println!("Stylesheet location: {:?}", sheet.location);
println!("Stylesheet url: {:?}", sheet.url);
}

// let mut handle_mut = handle.get_mut();
Expand Down
5 changes: 4 additions & 1 deletion src/bin/html5-parser-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ use gosub_testing::testing::tree_construction::Harness;
use std::io::Write;
use std::path::{Path, PathBuf};
use walkdir::WalkDir;
use gosub_css3::system::Css3System;
use gosub_html5::document::document::DocumentImpl;
use gosub_html5::parser::Html5Parser;

fn main() -> Result<()> {
let mut files = get_files_from_path(fixture_root_path());
Expand All @@ -29,7 +32,7 @@ fn main() -> Result<()> {
for test in &fixture.tests {
for &scripting_enabled in test.script_modes() {
let result = harness
.run_test(test.clone(), scripting_enabled)
.run_test::<Html5Parser<DocumentImpl<Css3System>, Css3System>, Css3System>(test.clone(), scripting_enabled)
.expect("problem parsing");

total += 1;
Expand Down
5 changes: 4 additions & 1 deletion src/bin/parser-test.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
use gosub_css3::system::Css3System;
use gosub_html5::document::document::DocumentImpl;
use gosub_html5::parser::Html5Parser;
use gosub_testing::testing::tree_construction::fixture::read_fixtures;
use gosub_testing::testing::tree_construction::result::ResultStatus;
use gosub_testing::testing::tree_construction::Harness;
Expand Down Expand Up @@ -72,7 +75,7 @@ fn run_test(test_idx: usize, test: Test, all_results: &mut TotalTestResults) {

let mut harness = Harness::new();
let result = harness
.run_test(test.clone(), false)
.run_test::<Html5Parser<DocumentImpl<Css3System>, Css3System>, Css3System>(test.clone(), false)
.expect("problem parsing");

// #[cfg(all(feature = "debug_parser", not(test)))]
Expand Down

0 comments on commit 38e208e

Please sign in to comment.