1
1
mirror of https://github.com/kanaka/mal.git synced 2024-09-17 16:47:22 +03:00
Commit Graph

69 Commits

Author SHA1 Message Date
Nicolas Boulenguez
e6d41de4d5 load-file: accept empty file or final comment, return nil
Let `load-file` append a new line in case last line contains a
comment.

Also append `nil` so that the return value is predictible. Remove the
existing explicit `nil` from existing sources.

Adapt documentation and tests.
2019-07-28 13:08:05 +02:00
Nicolas Boulenguez
26ced15b31 Remove gensym, inc and or from step files.
* Move `gensym` and `inc` from step files to `lib/trivial.mal`.
* Move `or` from step files to `lib/test_cascade.mal`.
  Shorten it because `(first ())` returns `nil`
* Update process and tests accordingly (not the figures yet).
2019-07-09 14:05:29 +02:00
Ben Harris
4b66bbdf6a gnu-smalltalk, go, js, lua, php, rust, ts: Detect more unterminated strings.
Rather than treating anything beginning and ending with '"' as a valid
string, we now use a regexp to detect a valid string and treat any other
token starting with '"' as an error.
2019-05-16 22:06:02 +01:00
Nicolas Boulenguez
14ab099cea gensym: hide the counter in an environment, define inc in stepA.
tests: check that `inc` is present in stepA.
nasm: split lines in mal_startup_string for readability.
objpascal: remove obsolete .orig file
swift: remove an unneeded line in template
swift4: remove duplicate definition of `or` macro
2019-05-11 16:37:26 +02:00
Joel Martin
b0e8fd0703 Move web files into docs/. Build docs/web/mal.js
To update the docs/web/mal.js script run `make -C js web/mal.js` from the
top-level (js/web is a symlink to docs/web).
2019-03-21 00:14:56 -05:00
Joel Martin
c4269f9bf5 Convert to loccount based stats calculation. 2019-03-20 23:34:21 -05:00
Joel Martin
18f0ec2150 Runtest should fail on bad test data. Fix interop tests.
The interop tests weren't updated when regex support was added to
runtest for matching output data. This was causing a bunch of
implementations to silently fail while testing interop. Fix runtest.py
to fail on bad test data and fix 21 implementations with the old style
output matches.
2019-01-28 10:27:41 -06:00
Joel Martin
dd7a4f55f3 Test uncaught throw, catchless try* . Fix 46 impls.
Fixes made to: ada, c, chuck, clojure, coffee, common-lisp, cpp,
crystal, d, dart, elm, erlang, es6, factor, fsharp, gnu-smalltalk,
groovy, guile, haxe, hy, js, livescript, matlab, miniMAL, nasm, nim,
objc, objpascal, ocaml, perl, perl6, php, plsql, ps, python, r,
rpython, ruby, scheme, swift3, tcl, ts, vb, vimscript, wasm, yorick.

Catchless try* test is an optional test. Not all implementations
support catchless try* but a number were fixed so they at least don't
crash on catchless try*.
2018-12-12 14:18:26 -06:00
Joel Martin
970935dac9 awk, bash, c, coffee, js: fix errors. 2018-11-30 14:57:45 -06:00
Joel Martin
e10ceff503 Update JS impls: use ffi-napi and Ubuntu 18.04 2018-11-28 17:12:17 -06:00
Vasilij Schneidermann
9e1b175229 js, lua, perl, python, racket: Add number?, fn?, macro? 2017-10-11 10:28:04 +02:00
Joel Martin
ea02f46445 Fix unescaping in bash, basic, es6, js, ruby, rust. 2017-09-28 07:40:47 -05:00
Joel Martin
2a368ba6df JS, Rexx: fix step build deps. 2017-09-14 23:39:00 -05:00
Dov Murik
d953db84fc js: Fix interop, update web REPL page
* js* renamed to js-eval and is no longer a special form (just a normal
  function in core.js)
* . is no longer a special form (just a normal function in core.js)
* fixed object/method parsing of first argument to .
* added tests for .
* updated mal.html: "Mal at a glance" shows all Mal functions
2016-06-14 23:21:38 -04:00
Joel Martin
20e8dea043 Refactor to use run scripts, remove *_RUNSTEP
- Add */run script for every implementation.

