Skip to content

Add Calculation of Values with Filter Suffix to SET command - #334

Merged
solara404 merged 7 commits into
mainfrom
filter_calc
Nov 16, 2026
Merged

solara404 merged 7 commits into
mainfrom
filter_calc

Conversation

@solara404

@solara404 solara404 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator

The SET command accepts and computes now values that include filter suffixes (a, c, d, l).

#330

SET var 1a
info: Variable 'var': 1a

SET var = var + 1
info: Variable 'var': 2a

SET var2 = 1a + 2
info: Variable 'var': 3a

#### Additional Changes
Variable creation now restricted for the filter suffix characters (a, c, d, l)

SET a 1
error: "a" is a filter suffix and cannot be used as a variable!
error: InvalidVariableName

Variable naming should not be further restricted

@solara404
solara404 force-pushed the filter_calc branch 2 times, most recently from 4abbbd5 to 378ebfd Compare November 6, 2026 02:43
@solara404
solara404 requested a review from aaumar25 November 6, 2026 03:55
@aaumar25

aaumar25 commented Nov 6, 2026

Copy link
Copy Markdown
Member

Additional Changes

Variable creation now restricted for the filter suffix characters (a, c, d, l)

SET a 1
error: "a" is a filter suffix and cannot be used as a variable!
error: InvalidVariableName

Why?

@solara404

solara404 commented Nov 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

I think it would even be good to force the user to have a space or no other character after the variable.
This way the variable coloring works and indicates which are valid variables

eg.:

set a 2
set b = 1a + a
set c = 1a + a+5 // Here it would be marked as text 
set c = 1a + a +5 // Here the color coding would show clearly that this is a valid variable 

@solara404

Copy link
Copy Markdown
Collaborator Author

The variable name limitation has been removed (variables can be named again a, c, d, l)
Variables now need to separated by a space, this also ensures correct color-coding in the CLI

@aaumar25 aaumar25 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, please removes debug message before merging

Comment thread src/command.zig Resolved
Comment thread src/command.zig Resolved
Comment thread src/command.zig Resolved
@solara404
solara404 merged commit 52d5afd into main Nov 16, 2026
2 checks passed
@solara404
solara404 deleted the filter_calc branch November 16, 2026 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants