Skip to content

Commit

Permalink
fix do macro + unit tests #87
Browse files Browse the repository at this point in the history
  • Loading branch information
jcubic committed Nov 23, 2020
1 parent 5588288 commit 5fa64cc
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
![LIPS - Scheme Based Powerful Lisp Language](https://github.com/jcubic/lips/blob/devel/assets/lips.svg?raw=true)

[![npm](https://img.shields.io/badge/npm-1.0.0%E2%80%93beta.9-blue.svg)](https://www.npmjs.com/package/@jcubic/lips)
[![travis](https://travis-ci.org/jcubic/lips.svg?branch=devel&af28c02e25c8ae80ff2145ea55a506aa0266b190)](https://travis-ci.org/jcubic/lips)
[![travis](https://travis-ci.org/jcubic/lips.svg?branch=devel&5588288116bf3167f15c561c767198ec64adf955)](https://travis-ci.org/jcubic/lips)
[![Coverage Status](https://coveralls.io/repos/github/jcubic/lips/badge.svg?branch=devel&f6ff9bc2f84ef7b55e3e590fe6bc423b)](https://coveralls.io/github/jcubic/lips?branch=devel)
[![Join Gitter Chat](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/jcubic/lips)
<a href="https://twitter.com/intent/tweet?text=Powerful%20Scheme%20based%20lisp%20language%20written%20in%20JavaScript.%20It%20makes%20life%20easier%20by%20better%20interaction%20with%20JS.%20Use%20full%20power%20of%20JavaScript%2C%20lisp%20and%20npm%20to%20create%20your%20applications%20via%20@jcubic&url=https://github.com/jcubic/lips&hashtags=javascript,opensource,lisp,scheme,language,programming">
Expand Down
10 changes: 5 additions & 5 deletions dist/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* Copyright (c) 2014-present, Facebook, Inc.
* released under MIT license
*
* build: Mon, 23 Nov 2020 12:02:30 +0000
* build: Mon, 23 Nov 2020 13:07:03 +0000
*/
(function () {
'use strict';
Expand Down Expand Up @@ -8930,7 +8930,7 @@
case 25:
_context9.t3 = _context9.sent;

if (!(_context9.t3 !== false)) {
if (!(_context9.t3 === false)) {
_context9.next = 30;
break;
}
Expand Down Expand Up @@ -11750,10 +11750,10 @@

var banner = function () {
// Rollup tree-shaking is removing the variable if it's normal string because
// obviously 'Mon, 23 Nov 2020 12:02:30 +0000' == '{{' + 'DATE}}'; can be removed
// obviously 'Mon, 23 Nov 2020 13:07:03 +0000' == '{{' + 'DATE}}'; can be removed
// but disablig Tree-shaking is adding lot of not used code so we use this
// hack instead
var date = LString('Mon, 23 Nov 2020 12:02:30 +0000').valueOf();
var date = LString('Mon, 23 Nov 2020 13:07:03 +0000').valueOf();

var _date = date === '{{' + 'DATE}}' ? new Date() : new Date(date);

Expand Down Expand Up @@ -11790,7 +11790,7 @@
var lips = {
version: 'DEV',
banner: banner,
date: 'Mon, 23 Nov 2020 12:02:30 +0000',
date: 'Mon, 23 Nov 2020 13:07:03 +0000',
exec: exec,
// unwrap async generator into Promise<Array>
parse: compose(uniterate_async, parse),
Expand Down
4 changes: 2 additions & 2 deletions dist/lips.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/lips.js
Original file line number Diff line number Diff line change
Expand Up @@ -5763,7 +5763,7 @@
node = node.cdr;
}
eval_args = { env: scope, dynamic_scope, error };
while ((await evaluate(test.car, eval_args)) !== false) {
while ((await evaluate(test.car, eval_args)) === false) {
if (body !== nil) {
await lips.evaluate(body, eval_args);
}
Expand Down
7 changes: 7 additions & 0 deletions tests/core.scm
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,13 @@
(t.is (or (begin) 1) undefined)
(t.is (or null 1) null)))

(test_ "core: do macro"
(lambda (t)
(t.is (do ((i 0) (j 10 (- j 1))) (i j)) 10)
(t.is (do ((i 0) (j 10 (- j 1))) (null j)) 10)
(t.is (do ((i 0) (j 10 (- j 1))) (undefined j)) 10)
(t.is (do ((i 0) (j 10 (- j 1))) ((zero? j) 10)) 10)))

(test "core: eq?/eqv?"
(lambda (t)
;; TODO
Expand Down

0 comments on commit 5fa64cc

Please sign in to comment.