- Refactor Clojure build to allow individual jar files for each step.

- Update FFI version for es6 and miniMAL to work with newer node
  versions.

The run scripts for the following could use some additional
refactoring:
- java: build individual step jar, use java -jar instead of mvn to run
- plpgsql: maybe combine plpgsql/run and plpgsql/wrap.sh
- vhdl: combine vhdl/run and vhdl/run_vhdl.sh
- vimscript: combine vimscript/run and vimscript/run_vimscript.sh
2016-05-18 22:29:18 -07:00
Dov Murik
5f5c06e20c js: Fix setting *ARGV* in step6 & step7 2016-05-11 16:11:18 -04:00
Joel Martin
65960763f2 JS: fix typo in interop.js 2016-04-11 12:15:21 -05:00
Joel Martin
efa2daef57 Fix empty list eval in step2 for most languages.
I think the only remaining ones are ada, elisp, factor, and rust.
2016-04-02 18:40:49 -05:00
Dov Murik
daf52a0aa8 js: Fix exception on literal empty list
Issue #190
2016-03-27 22:16:57 -04:00
GL
db1f2b8d8f Update ffi dep in js implementation
The js dep won't compile cleanly without this bump because the old ffi version won't build properly 
(using latest Arch Linux as of Mar 14 2016, probably failing on other distros as well).  

ffi 2.0.0 builds cleanly.
2016-03-14 21:59:40 -07:00
Joel Martin
dca6b58578 Tests: move step5 non-TCO tests to per impl.
- Remove most of the step5 excludes in the Makefile except for ones
  which don't have TCO capability at all (or the implementation is too
  slow): bash, make, mal, matlab.

- Make perf_EXCLUDES consistent with other excludes.

- Add a print-FOO target which prints the resolved value of Makefile
  variable FOO. For example, `make print-IMPLS` to print the list of
  implementations.
2016-03-14 23:39:21 -05:00
Joel Martin
67136d8c41 js: fix readline with blank prompt. 2016-03-14 22:23:22 -05:00
Joel Martin
9044b1fdb1 Merge branch 'master' into issue_166_string_ops 2016-02-24 12:00:08 -06:00
Joel Martin
8e2d4a4ccb Dist/packaging for most impls. erlang, racket *ARGV* fixes.
Also in this commit:
- fix *ARGV* setup in erlang and racket.
- print startup message in fsharp

