feat: wire directional alignment predicates into dense DSL grammar

- Add leftAlignedWith/rightAlignedWith/topAlignedWith/bottomAlignedWith
  to lexer TokenKind union and keyword map
- Add to grammar.ts consumeRelation() recognized relation kinds
- Dense DSL users can now write: '.a' leftAlignedWith '.b', etc.
  (previously returned parser error 'Expected relation')
This commit is contained in:
John Dvorak
2026-05-21 14:39:01 -07:00
parent 96bcce1ddb
commit 4ff56d61c2
2 changed files with 10 additions and 1 deletions
+2 -1
View File
@@ -1139,7 +1139,8 @@ export class GrammarParser {
const relationKinds: Array<Token['kind']> = [
'leftOf', 'rightOf', 'above', 'below',
'alignedWith', 'centeredWithin', 'inside', 'contains', 'overlaps', 'separatedFrom',
'alignedWith', 'leftAlignedWith', 'rightAlignedWith', 'topAlignedWith', 'bottomAlignedWith',
'centeredWithin', 'inside', 'contains', 'overlaps', 'separatedFrom',
// Spatial aliases
'beside', 'nextTo', 'adjacent', 'touching', 'near', 'under', 'within',
]