-
Notifications
You must be signed in to change notification settings - Fork 39
Require Fw Types in dictionary #686
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Just a few comments to address.
/** The dictionary generation mode */ | ||
dictionaryMode: Boolean = false, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's rename this variable to be a predicate:
/** The dictionary generation mode */ | |
dictionaryMode: Boolean = false, | |
/** Whether a dictionary is needed in code generation */ | |
dictionaryNeeded: Boolean = false, |
for { | ||
symbol <- Result.annotateResult( | ||
helpers.getSymbolForName(mapping)(node1.id, t), | ||
s"Dictionary requires type ${t} to be defined.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's add another check here to ensure that the type has an integer type as its underlying type. If not, we can return a TypeError saying that an integer type is required.
} | ||
} | ||
|
||
} | ||
|
||
/** Annotated error for including additional notes */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/** Annotated error for including additional notes */ | |
/** An error with a note */ |
@@ -1452,6 +1452,23 @@ The JSON format is specified in the | |||
https://fprime.jpl.nasa.gov/devel/docs/reference/fpp-json-dict/[F Prime design | |||
documentation]. | |||
|
|||
When generating dictionaries with `fpp-to-dict`, the following types must be defined | |||
in FPP (either in the input model itself or in a dependency file): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's say also that each of the defined types has to be an alias of an integer type.
Closes #666.