Skip to content

Add support for typed expressions - #54

Merged
rascmatt merged 1 commit into
mainfrom
standalone-expressions
Jan 27, 2026
Merged

Add support for typed expressions#54
rascmatt merged 1 commit into
mainfrom
standalone-expressions

Conversation

@rascmatt

Copy link
Copy Markdown
Owner

This PR adresses issue #51

For evaluating expressions, we now accept a typed expression of the following form:

<texp> : <exp>

e.g. Bool: true.or false

This is a slight syntax extension to support expressions without explicit value names, i.e. as opposed to x: Bool = true.or false when invoking the SIFL interpreter via eval (or repl).

Under the hood we parse this to a ValueDefinition, with a random (uuid) name. This way we don't have to change anything of our current symbols resolving + type checking + interpreter implementation.

- introduce new syntax for 'anonymous'
  value definitions
- accept expressions in CLI commands
@rascmatt
rascmatt force-pushed the standalone-expressions branch from 0c7e995 to c8df386 Compare January 27, 2026 17:14
@rascmatt
rascmatt requested a review from Jozott00 January 27, 2026 17:16

@Jozott00 Jozott00 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is a good way to support the REPL

@rascmatt
rascmatt merged commit f936a2a into main Jan 27, 2026
1 check passed
@rascmatt
rascmatt deleted the standalone-expressions branch January 27, 2026 17:48
@rascmatt rascmatt mentioned this pull request Jan 28, 2026
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