Treat non-formula lines as text instead of erroring - #6
Merged
Conversation
Elo is a notepad first and a calculator second, but the parser was eager:
every non-empty line was parsed and evaluated, so ordinary prose ("buy some
milk", "groceries") surfaced "unknown identifier" errors on the right side.
Previously only bare-identifier list items were swallowed.
Each line is now classified into LineKind::Formula or LineKind::Text. A line
falls back to Text only when it both errors and doesn't look like a deliberate
calculation: the parser left tokens unconsumed (trailing prose) or the whole
line is a single bare identifier. This preserves the intentional eagerness
from the earlier markdown/list work — genuine mistakes like foo(10) or
1 / bogus still report errors, and a lone known variable name still recalls
its value.
Evaluation is also split from committing side effects: prose lines no longer
pollute prev, the running block (sum/avg), or variables.
- parser: expose at_end() so the session can detect partial parses
- session: add LineKind, classify(), unify list-marker handling, defer
record_result/variable insertion to confirmed formulas
- tauri: surface is_text on LineResult
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018drjRsrfVJ8479qvrqPjNR
The released Elo.app failed to launch because Elo.app/Contents/MacOS/Elo had lost its executable bit. Root cause: actions/upload-artifact does not retain Unix file permissions. The build-macos job uploaded the raw Elo.app directory; by the time the release job downloaded and zipped it, +x was gone (the .dmg was unaffected since its filesystem image is opaque to the artifact mechanism). Zip the bundle on the macOS runner with `ditto -c -k --keepParent`, which preserves permissions and symlinks, and ship that archive through to the release unchanged instead of re-zipping the permission-stripped download. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018drjRsrfVJ8479qvrqPjNR
Switch the macOS release artifact from Elo-macos.app.zip to the universal .dmg, which Homebrew casks mount natively. The build previously passed `--bundles app`, so no DMG was ever produced (the dmg cp silently no-opped); build `--bundles dmg` so the universal disk image is created and shipped. The DMG is a single opaque image, so upload-artifact's permission stripping can't touch the executable bit inside it — this also removes the need for the ditto-zip workaround, which is dropped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018drjRsrfVJ8479qvrqPjNR
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Elo is a notepad first and a calculator second, but the parser was eager:
every non-empty line was parsed and evaluated, so ordinary prose ("buy some
milk", "groceries") surfaced "unknown identifier" errors on the right side.
Previously only bare-identifier list items were swallowed.
Each line is now classified into LineKind::Formula or LineKind::Text. A line
falls back to Text only when it both errors and doesn't look like a deliberate
calculation: the parser left tokens unconsumed (trailing prose) or the whole
line is a single bare identifier. This preserves the intentional eagerness
from the earlier markdown/list work — genuine mistakes like foo(10) or
1 / bogus still report errors, and a lone known variable name still recalls
its value.
Evaluation is also split from committing side effects: prose lines no longer
pollute prev, the running block (sum/avg), or variables.
record_result/variable insertion to confirmed formulas
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_018drjRsrfVJ8479qvrqPjNR