Code Monkey home page Code Monkey logo

delven-transpiler's People

Contributors

dependabot[bot] avatar gbugaj avatar gregbugaj avatar

Watchers

 avatar  avatar

delven-transpiler's Issues

no viable alternative at input '}'

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; }

function with trailing comma parser errror

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

Generated code does not generate same Abstract Syntax Tree

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 codepoint sequence not decoded correcly

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

`extends` keyword not implmented properly

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 { 
}

Static methods not handled

AST generated from snippet bellow do not properly set static attribute

class Foo { static *foo() {} }

Test cases

The initial set of test cases is missing and need to be created

Grammar does not recognize Unicode encoded sequence correctly

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*;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.