branch: master commit 3944181fa7785ef0136ad904ecc89b92c7401951 Author: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com> Commit: Jackson Ray Hamilton <jack...@jacksonrayhamilton.com>
Renames. Cleanup. --- Makefile | 10 +++++----- README.md | 6 +++--- context-coloring.el | 11 ++--------- languages/javascript/{bin => binaries}/cli.js | 0 languages/javascript/{bin => binaries}/scopifier | 0 languages/javascript/{lib => libraries}/escope.js | 0 languages/javascript/{lib => libraries}/esprima.js | 0 .../javascript/{lib => libraries}/estraverse.js | 0 languages/javascript/scopifier.js | 4 ++-- {lib => libraries}/.dir-locals.el | 0 {lib => libraries}/ert-async.el | 0 {lib => libraries}/js2-mode.el | 0 scopifier-example.png => scopifier.png | Bin 2516 -> 2516 bytes 13 files changed, 12 insertions(+), 19 deletions(-) diff --git a/Makefile b/Makefile index 2b6569c..e718601 100644 --- a/Makefile +++ b/Makefile @@ -5,23 +5,23 @@ all: clean compile test bench: ${EMACS} -Q \ -L . \ - -L lib \ + -L libraries \ -l context-coloring \ -l benchmark/context-coloring-benchmark \ -f context-coloring-benchmark-run compile: ${EMACS} -Q -batch \ - -L lib \ - -f batch-byte-compile *.el lib/*.el + -L libraries \ + -f batch-byte-compile *.el libraries/*.el clean: - rm -f *.elc lib/*.elc + rm -f *.elc libraries/*.elc test: ${EMACS} -Q -batch \ -L . \ - -L lib \ + -L libraries \ -l ert \ -l ert-async \ -l context-coloring \ diff --git a/README.md b/README.md index 3d975fc..b2e2c57 100644 --- a/README.md +++ b/README.md @@ -10,13 +10,13 @@ Highlights code according to function context. scope is a different color, and code within such functions is another color, and so on. - Identifiers retain the color of the scope in which they were declared. -- Comments are gray. +- Comments are a neutral color. Lexical scope information at-a-glance can assist a programmer in understanding the overall structure of a program. It can also help curb nasty bugs like name shadowing or unexpected assignment. A rainbow can indicate excessive complexity. A spot of contrast followed by an assignment expression could be a -side-effect... or, the state of a closure could be undergoing change. +side-effect. The state of a closure could be undergoing change. This coloring strategy is probably more useful than conventional *syntax* highlighting. Highlighting keywords can help one to detect spelling errors, and @@ -133,7 +133,7 @@ applying level 1 coloring to the range [9, 23) would result in the following coloring: <p align="center"> - <img alt="Screenshot of ranges [1, 24) and [9, 23)." src="scopifier-example.png" title="Screenshot"> + <img alt="Screenshot of ranges [1, 24) and [9, 23)." src="scopifier.png" title="Screenshot"> </p> If there is an abstract syntax tree generator for your language, you can walk diff --git a/context-coloring.el b/context-coloring.el index 5fa0383..9398c02 100644 --- a/context-coloring.el +++ b/context-coloring.el @@ -22,14 +22,7 @@ ;;; Commentary: -;; Colors code by scope, rather than by syntax. - -;; A range of characters encompassing a scope is colored according to its level; -;; the global scope is white, scopes within the global scope are yellow, scopes -;; within scopes within the global scope are green, etc. Variables defined in a -;; parent scope which are referenced from child scopes retain the same color as -;; the scope in which they are defined; a variable defined in the global scope -;; will be the same color when referenced from nested scopes. +;; Highlights code according to function context. ;; To use, add the following to your ~/.emacs: @@ -397,7 +390,7 @@ Invokes CALLBACK when complete." `(:type shell-command :executable "node" :command ,(expand-file-name - "./languages/javascript/bin/scopifier" + "./languages/javascript/binaries/scopifier" context-coloring-path))) (defvar context-coloring-js2-colorizer diff --git a/languages/javascript/bin/cli.js b/languages/javascript/binaries/cli.js similarity index 100% rename from languages/javascript/bin/cli.js rename to languages/javascript/binaries/cli.js diff --git a/languages/javascript/bin/scopifier b/languages/javascript/binaries/scopifier similarity index 100% rename from languages/javascript/bin/scopifier rename to languages/javascript/binaries/scopifier diff --git a/languages/javascript/lib/escope.js b/languages/javascript/libraries/escope.js similarity index 100% rename from languages/javascript/lib/escope.js rename to languages/javascript/libraries/escope.js diff --git a/languages/javascript/lib/esprima.js b/languages/javascript/libraries/esprima.js similarity index 100% rename from languages/javascript/lib/esprima.js rename to languages/javascript/libraries/esprima.js diff --git a/languages/javascript/lib/estraverse.js b/languages/javascript/libraries/estraverse.js similarity index 100% rename from languages/javascript/lib/estraverse.js rename to languages/javascript/libraries/estraverse.js diff --git a/languages/javascript/scopifier.js b/languages/javascript/scopifier.js index 7a82570..6b46392 100644 --- a/languages/javascript/scopifier.js +++ b/languages/javascript/scopifier.js @@ -1,7 +1,7 @@ 'use strict'; -var escope = require('./lib/escope'), - esprima = require('./lib/esprima'); +var escope = require('./libraries/escope'), + esprima = require('./libraries/esprima'); // Given code, returns an array of tokens for context-coloring. function scopifier(code) { diff --git a/lib/.dir-locals.el b/libraries/.dir-locals.el similarity index 100% rename from lib/.dir-locals.el rename to libraries/.dir-locals.el diff --git a/lib/ert-async.el b/libraries/ert-async.el similarity index 100% rename from lib/ert-async.el rename to libraries/ert-async.el diff --git a/lib/js2-mode.el b/libraries/js2-mode.el similarity index 100% rename from lib/js2-mode.el rename to libraries/js2-mode.el diff --git a/scopifier-example.png b/scopifier.png similarity index 100% rename from scopifier-example.png rename to scopifier.png