1
0
mirror of https://github.com/janet-lang/janet synced 2024-11-05 08:16:16 +00:00
janet/test
Calvin Rose 776ce586bc Add line and column combinators to peg.
These capture the line and column number of the current position
in the matched text. This is useful for error reporting as well
as indentation checking.

This works by lazily creating an index on first use that stores all
newline character indices in order. We can then do a binary search on
this to get both line number and column number in log(n) time.
This is good enough for most use cases and doesn't slow down the common case at all
- these will not be commonly used patterns in a hot loop so it is not worth to try and
optimize this at all. Constant time look up should be possible but at
the cost of complicating code and slowing down all matching to check for
new lines.
2020-11-26 18:32:56 -06:00
..
amalg Update Copyright 2020. 2020-01-12 10:50:37 -06:00
fuzzers Make janet_equals and janet_compare non recursive 2020-04-24 16:18:31 -05:00
install Address #470 - hyphen's in native module names. 2020-09-06 15:23:24 -05:00
helper.janet Make sure all test logs go to the same stream. 2020-11-14 15:56:48 -06:00
suite0000.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0001.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0002.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0003.janet Add line and column combinators to peg. 2020-11-26 18:32:56 -06:00
suite0004.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0005.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0006.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0007.janet Rename test suites such that it is easier to add more of them. 2020-08-07 15:34:13 -05:00
suite0008.janet Merge branch 'master' into ev 2020-08-07 19:51:37 -05:00
suite0009.janet Fix #505 - bat int64 parsing. 2020-11-25 09:45:46 -06:00
suite0010.janet Fix #505 - bat int64 parsing. 2020-11-25 09:45:46 -06:00