1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 00:06:16 +00:00
Commit Graph

31 Commits

Author SHA1 Message Date
Calvin Rose
ed72dcf82d Rename the header <janet/janet.h> to <janet.h>
Makes it easier to use and remember, and makes the
variable `module/*headerpath*` make more sense.
2019-02-18 20:13:35 -05:00
Calvin Rose
ffc14f6019 Oops, peg option issue fixed. 2019-02-17 21:25:30 -05:00
Calvin Rose
1e70c97ef0 Allow enabling/disabling of peg module.
Use compiler define -DJANET_NO_PEG to turn off the peg module.
2019-02-17 21:22:03 -05:00
Calvin Rose
6d5ff43de7 Make amalg build cleaner.
Don't pull in a global header <janet/janet.h> unless we need to.
2019-02-16 23:33:24 -05:00
Calvin Rose
fe27df528c Boot core library from image rather than source
This should speed up start time and reduce malloc/free
usage to about 15% of what is what previously for startup.
The current cost is slightly larger binary as the representaion
of the image is currently less compact than source code.
2019-02-08 00:44:30 -05:00
J.-F. Cap
960cf76eb5 Experimental getter/setter for abstract types 2019-02-05 17:14:13 +01:00
Calvin Rose
19e59705b9 Main rule in peg is always 0
After we changed peg bytecode emission to
preallocate space for an instruction before
emitting sub rules, the rules are numbered
in the order that they are compiled. This means
that the main rule is always 0.
We can remove the explicitly stored main rule in
the peg structure.
2019-01-31 23:39:33 -05:00
Calvin Rose
611543c48b Add source amalgamation
The amalgamated source concatenates all sources
to a file janet.c which can be used for
embedding janet, much in the same way as sqlite
or mongoose.
2019-01-24 00:15:58 -05:00
Calvin Rose
b4934ceddc Make parser errors a bit better for files with no closing
delimiters.
2019-01-17 23:43:46 -05:00
Calvin Rose
c4114fbcdb Add quote special to peg syntax to make captures terser. 2019-01-17 19:28:42 -05:00
Calvin Rose
95f2bbe0a0 Add highlight.janet tool which can highlight
janet source code and output html or terminal escaped code.
Also made re entrant calls into the vm provide better
error messages.
2019-01-17 18:12:26 -05:00
Calvin Rose
2c1b506213 Add tagged captures for a better (more correct) form of look behind. 2019-01-16 22:38:11 -05:00
Calvin Rose
612a245961 More work on peg. Disable indexed backrefs and replace substitution
with accumulation.
2019-01-16 21:11:55 -05:00
Calvin Rose
82cddef5bb Update man page and add early exit to number scanning for parser. 2019-01-16 12:32:33 -05:00
Calvin Rose
d0fc29338c Add error special form in Peg to allow construction of grammar errors
for more useful grammars that could eventually be used in a compiler.
2019-01-15 16:04:47 -05:00
Calvin Rose
4eeadd7463 Add optional form to peg (shorthand for (between 0 1 patt)). 2019-01-15 14:08:03 -05:00
Calvin Rose
3a9b50ea4a Update peg doc and remame some peg specials. 2019-01-14 22:17:13 -05:00
Calvin Rose
1304f9263b Update peg docs and make bad backrefs not error the whole pattern, but just cause the current match attempt to fail. 2019-01-14 21:47:55 -05:00
Calvin Rose
90313afd40 Update PEG documentation and peg syntax.
Disable tail calls in the root scope for better
stacktraces, as the root scope may contain a single call
to a failing function, as in the case of the test suite.
2019-01-14 20:41:32 -05:00
Calvin Rose
99f176f37b Fix windows build warnings. 2019-01-14 17:48:32 -05:00
Calvin Rose
d0ec89c7c1 Update Matchtime captures to not include all of the
matched text automatically, and fix pattern recursion
in grammars.
2019-01-14 17:44:21 -05:00
Calvin Rose
170e785b72 Fix recursion in grammars. 2019-01-14 15:06:35 -05:00
Calvin Rose
192705113e Add Matchtime captures to peg (Equivalent to LPegs lpeg.Cmt).
This allows that pattern to call an external function to
check if some text should match or not. This allows for
matching any possible language a computer can recognize.
2019-01-14 11:45:45 -05:00
Calvin Rose
2cd489b9d4 Address windows build warnings. 2019-01-14 00:09:27 -05:00
Calvin Rose
ff0d3a0081 Compile pegs to bytecode with (peg/compile). Peg
performance is improved, and peg syntax has been expanded with a few
more keywords.
2019-01-13 23:54:41 -05:00
Calvin Rose
282c02c475 Update comments and text. 2019-01-12 20:22:03 -05:00
Calvin Rose
798c88b4c8 Update peg to allow functions over captures. Update C API
to make janet function calls easier and faster from C (still
needs an object pool for fibers, though). Fix bug in scan-number
and add many more peg tests.
2019-01-12 17:31:15 -05:00
Calvin Rose
83f4a11bf3 Add some more tests, add parameterized captures to patterns,
and fix some bugs.
2019-01-12 11:04:47 -05:00
Calvin Rose
d7626f8c57 Add more capturing capabilities including substitutions, as well
as back references for PEGs. More documentation is needed for PEG
syntax, but the amount required will need an external document, not
just a docstring.
2019-01-12 10:16:25 -05:00
Calvin Rose
1efca2ebe7 Add some preliminary capturing ability to PEGs. 2019-01-11 21:09:49 -05:00
Calvin Rose
40845b5c1b Initial peg implementation. Tree walk interpretted with
no captures, so not yet ready.
2019-01-11 19:22:24 -05:00