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-expression-refactor branch from 34101f9 to 806c613 Compare January 14, 2026 14:57
@charlespwd
charlespwd force-pushed the cp-expression-refactor branch 2 times, most recently from 1cb61d0 to 6f03452 Compare January 27, 2026 15:00
charlespwd and others added 16 commits October 26, 2026 20:57
- 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 6f03452 to 6519af8 Compare October 27, 2026 01:12
@charlespwd
charlespwd added this pull request to stack #2135 October 27, 2026 18:07

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant