Skip to content

[FEATURE] Unary operators #115

@cykna

Description

@cykna

Summary

Implement a unary operators, such as +expr -expr, !expr ~expr

Problem

The language yet hasn't any kind of unary operators to define negative values, logical and bit not operators

Proposed Solution

Modify the Parser and the HIR to handle the unary operators with a new expression type.

Alternatives Considered

N/A

Impact Area

Mark the area most affected:

  • syntax / language design
  • frontend / parser
  • frontend / checker
  • middleend / IR
  • docs / workflow
  • tooling / CI
  • other

Example

func negative(n: int): int = -n;

Extra Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions