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

Prevent name conflicts with internally used identifiers #638

Open
treiher opened this issue Apr 1, 2021 · 1 comment
Open

Prevent name conflicts with internally used identifiers #638

treiher opened this issue Apr 1, 2021 · 1 comment
Labels
small Effort of one person-day or less specification Related to specification package (e.g., specification parsing)

Comments

@treiher
Copy link
Collaborator

treiher commented Apr 1, 2021

During code generation but also in other circumstances there is a risk of name conflicts between internally used identifiers and user-defined identifiers. A solution would be to prevent a user from defining identifiers with the prefix RFLX_, as it is already done for package identifiers.

Known problematic cases:

@treiher treiher added the specification Related to specification package (e.g., specification parsing) label Apr 1, 2021
@treiher treiher added this to To do in RecordFlux 0.7 via automation Apr 1, 2021
@treiher
Copy link
Collaborator Author

treiher commented May 21, 2021

The issue gets even more difficult when warnings on hiding are activated (-gnatwh is currently not used due to Componolit/Workarounds#27). Scalar types defined in a RecordFlux specification will conflict with parameter names of generated SPARK subprograms (e.g., Ctx or Buffer). IMHO prefixing all parameters with RFLX_ will impair the readability of the generated code too much, maybe a shorter prefix would be acceptable, e.g., P_ for all parameters. We are already using F_ for the literals representing message field names. So one solution could be to generally prohibit identifiers beginning with [A-Z]_ in specifications.

@senier senier removed this from To do in RecordFlux 0.7 Jul 26, 2021
@senier senier added this to To do in RecordFlux 0.6 via automation Jul 26, 2021
@treiher treiher added the small Effort of one person-day or less label Aug 9, 2021
@senier senier removed this from To do in RecordFlux 0.6 Aug 23, 2022
@senier senier added this to To do in RecordFlux Future via automation Aug 23, 2022
@senier senier removed this from Medium in RecordFlux Future Oct 4, 2022
@senier senier added this to To do in RecordFlux 0.7.1 via automation Oct 4, 2022
@senier senier removed this from To do in RecordFlux 0.7.1 Nov 1, 2022
@senier senier added this to Medium in RecordFlux Future via automation Nov 1, 2022
@senier senier removed this from Medium in RecordFlux Future Nov 29, 2022
@senier senier added this to To do in RecordFlux 2023-01-06 via automation Nov 29, 2022
@senier senier removed this from To do in RecordFlux 2023-01-06 Jan 3, 2023
@senier senier added this to To do in RecordFlux 2023-02-24 via automation Jan 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
small Effort of one person-day or less specification Related to specification package (e.g., specification parsing)
Projects
No open projects
Development

No branches or pull requests

1 participant