Code Monkey home page Code Monkey logo

Comments (3)

atsepkov avatar atsepkov commented on July 2, 2024

module is indeed a reserved keyword, it's an explicit way of creating a module object that Python gives you implicitly when you put the code in a separate file. For things like module.exports overrides you could use JS('module').exports syntax.

from rapydscript.

loolmeh avatar loolmeh commented on July 2, 2024

Thanks for your reply. Unfortunately JS('module').exports doesn't seem to work:

WARN: ERROR: Unexpected token: punc «.» [tasks/rapydscript.pyj:9,12]

/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:122
    throw new JS_Parse_Error(message, line, col, pos);
          ^
Error
    at new JS_Parse_Error (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:110:18)
    at js_error (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:122:11)
    at croak (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:702:9)
    at token_error (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:705:9)
    at unexpected (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:711:9)
    at /home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:892:17
    at /home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:742:20
    at Object.<anonymous> (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:2320:23)
    at Object.parse (/home/lool0/grunt-test/lib/node_modules/rapydscript/lib/parse.js:2362:7)
    at /home/lool0/grunt-test/lib/node_modules/rapydscript/bin/rapydscript:241:36

JS('module.exports') compiles fine though so if you think there's nothing to be done here I don't mind closing this ticket. Thanks for all the work you guys have put into this project :). I'm very new to this whole javascript thing and programming in general, and this was for the first thing I wrote in rapydscript as part of my GSOC project: https://github.com/loolmeh/grunt-rapydscript (any feedback you guys can provide would be great)

from rapydscript.

atsepkov avatar atsepkov commented on July 2, 2024

JS('module.exports') will work fine as well, I'll take a look at the parsing for JS('module').exports to figure out what's wrong, RapydScript should have no problem referencing variables from function return. I haven't started using grunt yet but plan to check it out later (we've built out our own scripts for building/deploying, although they are getting a little dated).

from rapydscript.

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.