Comments (3)
Could you attach a file that causes this error? I tried using vim and 'cat'ing to a file, with no newline in either case and couldn't reproduce the error. Maybe there is another special character at the end?
from rapydscript.
I am not confident in my ability to upload or post a file in any way that won't mangle the newlines (i guess I could tar it up... let me know if this isn't enough)
$ echo "def test():" > test2.pyj
$ echo -en "\tprint(\"HI\")" >> test2.pyj
$ rapydscript test2.pyj
WARN: ERROR: Unexpected token: eof «undefined» [test2.pyj:2,12]
/RapydScript/lib/parse.js:122
throw new JS_Parse_Error(message, line, col, pos);
^
Error
at new JS_Parse_Error (/RapydScript/lib/parse.js:110:18)
at js_error (/RapydScript/lib/parse.js:122:11)
at croak (/RapydScript/lib/parse.js:707:9)
at token_error (/RapydScript/lib/parse.js:710:9)
at unexpected (/RapydScript/lib/parse.js:716:9)
at block_ (/RapydScript/lib/parse.js:1523:21)
at /RapydScript/lib/parse.js:1453:21
at /RapydScript/lib/parse.js:1460:15
at /RapydScript/lib/parse.js:938:24
at /RapydScript/lib/parse.js:747:20
$ hexdump -C test2.pyj
00000000 64 65 66 20 74 65 73 74 28 29 3a 0a 09 70 72 69 |def test():..pri|
00000010 6e 74 28 22 48 49 22 29 |nt("HI")|
00000018
$ echo >> test2.pyj
$ rapydscript test2.pyj
(function(){function _$rapyd$_print(){var args,output;args=[].slice.call(arguments,0);output=JSON.stringify(args);if("console"in window)console.log(output.substr(1,output.length-2))}function test(){_$rapyd$_print("HI")}})();
$ hexdump -C test2.pyj
00000000 64 65 66 20 74 65 73 74 28 29 3a 0a 09 70 72 69 |def test():..pri|
00000010 6e 74 28 22 48 49 22 29 0a |nt("HI").|
00000019
from rapydscript.
Ok, this makes more sense. My example was echo -en "a=1"
, but it seems like the file has to end with a function/block for this error to trigger.
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.