Module

lexie/check

src/lexie/check.pooka

A careful reading before anything is written down.

Checks a specification before anything is generated: duplicates, conflicts, invalid names, and definitions that could never match.

API reference

function

validate

src/lexie/check.pooka:26
validate(c: Config) -> List(ConfigError)

Every problem with a specification, or none, sorted so the same specification always reports the same way.

Pooka
import lexie/check
import lexie/config

assert check.validate(config.default_config()) == []
function

comment_starts

src/lexie/check.pooka:122
comment_starts(c: Config) -> List(#(String, String))
INFERREDfn(lexie/config.Config) -> List(#(String, String))

Comment openers, with their sections.

function

lexable_as_identifier

src/lexie/check.pooka:289
lexable_as_identifier(c: Config, text: String) -> Bool
INFERREDfn(lexie/config.Config, String) -> Bool

Would the identifier rules read this text as one identifier? A keyword that would not, such as if!, could never be lexed as a keyword.

function

duplicates

src/lexie/check.pooka:641
duplicates(items: List(String)) -> List(String)
INFERREDfn(List(String)) -> List(String)

Items that appear more than once, sorted.

function

escape

src/lexie/check.pooka:648
escape(text: String) -> String
INFERREDfn(String) -> String

Text with line breaks, tabs and backslashes made visible.