| 1 |
Leg 0.1.3 |
| 2 |
========= |
| 3 |
|
| 4 |
This is a release of Leg, a Lua library exporting a complete Lua 5.1 grammar |
| 5 |
and a small API for user manipulation. |
| 6 |
|
| 7 |
|
| 8 |
Dependencies |
| 9 |
------------ |
| 10 |
|
| 11 |
* You need, understandably, to have Lua 5.1 up and running to be able to use |
| 12 |
this library :) |
| 13 |
|
| 14 |
* Also, Leg uses LPeg 0.7 extensively for pattern matching, so LPeg is |
| 15 |
expected be installed. You can get LPeg at |
| 16 |
|
| 17 |
http://www.inf.puc-rio.br/~roberto/lpeg.html |
| 18 |
|
| 19 |
|
| 20 |
Basic Installation |
| 21 |
------------------ |
| 22 |
|
| 23 |
There are three ways to install Leg: |
| 24 |
|
| 25 |
* `make install` |
| 26 |
|
| 27 |
Run `make install`, and a directory called `leg` with the source files inside |
| 28 |
will be put in a specific path. Tweak Makefile's LUA_LIB variable to |
| 29 |
indicate the appropriate path for your system; Makefile ships with it set |
| 30 |
to /usr/local/share/lua/5.1 . Make sure you have the proper permissions to |
| 31 |
access the path you want; if not or in doubt, use the `make` option below. |
| 32 |
|
| 33 |
* `make` or `make leg` |
| 34 |
|
| 35 |
A directory `leg` will be created in your working directory, with the |
| 36 |
source files inside. Just put it in a LUA_PATH-visible place and you're |
| 37 |
ready to go. |
| 38 |
|
| 39 |
* by hand |
| 40 |
|
| 41 |
If you don't have, don't want to or can't use `make`, you can just put all |
| 42 |
the files in `src` inside a directory called `leg`, and put that directory |
| 43 |
in your LUA_PATH. |
| 44 |
|
| 45 |
|
| 46 |
Read the Lua Reference Manual for the LUA_PATH and the LUA_CPATH syntax |
| 47 |
(http://www.lua.org/manual/5.1/manual.html#pdf-package.path). |
| 48 |
|
| 49 |
|
| 50 |
Copyright |
| 51 |
--------- |
| 52 |
|
| 53 |
See the file "COPYRIGHT". |
| 54 |
|
| 55 |
|
| 56 |
Bug Fixes and New Stuff |
| 57 |
----------------------- |
| 58 |
|
| 59 |
See the file "release". |
| 60 |
|
| 61 |
|
| 62 |
Testing |
| 63 |
------- |
| 64 |
|
| 65 |
You can either: |
| 66 |
|
| 67 |
* run `make test`; or |
| 68 |
|
| 69 |
* go to the directory `tests` and run `test.lua`. |
| 70 |
|
| 71 |
Both do the same thing. |
| 72 |
|
| 73 |
|
| 74 |
Work to do |
| 75 |
---------- |
| 76 |
|
| 77 |
* Improve error checking: currently it is bolted on and not extensible, and |
| 78 |
different patterns react differently to mismatching: scanner.STRING throws |
| 79 |
an error when a mismatch happens, but some errors simply return false and an |
| 80 |
error message. I don't know a good way to handle this. |
| 81 |
|
| 82 |
* A better API for grammar extensions. The current one is very ad hoc, and |
| 83 |
requires some fine tuning to make sure it works correctly. Metalua's API |
| 84 |
seems interesting, and was originally based on Parsec. Investigation is |
| 85 |
under way. |
| 86 |
|
| 87 |
* The binary operators' precedences isn't enforced in the grammar; one must |
| 88 |
enforce it by hand when capturing expressions. This can be very annoying. |
| 89 |
|
| 90 |
* More thorough testing. |