Ability to change syntax flags & Generex extensibility #55
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
Have you ever wondered why the characters
@&<#~
behave very weirdly in generex? Yes, Generex does use this regex grammar and not the Java one we all are used to, so these are special characters. Fear no more: we can actually turn off the syntax flags on the RegExp!Features
createRegExp
,requote
) to protected, so they can be reused in subclasses (typically in the constructor)regExp
,automaton
fields to protected, subclasses will surely appreciate itAll of these changes are backwards-compatible, because only new overloaded methods are added and the default behaviour is preserved. Also changing stuff from
private
toprotected
is OK because it is less restrictive now.Disclaimer: This branch is not compilable right now because of maven error
PR #48 does a good job of updating the project and my original feature branch https://github.com/HawkSK/Generex/tree/change_syntax_flags was built upon #48, so pull that branch if you want to try this feature. This PR is only the separate independent feature in Generex class.
Note: I used new version
1.0.4
because1.0.3
is used in #48.