AppleScript grammar for tree-sitter

test: fix the malformed script library files expectation

The expectation had 15 opening parens against 16 closing, so it could never have matched anything. With the stray paren removed the parser already produces exactly the tree its author intended. 63/79 to 64/79. Also tried, measured and reverted: an as_parameter rule, so that "save as text" reads "as" as a parameter label rather than a type cast. That is the correct reading of AppleScript, but it cost 90 states, regressed Monthly-Cleanups and Transform-Text from clean parses to ERROR, and fixed no test. Not worth it in isolation. The remaining 15 failures are triaged rather than fixed. Several of the expectations are themselves wrong, and correcting them needs application dictionary knowledge this repository does not record: Wrong expectation, parser closer to correct Nested tell with process reference: expects "process" and "Finder" to be a target plus a separate statement, splitting a by-name reference in half. Expectation not derivable from the input Choose file name with default name: the expected child order puts a with_clause before two labeled_parameters, but the token it needs for the first of them sits before that clause in the source. Save with multiple labeled parameters: nine tokens do not divide into the four single-identifier pairs claimed. Save as with line endings: six tokens paired off mechanically into three labeled parameters, which is not what the command means. Needs a dictionary to settle Whether "script line endings" is one multi-word parameter label is not something the grammar can be made to guess, and labeled_parameter only accepts single-word labels today.


Author tomwaddington.dev
Date Commit Parent fbb69a05 Change ID
+7 -11
1 changed file
+7 -11
1 changed file