Dist/packaging support for most implementations and also generate
a */mal standalone app for most languages. The following
implementations still have ability to generate a single */mal
standalone application:
    - guile
    - julia
    - matlab (mkoctfile doesn't actually package up source files)
    - swift
    - vb (mkbundle error)

Also, the following are mostly packaged into a single file but need
some module dependencies
    - coffee: requires node_modules/ffi
    - es6: requires node_modules/ffi
    - js: requires node_modules/ffi
    - lua: module 'readline' not found
    - miniMAL: cannot find module '/mal/node_readline.js'
    - r: needs lib directory
2016-02-24 00:45:40 -06:00
Joel Martin
5245b079e1 Add dist targets to most implementations.
TODO: factor groovy guile julia matlab miniMAL swift
2016-02-24 00:33:20 -06:00
Joel Martin
4c14a8b835 bash, c, clojure, coffee, es6, js: add seq/string?
Issue #166.
2016-02-11 09:18:46 -06:00
Dov Murik
8d1e25ac24 coffee, es6, js, perl, python, ruby: Fix (first nil) and (rest nil) 2016-02-03 21:23:46 -05:00
Joel Martin
411abc90f4 Merge pull request #146 from dubek/fix-macro-eval
Fix macro eval in 24 impls
2016-01-26 14:16:55 -06:00
Dov Murik
bfa3dd3593 coffee, es6, js, mal, miniMAL: fix macro result evaluation
Issue #142
2016-01-25 21:22:21 -05:00
Dov Murik
48572759b7 Add gensym and clean or macro to stepA of 12 implementations (part 1)
* go
* guile
* js
* mal
* miniMAL
* ocaml
* ps
* python
* racket
* ruby
* tcl
* vimscript
2016-01-23 00:31:51 -05:00
Dov Murik
3dcaa6ce43 js: Fix exception in `(nil) 2015-12-28 10:22:58 +02:00
Joel Martin
a0b63ee477 hash-map equality: bash, c, coffee, cs, es6, ...
- hash-map equality support for bash, c, coffee, cs, es6, java, js,
  julia, make, php.
- also, add another test to catch another hash-map in-equality: same
  keys, different values
2015-11-16 23:28:58 -06:00
Joel Martin
8d78bc26bf All: fix read/print of \\, and \n 2015-10-30 22:05:49 -05:00
Joel Martin
f15b4021db All: show comments with stats target.
- Put guile into correct alphabetical order.
2015-10-26 22:33:49 -05:00
Joel Martin
e152d48827 travis: add bash, c, make to test matrix. 2015-10-05 18:55:00 -05:00
Joel Martin
f7824465dc Another travisCI attempt for JS and python (matrix). 2015-10-05 17:25:48 -05:00
Joel Martin
cf1d3eae66 Add .travis.yml and js/Dockerfile
- .travis.yml: currently pulls js docker image and runs tests for js
  impl only.
2015-10-05 16:46:21 -05:00
Joel Martin
3858f4e6c9 README.md count to 38. JS and ES6 build fixes. 2015-08-06 15:47:39 -05:00
Joel Martin
dbac60df00 All: move metadata, atoms, readline, conj to stepA.
- Move some of the more optional things (conj, readline) to stepA. All
  implementations pass step9 tests now.
- Move metadata and atoms to stepA.
- Update step9 and stepA diagrams.
2015-03-14 17:17:14 -05:00
Joel Martin
c9de2e82ed Tests: add testing Dockerfile. Impl fixes.
- tests/docker/Dockerfile: specifies full docker image containing all
  tools/languages (except matlab).
- tests/docker-build.sh: build above image.
- tests/docker-run.sh: launch above image.
    Example: ./tests/docker-run.sh make test^js^step2
- Various fixes across multiple languages:
    - Unicode fixes for bash and R on Ubuntu Utopic
    - readline history fixes for when ~/.mal-history is not available
      or readable/writable. No fatal errors.
    - fixes to work with perl 5.20 (and still perl 5.18)
2015-03-11 22:22:35 -05:00
Joel Martin
10b07148ba All step0: add test, fix bugs, remove step0 eval. 2015-03-07 09:04:07 -06:00
Joel Martin
90f618cbe7 All: rename stepA_interop to stepA_mal
Also, add missed postscript interop tests.
2015-02-28 11:09:54 -06:00
Joel Martin
2ab1e5845c Multiple: interop enhancements. 2015-02-28 10:35:04 -06:00
Joel Martin
3fb3743ff4 miniMAL: add classOf and fix printing. 2015-02-25 23:01:16 -06:00
Joel Martin
b8ee29b22f All: add keywords.
Also, fix nth and count to match cloure.
2015-01-09 16:16:50 -06:00
Joel Martin
01c9731649 All: swap step9,A. Fixes for bash, C, perl.
step9_interop -> stepA_interop
stepA_more -> step9_try

C: fix glib headers
bash: behavior change of declare -A and pattern replacement.
perl: squelch new 5.18 warnings related to switch/given statement.

Also, include some in-progress interop related files.
2015-01-06 21:57:24 -06:00
Joel Martin
17e1c5f9f4 go: add step5_tco. Refactor env.
Move EnvType interface definition to types.go. Remove Env pointers.
2014-10-06 21:03:03 -05:00
Joel Martin
cc021efe10 Add step5/9 tests for impls that support it.
- Also remove broken make/tests/*.mk tests. Not used any more.
2014-04-27 17:58:48 -05:00
Joel Martin
b58698b257 JS: add localStorage history load/save. Slurp using sync XHR. 2014-04-27 16:55:31 -05:00
Joel Martin
a9993e0a68 JS web: use/import to Himera style web REPL. 2014-04-26 16:03:03 -05:00