Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync from upstream katef/libfsm main #27

Merged
merged 198 commits into from
Oct 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
1a3e038
queue: Fix a read past the end of the queue.
silentbicycle May 15, 2024
18816b1
Merge pull request #467 from katef/sv/fix-queue-memmove-overrun
katef May 15, 2024
2c78478
First cut at introducing fsm_intersect_charset(), exposed as fsm -U.
katef May 25, 2024
073305b
Merge pull request #470 from katef/kate/intersect-charset
katef May 29, 2024
ecb9388
Refactoring: No need to carry lexical positions in the ast_count node.
katef May 29, 2024
07e8fc1
Refactoring: No need to carry lexical positions in the ast_expr .rang…
katef May 29, 2024
bf46a2c
Whitespace.
katef May 29, 2024
51c42fa
Refactoring: No need to mark group start/end for expr in general.
katef May 29, 2024
f0da88d
Refactoring: No need for <mark-expr>.
katef May 29, 2024
94ffdcc
Add fsm_vacuum, which reduces the state array when over-allocated.
silentbicycle May 29, 2024
68c5710
Whitespace.
katef May 30, 2024
e9d190a
Refactoring: No need to keep dialect-dependent parser state here.
katef May 30, 2024
3435f50
Move `FSM_DEFAULT_STATEALLOC` to fsm.c.
silentbicycle May 30, 2024
80e9311
Merge pull request #471 from katef/kate/ast-pos
katef May 30, 2024
0a5e6fb
Consolidate PCRE unsupported cases.
katef May 27, 2024
8330d57
Fabricate error reporting for RE_EUNSUPPORTED through AST analysis.
katef May 30, 2024
61772d0
Whitespace.
katef May 30, 2024
8feff14
fsm_vacuum: Change return type to bool.
silentbicycle May 30, 2024
6147860
Call fsm_vacuum at the end of fsm_minimise.
silentbicycle May 30, 2024
201637d
Merge pull request #473 from katef/kate/consolidate-unsupported
katef May 30, 2024
1732de7
Merge pull request #472 from katef/sv/add_fsm_vacuum
katef May 30, 2024
748b7af
Add fsm_new_statealloc(), to pre-allocate to a known number of states.
katef May 30, 2024
65d8624
Merge pull request #474 from katef/kate/fsm_new_statealloc
katef May 30, 2024
a3fb7d7
Add `void* opaque` to vmc codegen too, disable unused warning.
silentbicycle May 31, 2024
e6ba81b
Merge pull request #475 from katef/sv/vmc-codegen-opaque-param-and-wa…
katef May 31, 2024
7af68d4
Allow xrealloc() to free() on a size of 0.
katef May 31, 2024
88877cd
xstrndup()
katef May 31, 2024
4ec219a
Normalization; all x*() xalloc.h interfaces exit on error.
katef May 31, 2024
825a621
No need to depend on POSIX here.
katef May 31, 2024
2483417
Merge pull request #476 from katef/kate/xstrndup
katef May 31, 2024
2afe563
Default to printing endids when no .endleaf callback is present.
katef Jun 7, 2024
ffea1de
Return a set of endids, rather than the state id.
katef Jun 7, 2024
f84aa38
Naming. I'm keeping "id" free.
katef Jun 8, 2024
a7d2e50
Add syntax for endids in .fsm format.
katef Jun 10, 2024
9ce1fb0
Missing error handling for the initial token.
katef Jun 10, 2024
0447463
Allow an empty list of end-ids.
katef Jun 11, 2024
1d30a12
Bugfix for argv handling for fsm_exec cli usage.
katef Jun 11, 2024
ebdbbbd
Tests for .fsm syntax.
katef Jun 11, 2024
db27a74
Wrong type.
katef Jun 11, 2024
26b9d25
Printing for endids.
katef Jun 11, 2024
20ac21b
Printing for endids.
katef Jun 11, 2024
8edcc07
Printing for endids.
katef Jun 11, 2024
69efe14
Missing free.
katef Jun 11, 2024
2b4821e
Printing for endids.
katef Jun 11, 2024
e07f66e
No need for the wrapper functions here.
katef Jun 11, 2024
ed4709c
No need for the tri-state enum here.
katef Jun 12, 2024
c27a1e4
Missing error handling.
katef Jun 12, 2024
d981fdd
No need for the tri-state enum here.
katef Jun 12, 2024
05b2467
No need for the static buffer here.
katef Jun 12, 2024
1c88c75
Statements after declarations for generated code.
katef Jun 14, 2024
0620f55
No need to mark unused here, this opaque pointer is passed to the get…
katef Jun 14, 2024
e577435
No need for the `void *opaque` arguments here.
katef Jun 14, 2024
6ec0aef
No need for the end_ids struct here.
katef Jun 14, 2024
1e5cf21
Normalization; attempting to get consistency around endleaf handling.
katef Jun 14, 2024
f7bcbdd
Remove dependencies on *nwritten, fsm_endid_count() beforehand instead.
katef Jun 15, 2024
6b2426d
No need for the *nwritten parameter.
katef Jun 15, 2024
99fa19c
Getting 0 end IDs is not an error.
katef Jun 15, 2024
f663cd4
Naming; ids[] for endids.
katef Jun 16, 2024
0402f39
Merge pull request #479 from katef/kate/endleaf-rejiggle
katef Jun 18, 2024
a39f723
First cut at introducing rx, a tool to compile a set of regular expre…
katef May 8, 2024
994390e
Move to structs for literal and id sets.
katef May 10, 2024
976313f
Fold together literal sets into an array indexed by flags.
katef May 10, 2024
f234a1c
Clarification.
katef May 10, 2024
e74a9d4
Port to fsm_intersect_charset.
katef May 27, 2024
ee57739
Rework categorisation for (hopefully) clearer outputs and verbose mes…
katef May 24, 2024
237544a
Back to POSIX for this, I messed up strndup.
katef May 31, 2024
708f7f8
Tidying up.
katef May 31, 2024
3ab2029
Clarification, resolving a few TODOs, smaller CLI options etc.
katef Jun 6, 2024
37d34c8
Allocate and duplicate for \0-terminated patterns, rather than pointi…
katef Jun 7, 2024
aa0eca1
Simplification, deal with -n earlier.
katef Jun 7, 2024
b6fe284
Give an example for AMBIG_ERROR.
katef Jun 19, 2024
7290f01
Move declined-file to an optarg, we need to keep argv[] for multiple …
katef Jun 19, 2024
798f8e7
Store patterns per set, rather than indexing into a global pattern ar…
katef Jun 20, 2024
41d8225
Check end id ambiguity before printing, rather than during.
katef Jun 20, 2024
a6deb96
No need for the *nwritten parameter.
katef Jun 20, 2024
4e5cf35
Switch to reading and allocating line-by-line, rather than mmap().
katef Jun 21, 2024
341dfc8
C99 doesn't allow a different type qualifier here, only C2x.
katef Jun 21, 2024
9779714
Multi-file input.
katef Jun 22, 2024
b436b81
Skip re_is_literal()'s parsing an AST construction for literals.
katef Jun 24, 2024
d546585
Override dialect by file extension.
katef Jun 24, 2024
6d2f1f3
-p for prefix.
katef Jun 24, 2024
45e3cfc
-F for re_flags.
katef Jun 24, 2024
c7d242f
No need to handle endids during fsm_minimise here.
katef Jun 24, 2024
53164ae
Don't call intersect_charset() with an empty charset, it's clearer to…
katef Jun 24, 2024
4232303
Comment generated code
katef Jun 25, 2024
ff51a75
Codegen for various languages.
katef Jun 25, 2024
4aa804a
-x for unanchored literals.
katef Jun 25, 2024
e7fd0f4
Include num_re_errors in per-file failures.
katef Jun 28, 2024
e66e6cf
Skip an IO API/lang combination that we don't support.
katef Jun 28, 2024
b0d1de6
Quieten GNU ld about something I don't understand.
katef Jun 28, 2024
14bbc0f
Merge pull request #480 from katef/kate/retest-errors
katef Jun 28, 2024
d756f9e
Sort endids written out by fsm_endid_get().
katef Jul 1, 2024
f35887d
Merge pull request #482 from katef/kate/sort-endids
katef Jul 1, 2024
093b703
First cut at introducing llvm ir codegen.
katef Jun 27, 2024
2371f42
-opaque-pointers for clang 14 in github CI.
katef Jun 28, 2024
09e1299
Maintain n index from 0, not -1.
katef Jun 29, 2024
d49de86
We need -mllvm for opaque pointers as well as -opaque-pointers.
katef Jun 29, 2024
f6e7ef6
Run these retest tests for llvm too.
katef Jun 29, 2024
2a6445d
Consistency for print_label()
katef Jun 29, 2024
13f93dd
Whitespace.
katef Jun 30, 2024
73e4074
Factor out print_branch()
katef Jun 29, 2024
2c31f63
Centralise `fail:` nodes.
katef Jun 30, 2024
8697e98
Construct retlist and output deduped rets.
katef Jun 30, 2024
b11d542
Branch to centralised retlist labels.
katef Jul 1, 2024
0ae60db
Jump via ret*: labels to a single stop:
katef Jul 1, 2024
49118f5
An arguably less worse workaround to keep .endleaf_opaque available.
katef Jul 4, 2024
6b76c46
Merge pull request #483 from katef/kate/llvm
katef Jul 4, 2024
0b84d75
Centralise fsm_print() and friends.
katef Jul 6, 2024
481af9f
Missing targets.
katef Jul 10, 2024
0adad69
Hoist up ir and vm opcode compilation to fsm_print().
katef Jul 10, 2024
28c8558
Return bool for match/failure from generated code.
katef Jul 12, 2024
97ec4e3
No need for ir_state here.
katef Jul 12, 2024
1545d1c
Only qsort a non-empty retlist.
katef Jul 18, 2024
eef6c00
Introduce ambig enum, and replace leaf/endleaf callbacks with reject/…
katef Jul 18, 2024
b4538cf
Cruft.
katef Jul 19, 2024
61fb10e
Move alloc hooks to struct fsm.
katef Jul 19, 2024
a7d6847
Uninitialized value.
katef Jul 20, 2024
4b2ab25
Remove fsm.opt and split print hooks from options.
katef Jul 21, 2024
9483c50
fsm_dump(), a convenience to replace the original fsm_print() for deb…
katef Jul 22, 2024
2b9b154
Port CLI tools to use opt.ambig and the conflict callback.
katef Jul 26, 2024
e03de6b
Clarification.
katef Jul 26, 2024
a564db1
-s for overriding dialect by file extension.
katef Jul 26, 2024
18b2d73
-e and -E for prefixes.
katef Jul 27, 2024
366fce6
Move out retlist construction.
katef Jul 27, 2024
684433c
Constuct retlist ahead of time for all vm-based formats.
katef Jul 28, 2024
5092212
Add AMBIG_MULTIPLE output for go.
katef Jul 28, 2024
7cdb00b
No need for the vmops_dialect enum here.
katef Jul 31, 2024
7e970d7
Whitespace.
katef Jul 31, 2024
f2bae91
Bugfix; 1 means VM_END_SUCC here.
katef Aug 2, 2024
ac4a66a
Ensure we don't pass NULL to memcmp()
katef Aug 2, 2024
436d6e0
Typo.
katef Aug 2, 2024
e484294
Support for enids for the vmops output.
katef Aug 2, 2024
62d3b3b
Merge pull request #485 from katef/kate/ambig-mode
katef Aug 4, 2024
2698127
First cut at AMBIG_MULTIPLE for llvm.
katef Aug 5, 2024
7426501
Rework stop: to index into an array for return values.
katef Aug 6, 2024
f69dbfc
Don't use `undef` for values the caller is expected to not access, us…
katef Aug 6, 2024
292fd1c
Split overriding comments to a separate hook.
katef Aug 7, 2024
bb4e81d
No need to emit a bitmap here.
katef Aug 7, 2024
6c17934
Use id count to indicate match failure, and >= 0 means success.
katef Aug 7, 2024
c44bfd2
Clarification.
katef Aug 7, 2024
ba70069
Add AMBIG_MULTIPLE output for Rust.
katef Aug 7, 2024
218e90c
Factor out print_ret().
katef Aug 7, 2024
021d169
Merge branch 'main' into kate/more-multi
katef Aug 7, 2024
e6950b8
Merge branch 'kate/more-multi' into kate/rx
katef Aug 9, 2024
719b1b2
Whoops... wrong exit status.
katef Aug 11, 2024
690f0e2
Oops... this should've been done with the API change to return a bool.
katef Aug 12, 2024
0f4d838
Separate calling points for the comments hook.
katef Aug 14, 2024
ab0a411
Typo.
katef Aug 16, 2024
0a36f1b
Merge pull request #486 from katef/kate/more-multi
katef Aug 16, 2024
a435074
Merge branch 'main' into kate/rx
katef Aug 16, 2024
f0fea27
-t for AMBIG_EARLIEST
katef Aug 16, 2024
26832cc
Graphviz output for the DFA.
katef Aug 16, 2024
d062ec9
-a and -w for anonymous states and fragment output.
katef Aug 16, 2024
5e10440
-X for always_hex
katef Aug 16, 2024
7607456
-Fb for consistency wrt -Fi.
katef Aug 17, 2024
a925708
Documentation for -F flags and -k io api.
katef Aug 17, 2024
c26c5fd
A little more progress on invocation.
katef Aug 17, 2024
64f26cc
Merge pull request #487 from katef/kate/man-flags
katef Aug 17, 2024
9668a76
Manpage for rx(1)
katef Aug 17, 2024
c08782a
Missing flag, this is now present on main.
katef Aug 20, 2024
d73682b
Stray assertion.
katef Aug 20, 2024
8c9b209
Spelling.
katef Aug 22, 2024
5fa91fe
In `closure_free()`, use the FSM allocator instead of `free()`.
sw17ch Aug 23, 2024
98fe88b
Merge pull request #489 from sw17ch/sw17ch/fix-closure-free-alloc
katef Aug 23, 2024
84f3835
Wrong exit status for -G.
katef Aug 24, 2024
60baaab
Wrong return type for AMBIG_ERROR/AMBIG_EARLIEST.
katef Aug 24, 2024
e7a21b4
-C opt-level=3 makes a huge difference here.
katef Aug 24, 2024
edeb291
Missing language.
katef Aug 24, 2024
3769f77
Off by one.
katef Aug 24, 2024
00ad53b
Bump actions for Node 20.
katef Aug 24, 2024
d557943
Happier cache lines.
katef Aug 24, 2024
6a40553
Guard .tag; it helps keep structs tidy.
katef Aug 25, 2024
f1ca8e8
No need for calloc here.
katef Aug 25, 2024
5010a40
Stray assertion.
katef Aug 24, 2024
ebbcb35
Update for hooks & options API changes.
katef Aug 26, 2024
632ddd3
Merge pull request #490 from katef/kate/bugfixin
katef Aug 26, 2024
8f9ea4d
Spelling.
katef Aug 27, 2024
dc9721f
Merge pull request #488 from katef/kate/rx
katef Sep 5, 2024
81b14f8
Merge pull request #491 from katef/kate/happy-cache-lines
katef Sep 5, 2024
981223f
bitmap.h: Add operations: copy, intersect, union, any, unset..
silentbicycle May 21, 2024
fa24439
Add fsm_detect_required_characters.
silentbicycle May 21, 2024
6c61249
bugfix: fsm_endid_get should sort with result count, not buffer size.
silentbicycle Sep 12, 2024
dec6ec0
endids_reused_buffer.c: Fix memory leak in test. (free fsm.)
silentbicycle Sep 12, 2024
521789f
Merge pull request #493 from katef/sv/bugfix-endid-qsort-count
katef Sep 13, 2024
5705d43
Update to Unicode 16.0
data-man Sep 17, 2024
0f0dbb6
Merge pull request #495 from data-man/ucd16
katef Sep 17, 2024
9aa1b9a
fsm_compact_states must remap endids, to avoid dangling references.
silentbicycle Sep 17, 2024
3295240
Change fsm_detect_required_characters interface.
silentbicycle Sep 18, 2024
5dcdeb6
fsm_detect_required_characters: Set count to 0 when matching "".
silentbicycle Sep 19, 2024
208de5f
Move detect_required1.c tests to .re/.txt files. Add -q chars to fsm.
silentbicycle Sep 19, 2024
aab4422
fsm.1.xml: Add basic info about -S <step_limit> and -q requiredchars.
silentbicycle Sep 19, 2024
4758734
print API: Box end_ids and end_id_count in a struct for callbacks.
silentbicycle Sep 23, 2024
8487fcb
Move call to fsm_countstates inside #ifndef NDEBUG.
silentbicycle Sep 23, 2024
2d61cf9
libfsm.syms: Expose fsm_new_statealloc.
silentbicycle Sep 23, 2024
1295005
ir: Wrap ids and count in a struct, to namespace them as endids.
silentbicycle Sep 24, 2024
eb576b8
Merge pull request #492 from katef/sv/determine-which-characters-must…
katef Sep 25, 2024
2474c51
Merge pull request #496 from katef/sv/bugfix-compact-states-should-re…
katef Sep 26, 2024
0961848
Merge pull request #497 from katef/sv/move-codegen-callback-metadata-…
katef Sep 27, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
68 changes: 34 additions & 34 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@ jobs:

steps:
- name: Cache checkout
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
key: checkout-${{ github.sha }}

- name: Checkout
if: steps.cache-checkout.outputs.cache-hit != 'true'
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
path: ${{ env.wc }}
Expand All @@ -49,7 +49,7 @@ jobs:

steps:
- name: Cache PCRE suite
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-pcre
with:
path: pcre-suite/${{ env.pcre2 }}
Expand All @@ -67,15 +67,15 @@ jobs:
chmod -R ug-w pcre-suite

- name: Cache converted PCRE tests
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-cvtpcre
with:
path: ${{ env.cvtpcre }}
key: cvtpcre-bmake-ubuntu-gcc-DEBUG-AUSAN-${{ github.sha }}-${{ env.pcre2 }}

- name: Fetch build
if: steps.cache-cvtpcre.outputs.cache-hit != 'true'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
Expand Down Expand Up @@ -155,14 +155,14 @@ jobs:

steps:
- name: Fetch checkout
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
key: checkout-${{ github.sha }}

- name: Cache build
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
Expand All @@ -185,7 +185,7 @@ jobs:

- name: Get number of CPU cores
if: steps.cache-build.outputs.cache-hit != 'true'
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Make
Expand Down Expand Up @@ -233,15 +233,15 @@ jobs:

steps:
- name: Fetch checkout
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
key: checkout-${{ github.sha }}

