Skip to content

Latest commit

 

History

History
88 lines (69 loc) · 1.63 KB

File metadata and controls

88 lines (69 loc) · 1.63 KB

RSScript grammar surface

Source: rsscript-syntax lexer tables.

This is a generated lexical reference, not a replacement for the parser. The parser and tests remain authoritative for production grammar and recovery. Its machine-readable companion is grammar.json, marked partial because it does not claim a full EBNF.

Reserved keyword classes

control

  • break
  • continue
  • else
  • for
  • if
  • in
  • loop
  • match
  • return
  • while

declaration

  • class
  • features
  • fn
  • handle
  • let
  • resource
  • struct

modifier

  • as
  • async
  • drop
  • effects
  • pub
  • with

ownership

  • fresh
  • local
  • manage
  • mut
  • read
  • take
  • weak

Contextual words

  • await (control)
  • native (modifier)

Parser-level words

The lexer leaves these as plain identifiers; the parser matches them as keywords in specific positions. They are declaration, clause, ownership and structured-concurrency words, and a program that uses one as an ordinary name will not parse where the parser expects the keyword.

  • captures (modifier)
  • const (declaration)
  • derives (modifier)
  • impl (declaration)
  • module (declaration)
  • noescape (ownership)
  • opaque (declaration)
  • owned (ownership)
  • protocol (declaration)
  • retains (modifier)
  • select (control)
  • spawn (control)
  • sum (declaration)
  • task_group (control)
  • type (declaration)
  • use (declaration)
  • view (declaration)

Built-in constants and constructors

  • Err
  • None
  • Ok
  • Some
  • Unit
  • false
  • true