Skip to content

Commit

Permalink
Added line breaks to non-terminal lines.
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko committed Oct 28, 2023
1 parent a19f834 commit 6c1e730
Showing 1 changed file with 59 additions and 59 deletions.
118 changes: 59 additions & 59 deletions LANGUAGE.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,61 +47,61 @@ Wordplay's lexical grammar contains no keywords, in order to avoid privileging a

Some tokens are associated with basic values:

> none → `ø`
> true → ``
> none → `ø`
> true → ``
> false → ``
Numbers can be:

> arabic → `/-?[0-9]+([.,][0-9]+)?%?/`
> arabicbase → `/-?([2-9]|1[0-6]);[0-9A-F]+([.,][0-9A-F]+)?%?/`
> roman → `/(ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ)+/`
> japanese → `/-?[0-9]*[一二三四五六七八九十百千万]+(・[一二三四五六七八九分厘毛糸忽]+)?/`
> pi → `π`
> infinity → ``
> arabic → `/-?[0-9]+([.,][0-9]+)?%?/`
> arabicbase → `/-?([2-9]|1[0-6]);[0-9A-F]+([.,][0-9A-F]+)?%?/`
> roman → `/(ⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯ)+/`
> japanese → `/-?[0-9]*[一二三四五六七八九十百千万]+(・[一二三四五六七八九分厘毛糸忽]+)?/`
> pi → `π`
> infinity → ``
> number → arabic | arabicbase | roman | japanese | pi | infinity
We hope to add other numerals as we localize other languages.

Text literals can be opened and closed with numerous delimiters:

> textopen → `"` | `` | `` | `'` | `` | `` | `«` | `` | ``
> textclose → `"` | `` | `'` | `` | `` | `` | `` | `»`,, ``, ``
> markup → `\`
> textopen → `"` | `` | `` | `'` | `` | `` | `«` | `` | ``
> textclose → `"` | `` | `'` | `` | `` | `` | `` | `»`,, ``, ``
> markup → `\`
> text → _any sequence of characters between open/close delimiters_
Wordplay has a secondary notation for markup, entered with `\`\``, in which these tokens are valid:

> linkopen → `<`
> linkclose → `>`
> italics → language
> code → `\`
> light → `~`
> underscore → `_`
> bold → `*`
> extrabold → `^`
> link → `@`
> concept → `/@(?!(https?)?://)[a-zA-Z/]*`
> linkopen → `<`
> linkclose → `>`
> italics → language
> code → `\`
> light → `~`
> underscore → `_`
> bold → `*`
> extrabold → `^`
> link → `@`
> concept → `/@(?!(https?)?://)[a-zA-Z/]*`
> words → _any sequence of characters between `markup` that aren't markup delimeters above_
Compound data structures have several delimiters:

> listopen → `[`
> listclose → `]`
> setmapopen → `{`
> setmapclose → `}`
> tableopen → ``
> tableclose → ``
> select → `⎡?`
> insert → `⎡+`
> delete → `⎡-`
> listopen → `[`
> listclose → `]`
> setmapopen → `{`
> setmapclose → `}`
> tableopen → ``
> tableclose → ``
> select → `⎡?`
> insert → `⎡+`
> delete → `⎡-`
> update → `⎡:`
Some are associated with reactive values:

> reaction → `` | `...`
> initial → ``
> change → ``
> reaction → `` | `...`
> initial → ``
> change → ``
> previous → ``
The language uses a placeholder token extensively to allow for unifinished syntactially valid code.
Expand All @@ -110,26 +110,26 @@ The language uses a placeholder token extensively to allow for unifinished synta
Some tokens are associated with names:

> nameseparator → `,`
> nameseparator → `,`
> bind → `:`
Some are associated with localization:

> language-italic → `/`
> region → `-`
> locale → ``🌎` | `🌍` | `🌏`
> language-italic → `/`
> region → `-`
> locale → `🌎` | `🌍` | `🌏`
Some are associated with declarations:

> function → `ƒ`
> function → `ƒ`
> type → ``
Some are associated with particular types of expressions:

> evalopen → `(`
> evalclose → `)`
> condition → `?` | `¿`
> conversion → `` | `->` | `=>`
> evalopen → `(`
> evalclose → `)`
> condition → `?` | `¿`
> conversion → `` | `->` | `=>`
> access → `.`
Some are operators, including arithetmic, inequalities, logical, and unicode math, supplemental, and arrows:
Expand All @@ -138,17 +138,17 @@ Some are operators, including arithetmic, inequalities, logical, and unicode mat
Some are associated with type declarations:

> numbertype → `#`
> booleantype → condition
> or → `|`
> markuptype → `\…\`, `\...\`
> literaltype → `!`
> typevariableopen → ``
> numbertype → `#`
> booleantype → condition
> or → `|`
> markuptype → `\…\`, `\...\`
> literaltype → `!`
> typevariableopen → ``
> typevariableclose → ``
Some are associated with importing and exporting values from source:

> borrow → ``
> borrow → ``
> share → ``
Every other possible sequence of Unicode glyphs is interpreted as a `name`, separated by space or one of the tokens above.
Expand Down Expand Up @@ -211,8 +211,8 @@ We'll discuss more on the differences between those to function evaluations late

### Numbers

> NUMBER → number UNIT?
> UNIT → DIMENSION (·DIMENSION)_ (/ DIMENSION (·DIMENSION_))?
> NUMBER → number UNIT?
> UNIT → DIMENSION (·DIMENSION)_ (/ DIMENSION (·DIMENSION_))?
> DIMENSION → name (^arabic)?
Numbers are arbitrary precision decimals with optional units, where units are just products and quotients of names:
Expand Down Expand Up @@ -242,8 +242,8 @@ The unit type system is not arbitrarily sophisticated: when mathematical operato

### Text

> TEXT → TRANSLATION\*
> TRANSLATION → textopen text textclose LANGUAGE
> TEXT → TRANSLATION\*
> TRANSLATION → textopen text textclose LANGUAGE
> LANGUAGE → language name
Text values, unlike in other programming languages, are not a single sequence of Unicode code points. Rather, they are unique in two ways:
Expand Down Expand Up @@ -286,12 +286,12 @@ This will return `⊤` if the locale is in the preferred list, and, `⊥` otherw

### Markup

> MARKUP → FORMATTED\*
> FORMATTED → markup CONTENT markup LANGUAGE
> CONTENT → PARAGRAPH*
> PARAGRAPH → SEGMENT*
> SEGMENT → words | LINK | concept | CODE | MENTION
> LINK → linkopen words link words linkclose
> MARKUP → FORMATTED\*
> FORMATTED → markup CONTENT markup LANGUAGE
> CONTENT → PARAGRAPH*
> PARAGRAPH → SEGMENT*
> SEGMENT → words | LINK | concept | CODE | MENTION
> LINK → linkopen words link words linkclose
> CODE → code PROGRAM code
The final basic value is markup, which behaves identically to text values aside from their delimiters, and the meaning of the delimiters internal to text:
Expand Down

0 comments on commit 6c1e730

Please sign in to comment.