Comments (3)
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.
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.
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)
- append method does not compile to js push method HOT 1
- VSCode extension for syntax highlighting HOT 4
- cannot compare string HOT 3
- Typescript has problem compile RS --es6 output at class attributes HOT 2
- Why not support in-browser compiler? HOT 2
- enhancement: check for already reserved words like: enum HOT 18
- Cannot resolve python imports HOT 8
- Is that possible to parse python code to js AST? HOT 1
- fstring support. HOT 1
- How to keep all comments HOT 8
- Can't find python module that is installed and available? HOT 1
- Cannot catch ImportError HOT 2
- Cannot import from custom module in different directory HOT 5
- How to use RapydScript with JavaScript MutationObserver HOT 1
- Question about feasibility: option to use JS function syntax for nested functions, especially inside dicts/object-literals HOT 7
- How to run code snippets from tutorials on old Android? HOT 1
- Computed and negative slices
- parenthesized syntax HOT 2
- TypeError: undefined is not a function HOT 1
- Compiler issues HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rapydscript.