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

Add ability to manually escape reserved words #174

Merged
merged 1 commit into from
Sep 26, 2019
Merged

Conversation

mtdowling
Copy link
Member

This commit adds the ability to manually escape reserved words from a
SymbolProvider for SymbolProviders that need to be re-entrant (e.g.,
when creating symbols for aggregate shapes, you often need to
recursively create a symbol for the member). Re-entrant symbol providers
can't use the decorator approach since they need access to the reserved
words contained in the decorator. In these cases, one needs to pass an
"Escaper" into the SymbolProvider and manually escape symbols.

One other change here is to tighten up the interface of SymbolProvider
to change toMemberName() from accepting a Shape to accepting only a
MemberShape. While technically a breaking change, this was always the
intention but for some reason the change was never made.

Issue #, if available:

Description of changes:

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

This commit adds the ability to manually escape reserved words from a
SymbolProvider for SymbolProviders that need to be re-entrant (e.g.,
when creating symbols for aggregate shapes, you often need to
recursively create a symbol for the member). Re-entrant symbol providers
can't use the decorator approach since they need access to the reserved
words contained in the decorator. In these cases, one needs to pass an
"Escaper" into the SymbolProvider and manually escape symbols.

One other change here is to tighten up the interface of SymbolProvider
to change toMemberName() from accepting a Shape to accepting only a
MemberShape. While technically a breaking change, this was always the
intention but for some reason the change was never made.
@mtdowling mtdowling requested a review from kstich September 26, 2019 20:08
@mtdowling mtdowling merged commit 17df231 into master Sep 26, 2019
@mtdowling mtdowling deleted the add-manual-escaping branch October 15, 2019 20:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants