There is currently syntax-highlighting for Emerald in the following environments:
An Emerald syntax-highlighting specification consists of the following:
- A list of keywords
- A list of built-ins
- A specification of what comments are like
- A specification of what string and character constants are like
- A specification to ignore casing (Emerald is case-insensitive)
For points 1-2, we make use of the shell-scripts bin/getkeywords.sh
and bin/getbuiltins.sh
, which are expected to be present in the
source directory of an Emerald compiler. These scripts are expected to
print a list of keywords and built-ins, respectively; separated, and
terminated by line breaks.
These lists are then munged to fit whatever mode we are generating
(e.g., prefixed by syn keyword
for vim mode), and wrapped to fulfil
points 3-5 above. This process is guided by a common bash
template.
This template assumes that a number of scripts are in your PATH
. In
particular, the scripts in the scripts and
envs/common directories, as well as an environment
specific-directory (e.g., envs/vim when generating a vim
mode). The Makefile
takes care of this PATH
-handling
for you.
Overall, we use a template for the following reasons:
- It allows to leverage
bin/getkeywords.sh
andbin/getbuiltins.sh
(reducing maintenance effort) - It allows to include the license verbatim (reducing text duplication)
- It allows to include configuration identification (e.g., git commit IDs)
The Makefile
assumes that you have an Emerald compiler
in ../old-emerald/
(relative to this repository), and executes the
bash template for you.
The Makefile
assumes that you have an Emerald compiler
in ../old-emerald/
(relative to this repository).
You can override this as follows:
$ make EMERALD_PATH="<some other path> <target>"
As for the possible <target>
s, see below.
Type make vim
to make build/emerald.vim
.
Type make listings
to make build/listings-emerald.tex
This repository uses the Python library
bumpversion
to bump
versions in a structured manner. For instance, bumpversion
allows to
both issue a commit, add a tag, and update the
README.md
at the same time.