earl-lang-syntax

Crates.ioearl-lang-syntax
lib.rsearl-lang-syntax
version1.0.0
sourcesrc
created_at2020-08-28 18:19:24.701289
updated_at2020-08-28 20:51:35.129692
descriptionA simple tokenizer and parser for the language Earl.
homepagehttps://github.com/davidhs/earl-syntax-rs
repositoryhttps://github.com/davidhs/earl-syntax-rs
max_upload_size
id282029
size69,507
Davíð Helgason (davidhs)

documentation

README

Earl Syntax

Earl syntax is an s-expression-like language. It supports lists but not pairs like s-expression.

The main difference between S-expressions and Earl syntax are the multi-line strings and nesting comments.

You should be able to comment out any text given sufficently many semicolons on both sides of the text, e.g. ;;;(...);;;, and you should be able to put whatever inside a string given sufficently many double quotation marks, e.g. """".text here."""".

Description

Strings

A string starts with a double quotation mark ".

A string starts with n (one or more) ", followed by the flags which are any number of characters excluding . and maybe ,, then the body of the string, and finally ends with . or , and n ".

Examples,

"Hello world!"

".Hello world!."

".Hello
world."

""""",
This is a multi-line string,
."""
the continues on here.
,"""""

; A raw string could look like this.
"r.C\User\Name\My Documents\script.js"

Comments

A single-line comments starts with ; and spans until the end of the line (or end of file)

A (nesting) multi-line starts with n ;, followed by (, then some text, and then by ) followed by n ;.

Examples,

; This is a single-line comment

;( This is a
  ;( nesting );
  multi-line comment );

;;( this is also a ;( nesting ); multi-line comment );;
Commit count: 8

cargo fmt