gregbugaj / delven-transpiler Goto Github PK
View Code? Open in Web Editor NEWdelven-transpiler
delven-transpiler
Fragment
async function* gen(){}
Incorrectly renders as
async function gen(){
}
Fragment
import foo, {bar} from "foo";
Throws
error in main TypeError: Type not handled : ImportDeclaration
Following expression when run via Javascript target will produce no viable alternative at input '}'
Offending code
() => { 0 }
Same expression but with ;
appended will work
() => { 0; }
Meta handling is not implemented, and following snippet will throw an exception
function f() {
let x = new.target;
}
Invalid parse tree generated for
{ x
++y }
The ++
operator is applied to x
identifier rather then the y
Following parses as epected
{
x;
++y
}
Template literals are current not implemented
This snippet will throw an exception when AST is being build
`$`
error in main TypeError: Not implemented
Ref : https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals
This fragment will fail to parse properly and will be interpreted as 'CallExpression' rather than 'AsynFunction'
async (x,y,) => x
This should be interpreted as
async (x,y) => x
Same goes for functions
function x(a,b,) {
fun(x,y,)
}
function x(a,b) {
fun(x,y)
}
This is a grammar issue with how formalParameterList
is handled
Both of the snippets bellow should generate same AST tree with path path ExpressionStatement.CallExpression.MemberExpression.NewExpression
Original code
( new foo).bar()
path ExpressionStatement.CallExpression.MemberExpression.NewExpression
Generated
new foo().bar()
path `ExpressionStatement.NewExpression.MemberExpression.CallExpression'
Unicode escaped string are note properly escaped when the script are read from a file
Following code sequence
var \u{41}\u{42}\u{43};
this should have been generated
var ABC
but it is being decode as
var \u{41}\u{42}\u{43}
This should happen when we are creating the the Identifier
so the generated AST should contain unescaped data
Function Expressions are not generating proper code fragments from AST
// source
({ foo() {
} })
// Generated code
{[foo]function (){
}}
Following snipped creates invalid AST tree. Parse Tree is correct as it contains the extends
token but AST is not populated.
class A extends B {
}
This created ClassDeclaration, ClassBody
but it should be ClassDeclaration, superClass, ClassBody
.
Transpiled as
class A {
}
AST generated from snippet bellow do not properly set static
attribute
class Foo { static *foo() {} }
The initial set of test cases is missing and need to be created
Grammar does not recognize Unicode encoded sequence correctly for the identifier declaration
let ℮
Antlr parser will generate following exception
line 1:5 mismatched input '<EOF>' expecting {'[', '{', 'async', NonStrictLet, Identifier}
The encoded ℮
should have been handled by the lexer in the following rule
Identifier: IdentifierStart IdentifierPart*;
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.