Expand description
Yog Script (.ys) and Yog Nanite Script (.yns): the language a Yog
mod is written in (docs/design/ys.md, docs/design/ys-grammar.md).
This crate reads a source into its syntax tree, resolves its names and
says what’s wrong with it, as Diagnostics placed in the source.
Modules§
- ast
- The syntax tree of a Yog Script source (
docs/design/ys-grammar.md). - index
- The class index (
docs/design/ys.md§8): what the compiler knows of the game for one Minecraft version — each class by Mojang’s name, the side it’s on, what it extends and implements, its fields and methods with their descriptors and access. Built byyog indexfrom the game’s own jars; the resolver and the type checker look the game’s names up in it. - parser
- The parser core: a cursor over tokens, problems and recovery, and the
turn-taking — each form is parsed by its word (
words/) or by a generic form here (types, members, blocks, expressions by precedence). - resolve
- What the names of a source stand for, and what’s out of place: each
name looked up in the scopes around it (a declaration’s anywhere in its
body, a block’s from where it’s bound), declared twice, assigned while
constant, cased against C#’s style,
breakoutside a loop,skipoutside abefore,itoutside a block lambda,thisoutside members,awaitoutsideasync. Names a source doesn’t declare are the game’s and the library’s: the type checker looks them up. - token
- What the lexer cuts a source into: tokens, each with where it is.
- words
- The words of Yog Script. Each word is one file under
words/: how it’s written, what it means (shown by editors) and how it parses. The parser core only hands each word its turn; this file only lists them.
Structs§
- Checked
- A source checked: its tree, what its names stand for, its problems.
- Parsed
- A source read: its tree (what could be read of it) and its problems.