GithubHelp home page GithubHelp logo

jsppext's Introduction


A blood black nothingness began to spin. A system of cells interlinked within cells interlinked within cells interlinked within one stem. And dreadfully distinct against the dark, a tall white fountain played.


git git git git git git git

git git git

jsppext's People

Contributors

al1-ce avatar

Stargazers

 avatar

Watchers

 avatar

jsppext's Issues

Feature: Async injection

As for v.0.10.0 of js++ compiler there's no async functionality intergrated.

Proposal:
Integrate async injection into compiler extension.

How:
Assume we have function that we want to make async, let's call it "sleep". And we call it at some moment and we need to await it. Then we write this code: await(sleep(5000));.
Jsppext changes await(sleep(5000)); to await sleep(5000); with matching regex \bawait\b\s*?\((.*?)\)\s*?;.
Then it''s going through all functions while looking if there's await keyword inside. If it's there, then add async to function. Do that again with async / await keywords while checking if function is already async.
Then search all functions within included modules with function\s*((?:[^\(\)\s])+?)\s*\(.*?\) regex for any signature of awaited function. Check if it's already async, if not add async keyword, add function to completed list.

Limitations:
Await signature must be always await(/func/);.
If threre's more then one instance of awaited function it might fail. It's going to make all functions with that name async, which might lead to some probable unexpected results.
No top level awaits. Yes top level awaits since jspp compiles into folded function which is going to be picked up and made async.

Known issues

  • ' being replaced by `. If you want to use ' inside of string, escape it \'. Same for `
    - external something; affecting modules. Put external statements on top of file (before imports), if there's no imports import std;, otherwise external statement going to be picked up inside of module. Fixed in 10a2403

Parse errors not showing

Parse Error: Line 19: Unexpected token ... (G:\sily-jspp-example\src\lib\sily\std\getopt.jpp)
  FAILED    (1) errors and (0) warnings

Preparation before compiling

Implements:

  • PARTIALLY #12 Alias injection (basic c macro, visibility alias name = symbol;)
  • #13 Global file module (module name; at top of file)
  • #14 String conversion
  • #15 Import conversion (std -> System)
  • NOT PLANNED FOR NOW #16 D-style symbol imports (import modulename: symbol;)
  • #17 Alias struct to class & const to final
  • #19 If main file and contains void main() then execute it
  • NOT PLANNED FOR NOW Import visibility (ak public for imports between modules)

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.