A syntax statement within an imported file will not currently change the syntax in the importing file, only locally.
In order for the syntax extensions to propagate to the importing file, we need the scanner and parser to recognize that there is a syntax statement, mark it so that import will be aware of it. That, in turn, may require import to be processed early, e.g. during scanning.
Example:
// imported.xl
module IMPORTED with
syntax { POSTFIX 130 cm mm km dm m }
type distance is matching (D:real m)
D:real km as distance is (D * 1000) m
D:real mm as distance is (D * 0.001) m
// Importing file
use IMPORTED
D : distance := 3.2km
A
syntax
statement within an imported file will not currently change the syntax in the importing file, only locally.In order for the syntax extensions to propagate to the importing file, we need the scanner and parser to recognize that there is a
syntax
statement, mark it so thatimport
will be aware of it. That, in turn, may requireimport
to be processed early, e.g. during scanning.Example: