Skip to content

Commit

Permalink
Export user-facing names
Browse files Browse the repository at this point in the history
One of the issues with using Automa is that its lack of exports makes it unclear
what is internal/external. Also, the three typical using-statements needed to
use Automa is just visual noise.
  • Loading branch information
jakobnissen committed Jul 25, 2022
1 parent 8d5584a commit 18a3059
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/Automa.jl
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,24 @@ include("codegen.jl")
include("tokenizer.jl")
include("Stream.jl")

const RE = Automa.RegExp
using .RegExp: @re_str, opt, rep, rep1

# This list of exports lists the API
export RE,
@re_str,
CodeGenContext,
compile,

# user-facing generator functions
generate_validator_function,
generate_init_code,
generate_exec_code,
generate_code,

# cat and alt is not exported in favor of * and |
opt,
rep,
rep1

end # module

0 comments on commit 18a3059

Please sign in to comment.