Skip to content

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jwest115
Copy link
Collaborator

Closes #666.

@jwest115 jwest115 marked this pull request as ready for review April 29, 2025 01:28
@jwest115 jwest115 requested a review from bocchino April 29, 2025 01:28
Copy link
Collaborator

@bocchino bocchino left a 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.

Comment on lines +74 to +75
/** The dictionary generation mode */
dictionaryMode: Boolean = false,
Copy link
Collaborator

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:

Suggested change
/** 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.")
Copy link
Collaborator

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 */
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
/** 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):
Copy link
Collaborator

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.

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.

Add Fw types to dictionary
2 participants