Fixed incorrect register move

This commit is contained in:
2024-08-02 12:55:25 +02:00
parent 34d865986a
commit b1f0d20394
12 changed files with 38 additions and 31 deletions

View File

@ -31,12 +31,14 @@ const (
Shr // >>
LogicalAnd // &&
LogicalOr // ||
_comparisons // <comparisons>
Equal // ==
NotEqual // !=
Less // <
Greater // >
NotEqual // !=
LessEqual // <=
GreaterEqual // >=
_comparisonsEnd // </comparisons>
Define // :=
Period // .
Call // x()

View File

@ -28,6 +28,11 @@ func (t Token) IsAssignment() bool {
return t.Kind > _assignments && t.Kind < _assignmentsEnd
}
// IsComparison returns true if the token is a comparison operator.
func (t Token) IsComparison() bool {
return t.Kind > _comparisons && t.Kind < _comparisonsEnd
}
// IsExpressionStart returns true if the token starts an expression.
func (t Token) IsExpressionStart() bool {
return t.Kind == GroupStart || t.Kind == ArrayStart || t.Kind == BlockStart