Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the textmate parser to handle `template_string_declaration`. The previous version defined a separate `block_string` rule that could be shared across use sites. However, it was easier to define a special-purpose block string handler within `template_string_definition`, that could coordinate with the `template_string_definition`. Specifically, the inlined block string parser uses a lookahead parser to scan for the ending `"#` without consuming it, so that `"#` can be owned by the outer `template_string_definition` parser. This PR: ![Screenshot 2024-11-08 at 4 34 02 PM](https://github.com/user-attachments/assets/79733f8b-43ad-4df5-8758-8cb874a259ca) (Multiline parameters still highlight correctly) <img width="368" alt="Screenshot 2024-11-09 at 10 04 04 AM" src="https://github.com/user-attachments/assets/49d337a3-f89f-47c5-81bb-9045070ab78c"> canary prior to this PR: ![Screenshot 2024-11-08 at 4 35 19 PM](https://github.com/user-attachments/assets/979f58d8-d554-4751-92a1-3de63c6c66f1) canary prior to the last change to the textmate grammar (https://github.com/BoundaryML/baml/pull/1130/files): ![Screenshot 2024-11-08 at 4 36 46 PM](https://github.com/user-attachments/assets/c450c170-af6c-4294-99d6-2c3521682221) <!-- ELLIPSIS_HIDDEN --> ---- > [!IMPORTANT] > Updates `template_string_declaration` in `baml.tmLanguage.json` to handle block strings directly, removing the separate `block_string` rule. > > - **Behavior**: > - Updates `template_string_declaration` in `baml.tmLanguage.json` to handle block strings with a lookahead parser for ending `"#`. > - Removes separate `block_string` rule, integrating its functionality directly into `template_string_declaration`. > - **Patterns**: > - Adjusts `end` pattern in `template_string_declaration` to `"#{1,3}`. > - Adds inline block string handling with `begin` and `end` patterns for `#{1,3}"` and `"#{1,3}` respectively. > - **Misc**: > - Removes `block_string` from the repository. > > <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup> for 2663d77. It will automatically update as commits are pushed.</sup> <!-- ELLIPSIS_HIDDEN -->
- Loading branch information