What's Changed
- Added list repetition operator
e1 >> e2
to the DSL that is shorthand fore1 > *(e2 > e1)
. - Added support for parsing characters and character literals where applicable without explicitly needing to wrap them with
chr()
or_cx
. - Symbols now respects
caseless
mode, allowing for case-insensitive matching against symbol definitions. - Allow for use of variables of all types in attribute bindings and removed the
lug::variable
template class that was used previously. Variable state is automatically saved and restored across rule boundaries. - Allow for capturing text to a
lug::syntax
object or any string-like object that is convertible fromstd::string_view
, and renamedsyntax::capture
tosyntax::str
in order to matchstd::sub_match::str
. - Added
lug::source_options::interactive
flag that ignoreseoi
tokens for TTY input sources. - Rewrote the expression function objects/lambdas as expression template classes. Allows for multiple passes over the expression tree as well as top-down and bottom-up traversal, which was needed when implementing attribute state tracking. This will also allow for additional optimizations to be implemented in the future.
- Renamed
syntactic_capture
tosemantic_capture_action
to reflect that it is executed during the semantic action evaluation phase. - Make all variations of callables that return a non-void value that can be type-erased by
semantic_action
andsemantic_capture_action
push their result onto the attribute result stack. - Removed
semantic_response
from the public API as it was only used internally inside of the parser. - Attempting to bind a variable to a nonexistent value from the attribute result stack now throws an
attribute_stack_error
. implicit_space_rule
no longer causes a compiler warning with Clang, uses RAII to push/pop the thread-local white space rule for grammars.- Moved
call_depth()
,prune_depth()
andescape()
functions into thelug::environment
class since they are used exclusively during semantic action phase. - Moved line/column tracking and current match/subject string views to
lug::environment
class, fully removing the environment's dependency onlug::parser
. - Turned
lug::parser
into an alias of a newlug::basic_parser
template class parameterized with an input source strategy. This allows for parsing and capturing of text without making a copy of the input. - Placed all DSL operator overloads inside of an inline namespace
operators
withinlug::language
. This allows only the operators to be imported into the current scope if desired. - Enabled
-Wconversion
and-Wshadow
warnings for Clang and GCC and fixed warnings. - Full clang-tidy pass on all of the library headers and fixed all warnings.
- Added CMake build support and removed old MSVS solution and vcxproj files.
- Handle situation where compilation with RTTI is disabled.
Full Changelog: v0.2.0...v0.3.0