Skip to content

WIP2 - #2020

Draft
charlespwd wants to merge 17 commits into
cp-one-parserfrom
cp-expression-refactor
Draft

WIP2#2020
charlespwd wants to merge 17 commits into
cp-one-parserfrom
cp-expression-refactor

Conversation

@charlespwd

Copy link
Copy Markdown
Contributor

Architectural changes

  • parse_expression and safe_parse_expression have been removed from Tag and ParseContext
  • Parser methods now produce AST nodes instead of strings
    • Parser#expression produces a value,
    • Parser#string produces a string,
    • etc.

Breaking changes

  • Parser#expression is renamed to Parser#expression_string
  • safe_parse_expression methods are replaced by Parser#expression
  • parse_expression methods are replaced by Parser#unsafe_parse_expression
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch from 9e95ad0 to 5e3d8f4 Compare December 3, 2025 17:46
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch from 5e3d8f4 to 34101f9 Compare January 12, 2026 16:56
@charlespwd
charlespwd force-pushed the cp-one-parser branch 3 times, most recently from d0ccab5 to f4a5454 Compare January 14, 2026 14:55
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch from 34101f9 to 806c613 Compare January 14, 2026 14:57
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch from 806c613 to 1cb61d0 Compare January 26, 2026 16:06
charlespwd and others added 17 commits January 26, 2026 16:52
- Make `Parser` accept the expression cache
- Remove `safe_parse_expression` from `ParseContext`
- Replace all usage of `safe_parse_expression` with `parser.expression_node`
- Add Parser#string
- Add Parser#unsafe_parse_expression
- Add private Parser#parse_expression
- Remove ParseContext.parse_expression
- Remove Tag.parse_expression
- Condition.parse_expression now takes a parser as argument
We don't need all the multi-dot logic in a world where number comes
out of the Lexer.
Goal is to get rid of it entirely, but baby steps.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch from 1cb61d0 to 6f03452 Compare January 27, 2026 15:00
@graygilmore
graygilmore removed their request for review March 23, 2026 16:00
@graygilmore
graygilmore removed the request for review from karreiro March 23, 2026 16:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

1 participant