# An arbitary build.
- name: Fetch build
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
Expand Down Expand Up @@ -273,7 +273,7 @@ jobs:
${{ matrix.cc }} --version

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Make
Expand All @@ -292,7 +292,7 @@ jobs:
# kmkf duplicate install targets, it's not interesting for libfsm's CI,
# so I'm retrying on error here. # github.com/katef/kmkf/issues/14
- name: Install
uses: nick-fields/retry@v2.8.3
uses: nick-fields/retry@v3
with:
timeout_seconds: 10 # required, but not a problem for the kmkf bug
max_attempts: 3
Expand Down Expand Up @@ -322,7 +322,7 @@ jobs:

steps:
- name: Fetch checkout
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
Expand All @@ -344,14 +344,14 @@ jobs:
${{ matrix.cc }} --version

- name: Fetch build
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
key: build-${{ matrix.make }}-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.debug }}-${{ matrix.san }}-${{ github.sha }}

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Test
Expand Down Expand Up @@ -381,7 +381,7 @@ jobs:

steps:
- name: Fetch checkout
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
Expand All @@ -403,7 +403,7 @@ jobs:
${{ matrix.cc }} --version

- name: Fetch build
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
Expand All @@ -418,7 +418,7 @@ jobs:
# still run fuzzing, just from empty, and do not save their seeds.
- name: Restore seeds (mode ${{ matrix.mode }})
if: github.repository == 'katef/libfsm'
uses: actions/cache/restore@v3
uses: actions/cache/restore@v4
id: cache-seeds
with:
path: ${{ env.seeds }}-${{ matrix.mode }}
Expand All @@ -429,7 +429,7 @@ jobs:
run: mkdir -p ${{ env.seeds }}-${{ matrix.mode }}

- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Fuzz
Expand All @@ -455,15 +455,15 @@ jobs:
# the same seeds for a given bug.
# The explicit cache/restore and cache/save actions are just for that.
- name: Save seeds (mode ${{ matrix.mode }}-${{ matrix.debug }})
uses: actions/cache/save@v3
uses: actions/cache/save@v4
if: always()
with:
path: ${{ env.seeds }}-${{ matrix.mode }}
key: ${{ steps.cache-seeds.outputs.cache-primary-key }}

# nothing to do with the caching, I'm uploading the seeds so a developer can grab them to fuzz locally
- name: Upload seeds (mode ${{ matrix.mode }}-${{ matrix.debug }})
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: seeds-${{ matrix.mode }}-${{ matrix.debug }}
path: ${{ env.seeds }}-${{ matrix.mode }}
Expand All @@ -481,7 +481,7 @@ jobs:
cc: [ clang, gcc ]
make: [ bmake ]
debug: [ DEBUG, RELEASE ] # RELEASE=1 is a no-op
lang: [ "vm -x v1", "vm -x v2", asm, c, rust, vmc, vmops, go, goasm ]
lang: [ "vm -x v1", "vm -x v2", asm, c, rust, vmc, vmops, go, goasm, llvm ]
exclude:
- os: macos
cc: gcc # it's clang anyway
Expand Down Expand Up @@ -513,14 +513,14 @@ jobs:
go version

- name: Fetch build
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
key: build-${{ matrix.make }}-${{ matrix.os }}-${{ matrix.cc }}-${{ matrix.debug }}-${{ matrix.san }}-${{ github.sha }}

- name: Fetch converted PCRE tests
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-cvtpcre
with:
path: ${{ env.cvtpcre }}
Expand All @@ -539,7 +539,7 @@ jobs:

steps:
- name: Cache docs
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-docs
with:
path: ${{ env.build }}
Expand All @@ -554,15 +554,15 @@ jobs:

- name: Fetch checkout
if: steps.cache-docs.outputs.cache-hit != 'true'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
key: checkout-${{ github.sha }}

- name: Get number of CPU cores
if: steps.cache-docs.outputs.cache-hit != 'true'
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Test docs
Expand Down Expand Up @@ -594,7 +594,7 @@ jobs:

steps:
- name: Cache prefix
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-prefix
with:
path: ${{ env.prefix }}
Expand All @@ -608,31 +608,31 @@ jobs:

- name: Fetch checkout
if: steps.cache-prefix.outputs.cache-hit != 'true'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-checkout
with:
path: ${{ env.wc }}
key: checkout-${{ github.sha }}

- name: Fetch build
if: steps.cache-prefix.outputs.cache-hit != 'true'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-build
with:
path: ${{ env.build }}
key: build-${{ env.make }}-${{ env.os }}-${{ env.cc }}-${{ env.debug }}-${{ env.san }}-${{ github.sha }}

- name: Fetch docs
if: steps.cache-prefix.outputs.cache-hit != 'true'
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-docs
with:
path: ${{ env.build }}
key: docs-${{ github.sha }}

- name: Get number of CPU cores
if: steps.cache-prefix.outputs.cache-hit != 'true'
uses: SimenB/github-actions-cpu-cores@v1
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores

- name: Install
Expand Down Expand Up @@ -668,7 +668,7 @@ jobs:
fpm -v

- name: Fetch prefix
uses: actions/cache@v3
uses: actions/cache@v4
id: cache-prefix
with:
path: ${{ env.prefix }}
Expand All @@ -691,7 +691,7 @@ jobs:
printf "package_file=%s\n" $(basename pkg/*) >> $GITHUB_ENV

- name: Upload
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ env.package_file }}
path: pkg/${{ env.package_file }}
Expand Down
4 changes: 4 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ PKG += libtheft
.if !defined(NODOC)
SUBDIR += man/fsm.1
SUBDIR += man/re.1
SUBDIR += man/rx.1
SUBDIR += man/lx.1
SUBDIR += man/fsm_print.3
SUBDIR += man/libfsm.3
Expand Down Expand Up @@ -101,6 +102,7 @@ SUBDIR += src/libre/print
SUBDIR += src/libre
SUBDIR += src/fsm
SUBDIR += src/re
SUBDIR += src/rx
SUBDIR += src/retest
SUBDIR += src/lx/print
SUBDIR += src/lx
Expand All @@ -114,9 +116,11 @@ SUBDIR += tests/intersect
SUBDIR += tests/eclosure
SUBDIR += tests/equals
SUBDIR += tests/subtract
SUBDIR += tests/detect_required
SUBDIR += tests/determinise
SUBDIR += tests/endids
SUBDIR += tests/epsilons
SUBDIR += tests/fsm
SUBDIR += tests/glob
SUBDIR += tests/like
SUBDIR += tests/literal
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ You get:
* libfsm — library for manipulating FSM (NFA and DFA)
* libre — library for compiling regular expressions to NFA
* fsm(1) — command line interface for FSM
* re(1) — command line interface for executing regular expressions
* re(1) — command line interface for regular expressions
* rx(1) — command line interface for compiling sets of regular expressions
* lx(1) — lexer generator

lx is an attempt to produce a simple, expressive, and unobtrusive
Expand Down
3 changes: 3 additions & 0 deletions examples/bm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,6 @@ pcre: pcre.c
libfsm: libfsm.c
gcc -o libfsm -O3 -Wall -std=c99 ${BM_CFLAGS} libfsm.c -I ../../include ../../build/lib/libre.a ../../build/lib/libfsm.a

clean:
rm -f pcre libfsm

4 changes: 2 additions & 2 deletions examples/bm/libfsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ main(int argc, char *argv[])
opt.io = FSM_IO_STR;

p = argv[0];
fsm = re_comp(RE_PCRE, fsm_sgetc, &p, &opt, flags, &e);
fsm = re_comp(RE_PCRE, fsm_sgetc, &p, NULL, flags, &e);
if (fsm == NULL) {
re_perror(RE_LITERAL, &e, NULL, s);
return 1;
Expand All @@ -80,7 +80,7 @@ main(int argc, char *argv[])
printf("#include <time.h>\n");
printf("\n");

fsm_print_c(stdout, fsm);
fsm_print(stdout, fsm, &opt, NULL, FSM_PRINT_C);

printf("int\n");
printf("main(void)\n");
Expand Down
4 changes: 2 additions & 2 deletions examples/glob/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ match(const struct fsm *fsm, const char *s)
assert(fsm_all(fsm, fsm_isdfa));
assert(s != NULL);

if (1 != fsm_exec(fsm, fsm_sgetc, &s, &state)) {
if (1 != fsm_exec(fsm, fsm_sgetc, &s, &state, NULL)) {
return 0;
}

Expand Down Expand Up @@ -196,7 +196,7 @@ main(int argc, char *argv[])
}

if (!quiet) {
fsm_print_fsm(stdout, fsm);
fsm_print(stdout, fsm, NULL, NULL, FSM_PRINT_FSM);
}

matched = match(fsm, argv[1]);
Expand Down
Loading