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

Allow use of type keywords as identifiers in some formats #1753

Merged
merged 1 commit into from
Dec 7, 2020

Conversation

DennisHeimbigner
Copy link
Collaborator

re: #1750

Built-in type-name keywords are currently flagged when used as
identifiers in formats that do not support that type. So if a
user declares a dimension named "string" in a classic .cdl file,
it causes an error.

This PR modifies ncgen to allow those format-specific type keywords
to be used as identifiers when compiling to formats that do not
support that type. Also added a test for this.

Also a couple of misc. changes to conditional-ize some debug output.

…rt that type.

Built-in type-name keywords are currently flagged when used as
identifiers in formats that do not support that type.  So if a
user declares a dimension named "string" in a classic .cdl file,
it causes an error.

This PR modifies ncgen to allow those format-specific type keywords
to be used as identifiers when compiling to formats that do not
support that type. Also added a test for this.

Also a couple of misc. changes to conditionalize some debug output.
WardF added a commit that referenced this pull request Dec 7, 2020
@WardF WardF merged commit 878866c into Unidata:master Dec 7, 2020
@DennisHeimbigner DennisHeimbigner deleted the ncgenkw.dmh branch December 8, 2020 01:54
DennisHeimbigner added a commit to DennisHeimbigner/netcdf-c that referenced this pull request Apr 13, 2021
re: Unidata#1977

PR Unidata#1753, changed ncgen
to allows certain type names to be used as identifiers in
selected situations.

An unwanted side effect was that existing type aliases no longer
were accepted by ncgen. Specifically, using the "long" type
caused an error.

I was able to figure out a better solution to the original
problem (Unidata#1750)
that also fixes this problem as well.

This PR fixes that problem in ncgen/ncgen.l,
and adds tests to ncdump/test_keywords.sh
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