lantiga / ki

lisp + mori, sweet.js
ki-lang.org
MIT License
478 stars 28 forks source link

Errors with --watch #ok #23

Closed orlin closed 9 years ago

orlin commented 9 years ago

I got sold on using the upgraded --watch option (as it's faster), but that means I can't count on the exit code. This is a patch to send errors to console.error instead of console.log so they can be handled separately even though they often go to the same place. Saying 'Compiled' only if output is generated - there is 'Failed to compile' counterpart. There is always something sent to stdout or stderr - so I can toggle (e.g. AnyBar) a green or red light respectively. This affects only the cli onChange events for the source / include files. The idea is that you start with something that parses / compile to begin with and you save one more or less parenthesis and the code continues to be watched rather than throwing an uncaught exception. I left the lib/ki.js untouched - it doesn't affect my workflow and I didn't want to make unnecessary guesses. We also get to know the first file containing macros that can't parse (with or without -w), in which case there is no further compilation attempted.

lantiga commented 9 years ago

Good idea, thanks!