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

Differentiate between indices, lengths and other values in model #37

Closed
treiher opened this issue Jan 22, 2019 · 2 comments
Closed

Differentiate between indices, lengths and other values in model #37

treiher opened this issue Jan 22, 2019 · 2 comments

Comments

@treiher
Copy link
Collaborator

treiher commented Jan 22, 2019

When parsing conditions and location expressions in a message type we should differentiate between fields which are used as index (indicated by a First attribute), length (indicated by a Length attribute) or other value. This information is needed to be able to ensure that lengths can be added among each other and can be added to an index in the generated code. Ada does not allow the addition between different types, thus an appropriate conversion is needed.

@treiher treiher created this issue from a note in RecordFlux 0.3 (TODO) Jan 22, 2019
@senier
Copy link
Member

senier commented Jan 22, 2019

Alternatively (and more cleanly) a custom "+" operator can be implemented that allows for addition of index and length types. This way, we errors where indices are added in an erroneous way.

@treiher treiher moved this from TODO to In Progress in RecordFlux 0.3 Jan 23, 2019
@treiher
Copy link
Collaborator Author

treiher commented Jan 28, 2019

Rethinking the issue I cannot imagine a use case where it makes sense to treat a field as an index. So we should only differentiate between length fields and other fields.

treiher added a commit that referenced this issue Jan 29, 2019
RecordFlux 0.3 automation moved this from In Progress to Done Jan 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

No branches or pull requests

2 participants