Skip to content

feat(parser): add ON trigger and TRIGGER PROCEDURE statement parsing#31

Merged
LostRhapsody merged 1 commit intomasterfrom
feat/on-triggers
Apr 10, 2026
Merged

feat(parser): add ON trigger and TRIGGER PROCEDURE statement parsing#31
LostRhapsody merged 1 commit intomasterfrom
feat/on-triggers

Conversation

@LostRhapsody
Copy link
Copy Markdown
Contributor

Summary

  • Add full parsing support for ABL's ON statement (UI/developer event triggers, database event triggers, key remapping) and TRIGGER PROCEDURE statement
  • Completes the last major parser gap listed in CLAUDE.md
  • 29 new tests (406 total parser tests), all passing

What's Implemented

ON UI/Developer Event Triggers:

  • Comma-separated event names and widget lists
  • OR clause chaining (ON CHOOSE OF btn1 OR ENTRY OF fill1)
  • ANYWHERE (standalone and after widget list)
  • IN FRAME / IN BROWSE widget qualifiers
  • Trigger actions: DO blocks, single statements, REVERT, PERSISTENT RUN with args
  • Statement keywords as event names (LEAVE, ENTRY, CREATE, etc.)

ON Database Event Triggers:

  • CREATE, DELETE, FIND, WRITE, ASSIGN events
  • NEW/OLD BUFFER referencing (WRITE), OLD VALUE (ASSIGN)
  • OVERRIDE clause, REVERT action
  • Dotted table.field names for ASSIGN OF targets

ON Key Remapping: ON F1 HELP.

TRIGGER PROCEDURE:

  • All 5 standard events + REPLICATION-CREATE/DELETE/WRITE
  • WRITE with optional NEW/OLD BUFFER
  • ASSIGN with both OF and NEW VALUE forms

New AST Types

OnKind, OnAction, OnEventClause, DbTriggerEvent, TriggerReferencing, WidgetRef, WidgetQualifier, TriggerAssignParam

Test Plan

  • 13 UI event trigger tests (basic, commas, OR, ANYWHERE, IN FRAME, single statement, REVERT, PERSISTENT RUN, LEAVE as event, WEB-NOTIFY)
  • 6 database event trigger tests (CREATE, WRITE with buffers, ASSIGN with dotted name, OLD VALUE, OVERRIDE, REVERT)
  • 1 key remapping test
  • 6 TRIGGER PROCEDURE tests (CREATE, WRITE, WRITE without BUFFER keyword, ASSIGN OF, ASSIGN NEW VALUE, ASSIGN NEW+OLD VALUE)
  • 3 integration tests (ON inside PROCEDURE, DO block, CLASS body)
  • All 377 existing parser tests still pass
  • cargo clippy -D warnings passes
  • cargo fmt --check passes

Post-Deploy Monitoring & Validation

No additional operational monitoring required: this is a parser library with no runtime deployment.


Compound Engineered 🤖 Generated with Claude Code

Add full parsing support for ABL's ON statement (all 3 forms) and the
TRIGGER PROCEDURE statement, completing the last major parser gap.

ON statement forms:
- UI/developer event triggers with comma-separated events/widgets,
  OR clause chaining, ANYWHERE, IN FRAME/IN BROWSE qualifiers,
  and trigger actions (DO block, single statement, REVERT, PERSISTENT RUN)
- Database event triggers (CREATE/DELETE/FIND/WRITE/ASSIGN) with
  NEW/OLD BUFFER referencing, OLD VALUE, and OVERRIDE
- Key remapping (ON key-label key-function)

TRIGGER PROCEDURE for schema triggers:
- All 5 standard events plus REPLICATION-CREATE/DELETE/WRITE
- WRITE with optional NEW/OLD BUFFER clauses
- ASSIGN with both OF table.field and NEW VALUE variable forms

New AST types: OnKind, OnAction, OnEventClause, DbTriggerEvent,
TriggerReferencing, WidgetRef, WidgetQualifier, TriggerAssignParam.

29 new tests (406 total parser tests), all passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@codspeed-hq
Copy link
Copy Markdown
Contributor

codspeed-hq bot commented Apr 10, 2026

Merging this PR will improve performance by 11.13%

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 1 improved benchmark
✅ 14 untouched benchmarks

Performance Changes

Benchmark BASE HEAD Efficiency
expressions 304.5 µs 274 µs +11.13%

Comparing feat/on-triggers (6dfffdc) with master (4eb3af4)

Open in CodSpeed

@LostRhapsody LostRhapsody merged commit 0ec08d3 into master Apr 10, 2026
6 checks passed
@LostRhapsody LostRhapsody deleted the feat/on-triggers branch April 10, 2026 02:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant