diff --git a/.gitattributes b/.gitattributes index a36bf9195..83b87289d 100644 --- a/.gitattributes +++ b/.gitattributes @@ -29,3 +29,7 @@ *.jpg binary *.pdf binary *.sqlite binary + +# A torture fixture whose CRLF line endings ARE the trap it sets (a BOM and CRLF in one +# page); normalising it would remove the case the suite asserts. +parser/src/test-data/web/torture/quirks.html -text diff --git a/bin/axiomcode b/bin/axiomcode index 313b110aa..c3948dfad 100755 --- a/bin/axiomcode +++ b/bin/axiomcode @@ -393,7 +393,7 @@ case "$cmd" in run_suite(){ local s="$1"; shift; echo "══ $s"; bash "$ROOT/graph/test/$s/run-tests.sh" "$@" || rc=1; } case "$which" in java|typescript|python|javascript|csharp) run_suite "$which" "$@";; - parser) for t in java-extractor-tests typescript-tests python-tests javascript-tests csharp-tests gradle-tests services-tests discovery-tests; do + parser) for t in java-extractor-tests typescript-tests python-tests javascript-tests csharp-tests gradle-tests services-tests web-tests web-torture discovery-tests; do [ -f "$ROOT/parser/src/test/$t.ts" ] || continue; echo "══ parser: $t"; (cd "$ROOT/parser" && npx tsx "src/test/$t.ts") || rc=1; done;; all) for l in java typescript python javascript csharp; do run_suite "$l" "$@"; done; "$0" test parser || rc=1;; *) die "test: unknown suite $which (java | typescript | python | javascript | csharp | parser | all)";; diff --git a/package.json b/package.json index 4fd812a5e..426f256c3 100644 --- a/package.json +++ b/package.json @@ -55,10 +55,13 @@ "LICENSE.md" ], "dependencies": { + "entities": "^6.0.0", "sax": "^1.4.4", "tree-sitter": "^0.21.1", "tree-sitter-c-sharp": "0.23.1", + "tree-sitter-css": "0.23.0", "tree-sitter-groovy": "^0.1.2", + "tree-sitter-html": "0.23.2", "tree-sitter-java": "0.23.4", "tree-sitter-python": "^0.21.0", "typescript": "^5.3.3", diff --git a/parser/README.md b/parser/README.md index c6c5517ab..5b199ebaf 100644 --- a/parser/README.md +++ b/parser/README.md @@ -89,6 +89,23 @@ same tables and be compared. | **YAML** | Beta | 2 | yaml | Configuration entries with anchor and alias tracking, multi document support. | | **META-INF/services** | Stable | 2 | custom | Provider-configuration files: the service each file configures, taken from its name, and every implementation class it names, with the file and line. | | **Gradle** | Beta | 8 | tree-sitter-groovy | Scripts and their role in the build, blocks, declarations, dependency coordinates split into group/artifact/version, version catalogs, value references with resolution, comments, and parse gaps. Groovy and Kotlin DSL. | +| **HTML** | Beta | 9 | tree-sitter-html | Documents with their doctype and template dialects, the element tree as written (nothing a browser would imply) with XPath-like paths, attributes by kind, class tokens, every URL a page names (scripts, stylesheets, links, images, forms, frames, htmx requests) classified and resolved to a file where one exists, `` — the body is the code; `bodyStartLine`…`bodyEndLine` locate it. */ + INLINE = 'INLINE', +} + +/** + * How the browser treats a ` +
${name}
+