E01074: semicolons are not needed in EK9 - uses indentation-based syntax like Python

Category: E01xxx Parsing and excluded constructs · Reported in phase: SYMBOL_DEFINITION · Classification: SEMICOLON_NOT_NEEDED · All error codes

What went wrong

Semicolons are not used in EK9.

Worked examples

Compilable examples demonstrating this error and the correct fix:

  • ek9 -q 786 (Which keywords from other languages are excluded from EK9?)

Rationale

EK9 uses indentation-based syntax (like Python):

  • Cleaner, more readable code
  • Eliminates "missing semicolon" errors
  • Indentation naturally shows code structure

How to fix it

Simply remove the semicolon. EK9 uses newlines and indentation for structure.

See also

  • E01070: 'break' not supported (use stream pipelines with 'head')
  • E01071: 'continue' not supported (use stream pipelines with 'filter')
  • E01072: 'return' not supported (use return declarations)
  • E01073: 'null' not supported (use tri-state semantics)
  • E01074: semicolons not needed (indentation-based syntax)

https://ek9.io/basics.html#indentation https://ek9.io/forAI.json#$.excludedFeatures.features[?(@.keyword==";")]

Examples

Every example is compiled by the EK9 compiler: the first fails exactly as captioned, the others fix it.

Fails with E01074: semicolons are not needed in EK9 - uses indentation-based syntax like Python

#!ek9
defines module error.e01074.bad

  defines function

    trySemicolonAfterAssignment()
      name <- "Steve";
      require name?

    trySemicolonAfterCall()
      stdout <- Stdout()
      stdout.println("Hello");

    trySemicolonAfterIncrement()
      count <- 0
      count++;
      require count?

Fixed: A line ends at the line end: remove the semicolons

#!ek9
defines module error.e01074.good.fix

  defines function

    trySemicolonAfterAssignment()
      name <- "Steve"
      require name?

    trySemicolonAfterCall()
      stdout <- Stdout()
      stdout.println("Hello")

    trySemicolonAfterIncrement()
      count <- 0
      count++
      require count?

Fixed: Remove the semicolons: one statement per line

#!ek9
defines module error.e01074.good

  defines function

    greet()
      name <- "Steve"
      stdout <- Stdout()
      stdout.println("Hello " + name)

    countUp()
      <- count as Integer: 0
      count++

Questions and answers

These Q&A entries show E01074 and its fix:

Found a problem?

If EK9 reported E01074 for a program you think is valid, or did not report it where it should have, use the compiler form with the smallest program that shows it. If this page is wrong or unclear, use the documentation form. Both are at github.com/ek9lang/ek9-issues.