/ZESL

Zayne's Extremely Simple Language

Zayne's Extremely Simple Language

Inspired by Tom's Obvious Minimal Language (TOML) and YAML

This project isn't serious btw; This was just a side project 👀. ZESL won't be getting regularly scheduled updates.

Usage

ZESL has its own official module hosted on PYPI. It uses Lark to parse content.

pip install zesl

Grammar

ZESL uses the BNF grammar format. It's grammar is as follows:

<program> ::= <statement>

<statement> ::= <key>
| <comment>

<letter> ::= "A" | "B" | "C" | "D" | "E" | "F" | "G"
       | "H" | "I" | "J" | "K" | "L" | "M" | "N"
       | "O" | "P" | "Q" | "R" | "S" | "T" | "U"
       | "V" | "W" | "X" | "Y" | "Z" | "a" | "b"
       | "c" | "d" | "e" | "f" | "g" | "h" | "i"
       | "j" | "k" | "l" | "m" | "n" | "o" | "p"
       | "q" | "r" | "s" | "t" | "u" | "v" | "w"
       | "x" | "y" | "z"

<digit> ::= "0" | "1" | "2" | "3" | "4" | "5"
	   | "6" | "7" | "8" | "9"

<symbol> ::=  "|" | " " | "!" | "#" | "$" | "%" | "&" | "(" | ")" | "*" | "+" | "," | "-" | "." | "/" | ":" | ";" | ">" | "=" | "<" | "?" | "@" | "[" | "\\" | "]" | "^" | "_" | "`" | "{" | "}" | "~"

<comment> ::= ">" " "* (<digit> | <letter> | " " | <symbol>)+

<header> ::= <letter>+ ":" ("\n" " "* <key>)*

<value> ::= "\"" (<digit> | <letter> | " " | <symbol>)* "\"" | <digit>+ | "."* <digit>+ "."* <digit>*
<key> ::= <letter>+ "=" <value> " "* <comment>*

Syntax

ZESL supports strings, integers, and floats. ZESL also support usage of comments.

> This is a comment.
Local:
 city="Salt Lake City, Utah"
 area=801
 precipitation=50.0

car="Sedan"
year=2011

The correct way to enclose an string in ZESL would be in double quotes. Attempting to use single quotes will result in an error.

quote='Do not fear mistakes. There are none. (Miles Davis)' > Wrong way to write strings.
quote="Do not fear mistakes. There are none. (Miles Davis)" > Correct way to write strings. Note the double quotes.

Goals

If I do decide to at least dedicate SOME of my time to this project, here's what I would do.

  • Add [] and {}, allows for defining dicts and/or lists.
  • Syntax sugar!?