oxc-project / javascript-parser-in-rust Goto Github PK
View Code? Open in Web Editor NEWTutorial on writing a JavaScript Parser in Rust
Home Page: https://oxc-project.github.io/javascript-parser-in-rust/
Tutorial on writing a JavaScript Parser in Rust
Home Page: https://oxc-project.github.io/javascript-parser-in-rust/
In the tutorial it's suggested to represent Expression as an enum and each expression has it's variant. Inside all variants we are storing a node.
I'm trying to work with use the AST, and it's not easy to access the node
field without deconstructing to a variant.
I'm curios what happens if we change the representation to this:
pub struct Expression {
node: Node,
expression_kind: ExpressionKind,
}
pub enum ExpressionKind {
SomeExpression(SomeExpression),
}
Then we can pass this type around in functions and access the node easily.
Does this have negative performance impact or other issues?
Thank you for the wonderful project.
Since discussions haven’t been opened, I am asking this question through an issue.
I know that part of this project has been translated into Japanese, and I would like to create PRs for translating the remaining parts.
What granularity of PRs do you request us?
• Everything all at once
• Each page individually
• Others
I would be grateful if you could tell me the method that would best suit your preferences.
When I set up this project to fix #13, I found that configuration for corepack is not set up.
So, I tried to use the latest version of pnpm (because of pnpm-lock.yaml
), and diffs are generated in the file.
I didn't include the diff in #13, but it's appreciated packageManager
option is defined in package.json
for future developer experience.
https://boshen.github.io/javascript-parser-in-rust/blog/grammar/#label-statement-is-legit
The following syntax is correct, it returns a labelled statement (not object literal).
const foo = (bar) => ({ baz: quaz });
In fact, it will return object literal.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.