-
Notifications
You must be signed in to change notification settings - Fork 2
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
Merge grammar updates to Master for publication #51
Conversation
Add a function to merge grammars
This refactor allows for the reuse of the logic that checks whether a symbol is defined in a specific `Module` or `Main`/`Base`.
Allow the specification one or more `Module` when checking if a rule used by a `RuleNode` represents a variable, or if it is defined in one of the specified `Module`s, `Main`, or `Base`. Fixes #21.
If the expression passed for a rule is malformed, the function now throws an `ArgumentException` Fixes #37.
Make `add_rule!(...)` fail audibly
Fix `isvariable`
Currently, the rule `true` is equivalent to the rule `1`. This means that if one of them already exists in the grammar, the new one is skipped.
`add_rule!(...)` type coercion bug
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This all looks fine to me, but just to make sure we make the assumptions explicit: if there is a hole, we simply skip it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Just one aesthetic/design comment: I remember reading in an old issue or PR that part of the CFG -> CSG migration would include renaming ContextSensitiveGrammar
to Grammar
. Did we discuss that option and decide against it? I can see arguments for both keeping the names as they are now, or moving completely to Grammar
.
Without them, an empty grammar results in many `Vector{Any}`s, closes #53
Fix empty grammar creation
Grammar -> AbstractGrammar according to HerbCore 0.2
Changes (as far as I remember):
cfg
s withcsg
s entirely (both macros still work)add_rule!
failing silentlyisvariable
fix