QuTech-Delft / libqasm

libQASM: Library to parse cQASM files
https://arxiv.org/abs/1805.09607
Other
15 stars 16 forks source link

V3 Extended: Functions #198

Closed rturrado closed 4 months ago

rturrado commented 4 months ago

Add user-defined functions to the grammar. Functions are defined as def <name>(<parameters>) -> <return type> { <statements> }. The return type is optional. There is a return statement.

Functions are called as <name>(<arguments>). Arguments need to be promotable to the types of the parameters. Function calls are both expressions and statements.

Changest to the grammar

Changes to the AST

Changes to the v3x/analyzer

Changes to v3x/resolver

Changes to v3x/types

Changes to v3x/values

Changes to v1x files