Giter Club home page Giter Club logo

toyscript's People

Contributors

after12am avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

toyscript's Issues

simplify code using ternary operator in lexer.js

Lexer.prototype.consume = function() {
    if (this.c == '\n' || this.c == '\r') {
        this.column = 1;
    } else {
        this.column++;
    }
    this.p++;
    if (this.p < this.source.length) {
        this.c = this.source[this.p];
    } else {
        this.c = Token.EOF;
    }
}

like this:

this.column = (this.c == '\n' || this.c == '\r') ? 1 : this.column + 1;
this.p++;
this.c = (this.p < this.source.length) ? this.source[this.p] : Token.EOF;

grammer

  • 7.8.3 Numeric Literals
  • 7.8.4 String Literals
  • 7.8.5 Regular Expression Literals
  • 9 Type Conversion
  • 10 Execution Contexts
  • 10.1.1 Function Function Objects
  • 13.2 Creating Function Objects
  • 15 Native ECMAScript Objects
  • to consider whether or not I plan to use underscore.js
  • incorporate const variables. modify typeof - http://docs.python.org/2/library/stdtypes.html
  • whether need to be indent token.
  • if delete new line token, add token of ";" after continue break return
  • testcase for illegal grammer
  • add Javascript keyword to Token.KEYWORDS object

https://developer.mozilla.org/ja/docs/JavaScript/Reference
https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API
http://www2u.biglobe.ne.jp/~oz-07ams/prog/ecma262r3/
http://esprima.org/demo/parse.html
http://ja.wikipedia.org/wiki/%E5%AD%97%E5%8F%A5%E8%A7%A3%E6%9E%90

  • result of codegen of below toyscript code is verbose
    for k, v in a:
    console.log(v)

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.