Skip to content
Beskid The Beskid Book

Beskid

Jump to a Beskid service

Beskid

Jump to a Beskid service

07.1 Lexical basics

Tokens, identifiers, comments, and the syntax skeleton before semantics."

Lexical basics

Before types, the lexer decides whether your file is even language or performance art.

Beskid source uses familiar C-family cues:

  • Identifiers and keywords
  • Braces and semicolons where the grammar demands
  • Line and block comments (//, /* */ per spec)
  • String and numeric literals (exact lexical rules: lexical and syntax)

File-scoped mod must appear as the first top-level item when used. The parser assumes structure before semantic phases attach module identity.

/// doc comments attach to declarations; @arg belongs on callable parameters only—not fields you felt like documenting. Tutorial on docs arrives later; normative: documentation comments.

When the lexer/parser disagrees with you, shrink to a five-line file and run:

Terminal window
beskid parse tiny.bd
beskid tree tiny.bd
flowchart LR
  SRC[.bd file] --> LEX[lexical]
  LEX --> PAR[parse]
  PAR --> SEM[semantic]

Types and generics