Skip to content

Commit

Permalink
Move from pegjs-coffee-plugin to pegjs-each-code
Browse files Browse the repository at this point in the history
- Self-hosted coffee compilation instead of dependency on (old version
  of) jashkenas/coffee-script.
- No more `@variable`s for global variables and helper functions, which
  involves having to use `=>` instead of `->` sometimes. Now, just use
  `variable` like in plain JavaScript.
- It is now possible to do `a:Foo? { a ?= []; rp a}` as expected.
- Better error messages. Partly because CSR has better error messages
  than jashkenas/coffee-script@1.6.3, partly because you also get to
  know in which rule the code resides. The error messages will get line
  and column numbers in the .pegcoffee file as soon as
  lydell/pegjs-each-code#1 is resolved.
- No more weird hacks in the initializer.
- Note: lib/parser.js gets pretty bloated because of michaelficarra#323.
  • Loading branch information
lydell committed Aug 20, 2014
1 parent cabb60a commit fd69f35
Show file tree
Hide file tree
Showing 6 changed files with 2,274 additions and 1,381 deletions.
6 changes: 3 additions & 3 deletions Makefile
Expand Up @@ -8,7 +8,7 @@ TEST = $(wildcard test/*.coffee | sort)
ROOT = $(shell pwd)

COFFEE = bin/coffee --js --bare
PEGJS = node_modules/.bin/pegjs --cache --plugin pegjs-coffee-plugin
PEGJS = node_modules/.bin/pegjs --cache --plugin ./lib/pegjs-coffee-plugin
MOCHA = node_modules/.bin/mocha --compilers coffee:./register -u tdd
CJSIFY = node_modules/.bin/cjsify --export CoffeeScript
MINIFIER = node_modules/.bin/esmangle
Expand All @@ -30,9 +30,9 @@ lib/bootstrap: lib
mkdir -p lib/bootstrap


lib/parser.js: src/grammar.pegcoffee bootstraps lib
lib/parser.js: src/grammar.pegcoffee bootstraps lib lib/pegjs-coffee-plugin.js
$(PEGJS) <"$<" >"$@.tmp" && mv "$@.tmp" "$@"
lib/bootstrap/parser.js: src/grammar.pegcoffee lib/bootstrap
lib/bootstrap/parser.js: src/grammar.pegcoffee lib/bootstrap lib/pegjs-coffee-plugin.js
$(PEGJS) <"$<" >"$@"
lib/bootstrap/%.js: src/%.coffee lib/bootstrap
$(COFFEE) -i "$<" >"$@"
Expand Down

0 comments on commit fd69f35

Please sign in to comment.