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

charlespwdand 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
charlespwdforce-pushed the cp-expression-refactor branch from 1cb61d0 to 6f03452CompareJanuary 27, 2026 15:00
@graygilmore
graygilmore removed their request for review March 23, 2026 16:00
@graygilmore
graygilmore removed the request for review from karreiroMarch 23, 2026 16:00
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

@charlespwd