Simon Cruanes
ecfc116de4
Merge 3b10a14c93 into 02ac5bd78a
2024-07-26 20:55:43 +02:00
Simon Cruanes
0b0dd83423
reformat all the things
2024-05-13 20:57:53 -04:00
Simon Cruanes
8d5b012111
update readme and CCParse to remove uses of CCVector
2023-10-24 19:53:42 -04:00
Simon Cruanes
1a23731730
remove conditional over OCaml >= 4.08
...
in particular, all the let-ops are now unconditional!
2023-06-24 15:22:21 -04:00
Simon Cruanes
bbfbe0f770
fix many, many warnings
2023-06-06 22:16:20 -04:00
Simon Cruanes
9f1ecdba27
another fix for CCParse and slices
2023-06-01 15:03:46 -04:00
Simon Cruanes
c7de9389b0
fix bug in CCParse
2023-06-01 15:03:46 -04:00
Simon Cruanes
10a8a7ce0f
fix(CCParse): fix issue in recurse
...
recursively parsing a slice means we temporarily switch the state
to the slice; but once the sub-parser returns we need to switch back to
the old state.
2023-06-01 15:03:46 -04:00
Simon Cruanes
7ec9cd94dc
details
2023-04-09 14:59:32 -04:00
Simon Cruanes
84173382db
feat(CCParse): add take_until_success
...
this reads a slice using the given parser to parse the end delimiter
(e.g "end gpg signature" 😉 )
2023-04-07 11:45:12 -04:00
Simon Cruanes
10865eaced
reformat
2022-07-04 13:36:06 -04:00
Simon Cruanes
b695918e99
move all core tests to new testlib
2022-07-02 00:29:25 -04:00
Simon Cruanes
e7dad1b54a
fix(parse): rename function in test case
...
like Grant remarked, the chaining function is actually
right-associative, not left-associative
2022-06-07 16:19:28 -04:00
Simon Cruanes
b837509de9
remove many more shims
2022-02-21 21:52:06 -05:00
Simon Cruanes
bee23722ea
fix: use labels in CCParse
2021-12-02 11:38:22 -05:00
Simon Cruanes
9123f7907f
feat(ccparse): expose pos to get current pos; improve perf
...
perf of obtaining many positions is now better because we cache line
offsets, which means computing a line,col pair is just a O(ln n) bisect
away.
2021-12-01 16:05:20 -05:00
Simon Cruanes
9c72797515
minor changes
2021-09-25 20:51:18 -04:00
Simon Cruanes
b8fa400465
a test to ensure chars1_if p = take1_if p >|= Slice.to_string
2021-09-25 20:48:23 -04:00
Simon Cruanes
8f9ecf5f41
some fixes related to review
2021-09-24 22:45:17 -04:00
Simon Cruanes
d46a679b3b
fix bug in CCParse.line, add set_current_slice, fix tests
2021-06-06 23:00:51 -04:00
Simon Cruanes
352fc10d3b
more doc for CCParse
2021-06-06 22:49:43 -04:00
Simon Cruanes
1517f64f55
CCParse: add slice and the ability to recurse on them
...
the idea is that it's often convenient to split the input into smaller
part (e.g. lines), or do a first pass of parsing that just returns a
slice of the input; and then later to use another parser on that slice
to extract the actual data. The new notion of `slice` allows that,
while preserving locations wrt the original input.
2021-06-06 22:42:20 -04:00
Simon Cruanes
88fe234a4c
add CCParse.{char_fold, chars_fold_map}
...
useful for non-trivial lexing
2021-06-06 18:49:55 -04:00
Simon Cruanes
7081a411c8
small doc change
2021-06-06 17:16:26 -04:00
Simon Cruanes
c10ae8d84f
parse: fix bugs, add tests, add U.{in_paren,in_paren_opts,option}
2021-06-06 17:08:57 -04:00
Simon Cruanes
37af485971
parse: expose Position module, add or_, both, lookahead, U.bool
2021-06-06 15:08:13 -04:00
Simon Cruanes
171b4ddcd9
parse: deprecate try_, rename new function try_opt
2021-06-06 14:14:48 -04:00
Simon Cruanes
0ec40c2331
CCParse: heavy refactoring, many new functions
2021-06-06 14:14:48 -04:00
Simon Cruanes
7318162c55
wip: rework CCParse
2021-06-06 14:14:48 -04:00
Simon Cruanes
bf0227d404
feat: on 4.08, support let operators
...
close #276
2019-12-14 12:08:48 -06:00
Simon Cruanes
1b5b23a8f1
remove unlabel, remove all traces of Result
2019-12-10 20:48:38 -06:00
Simon Cruanes
080f81a9dd
fix(parse): error in many
2019-09-06 14:12:08 -05:00
Simon Cruanes
96ed8a37ab
feat: introduce shim modules for 4.08 compat
...
- also make `unlabel` an explicit operation
- use `Stdlib` instead of `Pervasives`
- remove some warnings in Format
2019-06-14 18:26:14 -05:00
Simon Cruanes
2a9795090b
test: improve perf by changing random gens
2018-10-13 18:52:22 -05:00
nathan moreau
3e2fbce3ee
Comments - few changes
2018-02-07 14:36:03 +01:00
Simon Cruanes
8f46fdb6d2
move to jbuilder ( closes #165 )
2018-01-14 17:43:56 -06:00
Jacques-Pascal Deplaix
6d2063ded4
Internally shadow polymorphic operators and functions from Pervasives
2018-01-14 23:32:13 +00:00
Simon Cruanes
03fd42e67d
reindentation
2017-01-25 00:08:12 +01:00
Simon Cruanes
72d43c6eeb
add CCParse into core, a simple, lightweight version of parser combs
2016-11-03 20:10:18 +01:00