CodeusTech / CodeusTech/Xita

Boolean Primitives are not semantically implemented

Open
#72 0 comments 0 reactions 0 assignees View on GitHub
bug enhancement good first issue
Dominant language
C++
Stars
5
Forks
0
PR merge metrics
No merged PRs in 30d

Description

(See [tests/Conditions/if.xs](https://github.com/CodeusTech/XCSL-AArch64/blob/PreAlpha-Dev/tests/Conditions/if.xs))

In the second `if ... then ... else ...` statement, `False` is only syntactically active right now.

When a boolean primitive (`True` & `False`), is encountered, a corresponding value should be pushed onto the active register stack. E.g. `False` should produce '0' and `True` should produce '1'. When a primitive is encountered, the minimum following changes need to occur:
* `LastType(TYPE_BOOLEAN)` and `LastConstructor(TYPE_BOOLEAN)` is recorded in the context manager
* `LastData(x)` is recorded in context manager, where x==1 or x==0 depending on True/False
* `LastExpression(EXP_LITERAL)` is recorded in Context Manager

The active register stack seems to allocate a new register when boolean literals are encountered, so that shouldn't need any attention.

NOTE: This effect should also trigger when a constant or function is invoked (if it returns a boolean literal value).

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.