Skip to content

Add ability to manually escape reserved words#174

Merged
mtdowling merged 1 commit intomasterfrom
add-manual-escaping
Sep 26, 2019
Merged

Add ability to manually escape reserved words#174
mtdowling merged 1 commit intomasterfrom
add-manual-escaping

Conversation

@mtdowling
Copy link
Copy Markdown
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