maxbarsukov / yascriptlang

🦎 A simple Lisp-inspired scripting language that compiles to JS

Home Page:https://www.npmjs.com/package/yascriptlang

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple example doesn't work for me

phunanon opened this issue Β· comments

Terminal printout below

/c/me/gh/yascriptlang cat fib-time.yas 
def fib = fn (n) -> if n < 2 then n else fib(n - 1) + fib(n - 2);

time(fn-> {
  println(fib(15));
});
/c/me/gh/yascriptlang node bin/yas.js fib-time.yas
file:///C:/me/gh/yascriptlang/src/tokenizer/InputStream.js:56
    throw new Error(`${type}: ${msg} at line ${this.line}:${this.col}`);
    ^

" at line 1:65Error: Can't handle character: "
    at InputStream.croak ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/tokenizer/InputStream.js:56:11←[90m)←[39m
    at TokenStream.croak ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/tokenizer/TokenStream.js:196:23←[90m)←[39m
    at TokenStream.readNext ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/tokenizer/TokenStream.js:175:17←[90m)←[39m
    at TokenStream.peek ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/tokenizer/TokenStream.js:180:27←[90m)←[39m
    at TokenStream.eof ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/tokenizer/TokenStream.js:192:17←[90m)←[39m
    at Parser.parseToplevel ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/parser/Parser.js:370:25←[90m)←[39m
    at Parser.parse ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/parser/Parser.js:62:17←[90m)←[39m
    at run ←[90m(file:///C:/me/gh/yascriptlang/←[39msrc/index.js:22:22←[90m)←[39m
    at ←[90mfile:///C:/me/gh/yascriptlang/←[39mbin/yas.js:15:3
←[90m    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3)←[39m

Node.js v18.13.0