Skip to content

Fix semantic rules for forward references in local functions#79

Merged
kostis merged 1 commit intokostis:masterfrom
JohnnyPol:fix/scope
Jul 30, 2025
Merged

Fix semantic rules for forward references in local functions#79
kostis merged 1 commit intokostis:masterfrom
JohnnyPol:fix/scope

Conversation

@JohnnyPol
Copy link
Contributor

Forward declaration enforcement for local functions

  • Dana's specification (§1.3.2 – Δομικές μονάδες) states that if a local function calls another local function defined later in the same scope, that called function must either be defined earlier or declared beforehand using decl.
  • In our case, we applied the first option: we reordered the local function definitions so that any function is defined before it is used.

Therefore, in the Dana programs, we moved the definition of the swap function above other functions (such as quicksort) that call it.

@kostis kostis merged commit 2850672 into kostis:master Jul 30, 2025
2 checks passed
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