Skip to content

lykn-lang/grammar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lykn Grammar

Formal grammars and syntax definitions for lykn — a Lisp-flavoured JavaScript.

Contents

Directory Description
ebnf/ Formal W3C-style EBNF grammar with railroad diagram SVGs
text-mate/ TextMate grammar (source.lykn) for syntax highlighting and GitHub Linguist

File Extensions

lykn uses two file extensions:

Extension Layer Description
.lykn surface User-facing language: bind, func, type, match, threading macros, contracts
.lyk kernel Low-level s-expression IR: direct mapping to JavaScript constructs

EBNF Grammar

The formal grammar in ebnf/lykn.ebnf covers four sections:

  1. Lexical — tokens (symbols, numbers, keywords, strings, comments)
  2. Reader — s-expression structure (lists, vectors, maps, quotation)
  3. Surface — language forms (bind, func, type, match, etc.)
  4. Kernel — reference only (tracks ESTree/JavaScript)

Railroad diagrams for each production are in ebnf/diagrams/. To regenerate them:

cargo run

TextMate Grammar

The TextMate grammar at text-mate/syntaxes/lykn.tmLanguage.json provides syntax highlighting for both .lykn and .lyk files. It is used by GitHub Linguist for language detection and by editors that support TextMate grammars (VS Code, Sublime Text, etc.).

Links

License

MIT — see LICENSE.

About

Formal grammar definitions for the Lykn Programming Language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages