Skip to content

Refine detection of procedure declarations - #144

Merged
istathar merged 5 commits into
technique-lang:mainfrom
istathar:fix-colons-again
Aug 1, 2026
Merged

Refine detection of procedure declarations#144
istathar merged 5 commits into
technique-lang:mainfrom
istathar:fix-colons-again

Conversation

@istathar

@istathar istathar commented Jul 31, 2026

Copy link
Copy Markdown
Member

Two interacting problems have been dogging us for some time. Detection of procedures has been fraught because : can appear both in procedure declarations and in normal prose. The Technique parser is built around the capturing ranges at the current contextual scope, so depends on accurately scanning from one procedure to the next, so being able to find those correctly and avoiding false positives is crucial to both correctness and being able to offer good error messages.

The solution is to make a slight change to the grammar as follows. A procedure declaration is an identifier, followed by space (at least one), followed by a colon : (then optionally followed by a signature).

The presence of the space between identifier and colon allows us to differentiate between a procedure definition

warning :

and prose in a procedure description

Warning: be warned!

The second problem addressed by this branch is ensuring characters in literal (especially strings literals and multi-line string literals) are masked and preserved as part of the literal and not considered as being language syntax. This also has been a few rounds; in particular colon : and quote ' characters kept false matches for other predicates. This branch improves the scanner to track text vs quoted vs fenced runs as it works through the input.

@istathar istathar changed the title Fix colons again Refine detection of procedure declarations Jul 31, 2026
@istathar

istathar commented Aug 1, 2026

Copy link
Copy Markdown
Member Author

@istathar
istathar merged commit d10509b into technique-lang:main Aug 1, 2026
1 check passed
@istathar
istathar deleted the fix-colons-again branch August 1, 2026 07:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant