Error codes

E0024: expected an item

In a terminal: auk explain E0024 prints this page.

On this page

At the top level of a file only items are allowed: fn, struct, enum, shape, test, let and imprint. Statements belong inside a function, and Auk has no import: anything is reached by its path.

Wrong#

auk
print("hello")

Fixed#

auk
fn main() {
  print("hello")
}

Common causes#

  • Script-style code at the top level: put it in fn main().
  • import json or use std::fs: delete it and write json.parse(s) directly.
  • A stray token after an item, such as an extra }.

Stuck on a word? Try the glossary. Got a compiler error? Look up its code. Improve this page