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

feat(parser): basic parsing for HTML parser #2238

Merged
merged 1 commit into from
Mar 29, 2024
Merged

Conversation

ematipico
Copy link
Member

Summary

This PR implements the following:

  • implementation for lexing literals in HTML (I copied the implementation from CSS and GRIT lexing).
  • Implement lookahead for the HTML lexer (there's a bunch of code, mostly copied from the CSS lexer).
  • basic parsing for the <!doctype> directive, I will have to review (again) definition of the node.
  • basic parsing for attributes
  • paved the foundation for HtmlContext, where we will parse trivia differently (very much like JSX)

Note that I decided not to use any recovery strategy for now (check the TODO). HTML is a markup language, so the recovery strategy should be dynamic and versatile.

Test Plan

Added few basic cases, and added tests for the lexer

@github-actions github-actions bot added the A-Tooling Area: internal tools label Mar 29, 2024
Copy link

netlify bot commented Mar 29, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 5e5d148
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/6606d205d0d3bf00082f38ab
😎 Deploy Preview https://deploy-preview-2238--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 98 (🔴 down 2 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 49701 49701 0
Passed 48721 48721 0
Failed 980 980 0
Panics 0 0 0
Coverage 98.03% 98.03% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6322 6322 0
Passed 2036 2036 0
Failed 4286 4286 0
Panics 0 0 0
Coverage 32.20% 32.20% 0.00%

ts/babel

Test result main count This PR count Difference
Total 662 662 0
Passed 593 593 0
Failed 69 69 0
Panics 0 0 0
Coverage 89.58% 89.58% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 17646 17646 0
Passed 13439 13439 0
Failed 4205 4205 0
Panics 2 2 0
Coverage 76.16% 76.16% 0.00%

Copy link

codspeed-hq bot commented Mar 29, 2024

CodSpeed Performance Report

Merging #2238 will not alter performance

Comparing feat/html-parse-doc-type (5e5d148) with main (c8c479c)

Summary

✅ 93 untouched benchmarks

@ematipico ematipico merged commit d98c549 into main Mar 29, 2024
19 checks passed
@ematipico ematipico deleted the feat/html-parse-doc-type branch March 29, 2024 16:33
@dyc3 dyc3 added the L-HTML Language: HTML label Sep 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Tooling Area: internal tools L-HTML Language: HTML
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants