poeschko / explainsyntax Goto Github PK
View Code? Open in Web Editor NEWExplaining your (JS) code, token by token.
License: MIT License
Explaining your (JS) code, token by token.
License: MIT License
We maintain a set of "interesting" node types in the AST, e.g. "VariableDeclaration" and "VariableDeclarator" for JavaScript. For each such node type, we also store additional information such as an MDN URL. When the CodeEditor
component encounters such node types in the user code, it adds highlighting to them, i.e. an underline connected to a line going towards the right edge of the editor (to be connected with the information blob in the ExplainPane
component). Highlight underlines should not overlap, e.g. in the case of a "VariableDeclarator" (x = 0
) inside a "VariableDeclaration" (let x = 0
), x = 0
would get an underline for "VariableDeclarator and let
would get an underline for "VariableDeclaration". Whenever the highlighting changes, the CodeEditor
fires an event that tells the parent componet (the App
) what the highlights are, i.e. what node types they correspond to and at what vertical position their lines end; that information can be propagated by the parent component to the ExplainPane
component.
To experiment with ASTs & node types: https://astexplorer.net/
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.