Giter Site home page Giter Site logo

A few syntax issues about ecmascript-sublime HOT 1 CLOSED

bathos avatar bathos commented on August 11, 2024
A few syntax issues

from ecmascript-sublime.

Comments (1)

bathos avatar bathos commented on August 11, 2024

Regarding some of these, like let and async, while some allowances are made for these to be recognized as identifiers in plausible scenarios, keep in mind that a regex based syntax highlighter can never have adequate context to differentiate a Script from a Module. ES Sublime presumes module.

We also can't actually parse expressions, so instead we need to rely on heuristics to determine plausible continuations — loosely categorizing each possibly terminal token in one of four or five groups to make decisions about what comes next. If you’d like to submit a PR to permit the incremented template literal in the final example or spreading numeric literals, I’d be happy to review & merge, but it’s obviously not real code so between that and the fact that a regexp syntax def can't be entirely precise, I don’t consider these bugs.

The if (exp) ; example is definitely a bug though. It affects while (true) ; as well — I’ll spin that off into a ticket on its own, but am closing this one.

from ecmascript-sublime.

Related Issues (20)

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.