STYLERS

The A_Set of A_Stylers that have been added to this method. At most one may be added to each method per module.

Styling only happens when a top-level statement of a module has been unambiguously compiled. Child phrases are processed before their parent.

The function accepts four arguments:

  1. The send phrase, which is possibly the original phrase of a macro substitution.

  2. An A_Variable containing an A_Map from A_Phrase to a style, and

  3. An A_Variable containing a map from A_Token to style.

  4. An A_Variable containing a map from A_Token to A_Token, where the key token is the use of some variable, and the value token identifies its points of declaration. While not strictly a styling output, we take this opportunity nevertheless to introduce this local navigation helper.

The maps will already have been populated by running the styling function for each of the children (perhaps running all children in parallel). These variables should be updated to reflect how the invocation of this bundle should be presented.

These maps will later be used to produce a linear sequence of styled substrings, suitable for passing to an IDE or other technology capable of presenting styled text.

The linearization of the fully populated style information proceeds by scanning the map from phrase to style, and for each phrase adding an entry to the map from token to style for each of the phrase's static tokens. If there is already an entry for some static token, the map is not updated for that token. Afterward, the token map is sorted, and used to partition the module text.

The resulting tuple of ranges and styles (perhaps with line numbers) might even be accessed with a binary search, to deliver a windowed view into the styled text. This allows enormous files to be presented in an IDE without having to transfer and decode all of the styling information for the entire file.

Properties

Link copied to clipboard
Link copied to clipboard