Skip to main content

assign_values

Function assign_values 

Source
pub fn assign_values(
    file: &mut PolydatFile,
    assignments: &[(String, String)],
) -> Result<(), String>
Expand description

Assign name=value text to externs and inputs by rewriting their declarations.

  • An extern name: T gets "value" as its default. The compiler fuses the string literal to T through the same coercions that apply when a str wire feeds a typed port, so a bad value is a compile error carrying the program’s own diagnostic.
  • An input name: T becomes extern name: T = "value": for this run the coordinate is fixed, so it is no longer a coordinate.
  • A name that is neither is an error listing what the program declares.

The transform is order preserving and leaves every other statement untouched.