From e52d50ed594dd5626523ca7931315e47bde8c9d1 Mon Sep 17 00:00:00 2001 From: Marshall Lochbaum Date: Mon, 20 Jul 2020 14:05:36 -0400 Subject: Make header id slugs match Github's --- docs/spec/evaluate.html | 2 +- docs/spec/grammar.html | 2 +- docs/spec/literal.html | 2 +- docs/spec/token.html | 2 +- docs/spec/types.html | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'docs/spec') diff --git a/docs/spec/evaluate.html b/docs/spec/evaluate.html index 66e49930..9f9781d3 100644 --- a/docs/spec/evaluate.html +++ b/docs/spec/evaluate.html @@ -1,6 +1,6 @@ -

Specification: BQN evaluation

+

Specification: BQN evaluation

This page describes the semantics of the code constructs whose grammar is given in grammar.md. The formation rules there are not named, and here they are identified by either the name of the term or by copying the rule entirely if there are several alternative productions.

Here we assume that the referent of each identifier, or equivalently the connections between identifiers, have been identified according to the scoping rules.

Programs and blocks

diff --git a/docs/spec/grammar.html b/docs/spec/grammar.html index 8a3ead18..f6bf3810 100644 --- a/docs/spec/grammar.html +++ b/docs/spec/grammar.html @@ -1,6 +1,6 @@ -

Specification: BQN grammar

+

Specification: BQN grammar

BQN's grammar is given below. Terms are defined in a BNF variant. However, handling special names properly is possible but difficult in BNF, so they are explained in text along with the braced block grammar.

The symbols s, F, _m, and _c_ are identifier tokens with subject, function, 1-modifier, and 2-modifier classes respectively. Similarly, sl, Fl, _ml, and _cl_ refer to literals and primitives of those classes. While names in the BNF here follow the identifier naming scheme, this is informative only: syntactic classes are no longer used after parsing and cannot be inspected in a running program.

A program is a list of statements. Almost all statements are expressions. However, explicit definitions and valueless results stemming from ยท, or ๐•จ in a monadic brace function, can be used as statements but not expressions.

diff --git a/docs/spec/literal.html b/docs/spec/literal.html index 8cac38c5..928e64fc 100644 --- a/docs/spec/literal.html +++ b/docs/spec/literal.html @@ -1,6 +1,6 @@ -

Specification: BQN literal notation

+

Specification: BQN literal notation

A literal is a single token that indicates a fixed character, number, or array. While literals indicate values of a data type, primitives indicate values of an operation type: function, 1-modifier, or 2-modifier.

Two types of literal deal with text. As the source code is considered to be a sequence of unicode code points ("characters"), and these code points are also used for BQN's character data type, the representation of a text literal is very similar to its value. In a text literal, the newline character is always represented using the ASCII line feed character, code point 10. A character literal is enclosed with single quotes ' and its value is identical to the single character between them. A string literal is enclosed in double quotes ", and any double quotes between them must come in pairs, as a lone double quote marks the end of the literal. The value of a string literal is a rank-1 array whose elements are the characters in between the enclosing quotes, after replacing each pair of double quotes with only one such quote.

The format of a numeric literal is more complicated. From the tokenization rules, a numeric literal consists of a numeric character (one of ยฏโˆžฯ€.0123456789) followed by any number of numeric or alphabetic characters. Some numeric literals are valid and indicate a number, while others are invalid and cause an error. The grammar for valid numbers is given below in a BNF variant. Only four alphabetic characters are allowed: "i", which separates the real and imaginary components of a complex number, "e", which functions as in scientific notation, and the uppercase versions of these letters.

diff --git a/docs/spec/token.html b/docs/spec/token.html index 9a121561..c12fc3e4 100644 --- a/docs/spec/token.html +++ b/docs/spec/token.html @@ -1,6 +1,6 @@ -

Specification: BQN token formation

+

Specification: BQN token formation

This page describes BQN's token formation rules (token formation is also called scanning). Most tokens in BQN are a single character long, but quoted characters and strings, identifiers, and numbers can consist of multiple characters, and comments, spaces, and tabs are discarded during token formation.

BQN source code should be considered as a series of unicode code points, which we refer to as "characters". The separator between lines in a file is considered to be a single character, newline, even though some operating systems such as Windows typically represent it with a two-character CRLF sequence. Implementers should note that not all languages treat unicode code points as atomic, as exposing the UTF-8 or UTF-16 representation instead is common. For a language such as JavaScript that uses UTF-16, the double-struck characters ๐•จ๐•Ž๐•ฉ๐•๐•—๐”ฝ๐•˜๐”พ are represented as two 16-bit surrogate characters, but BQN treats them as a single unit.

A BQN character literal consists of a single character between single quotes, such as 'a', and a string literal consists of any number of characters between double quotes, such as "" or "abc". Character and string literals take precedence with comments over other tokenization rules, so that # between quotes does not start a comment and whitespace between quotes is not removed, but a quote within a comment does not start a character literal. Almost any character can be included directly in a character or string literal without escaping. The only exception is the double quote character ", which must be written twice to include it in a string, as otherwise it would end the string instead. Character literals require no escaping at all, as the length is fixed. In particular, literals for the double and single quote characters are written ''' and '"', while length-1 strings containing these characters are "'" and """".

diff --git a/docs/spec/types.html b/docs/spec/types.html index 4570d2da..d3f71050 100644 --- a/docs/spec/types.html +++ b/docs/spec/types.html @@ -1,6 +1,6 @@ -

Specification: BQN types

+

Specification: BQN types

BQN programs manipulate data of six types: