Fixed issue with Lamda

This commit is contained in:
Devine Lu Linvega
2019-07-24 09:31:41 +09:00
parent 6785286118
commit 0294c04858
7 changed files with 44 additions and 46 deletions

View File

@@ -235,7 +235,7 @@ function Library (ronin) {
this.sqrt = Math.sqrt // calculate the square root
this.sq = (a) => { // calculate the square
return a * a;
return a * a
}
this.PI = Math.PI

View File

@@ -152,7 +152,7 @@ function Lisp (lib = {}, includes = []) {
}
const tokenize = function (input) {
const i = input.replace(/^\;.*\n?/gm, '').replace('λ', 'lambda ').split('"')
const i = input.replace(/^\;.*\n?/gm, '').replace(/λ /g, 'lambda ').split('"')
return i.map(function (x, i) {
return i % 2 === 0
? x.replace(/\(/g, ' ( ')