Skip to content

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

Merged
WardF merged 1 commit intoUnidata:masterfrom
DennisHeimbigner:ncgenkw.dmh
Dec 7, 2020
Merged

Allow use of type keywords as identifiers in some formats#1753
WardF merged 1 commit intoUnidata:masterfrom
DennisHeimbigner:ncgenkw.dmh

Conversation

@DennisHeimbigner
Copy link
Copy Markdown
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.
@DennisHeimbigner DennisHeimbigner requested a review from WardF as a code owner June 5, 2020 23:06
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