From 55fd0731b3eb89bb79af5ffed8701bc24408bde0 Mon Sep 17 00:00:00 2001 From: Antal Spector-Zabusky Date: Thu, 7 Aug 2025 17:27:11 -0400 Subject: [PATCH] Update spec to latest version, including quil-lang/quil#93 --- index.html | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index 4c54d39..3ecff4d 100644 --- a/index.html +++ b/index.html @@ -1,7 +1,7 @@ - + @@ -514,14 +514,27 @@

Table of Contents

Note that since indents must follow a newline, we include the newline as a part of the syntax definition of an indent.

-

Non-negative integers are written as usual. Leading zeros do not -change the interpretation of these numeric literals. -

Integer ::= [0-9]+

-

Real numbers are written in usual floating-point number syntax. -

Real ::= Integer?.?Integer((e | E)(- | +)?Integer)?

-

Complex numbers are an extension of this. -

Complex ::=Integer
|Real
|Real? i -
| pi
+

Non-negative integers can be written in decimal, hexadecimal, +octal, or binary. Decimal integers are written as usual, hexadecimal +integers start with '0x', octal integers start with '0o', and +binary integers start with '0b' (all case-insensitive). These +integers may contain interior or trailing underscores, which are +ignored; in the case of non-decimal integers, the underscores must +come after the identifying prefix. +

Integer ::=Decimal Integer
|Hexadecimal Integer
|Octal Integer
|Binary Integer

Decimal Integer ::= [0-9][0-9_]*

Hexadecimal Integer ::= 0[Xx]_*[0-9A-Fa-f][0-9A-Fa-f_]*

Octal Integer ::= 0[Oo]_*[0-7][0-7_]*

Binary Integer ::= 0[Bb]_*[01][01_]*

+

Non-integral real numbers are written in the usual decimal +floating-point number syntax (including an optional base-10 exponent +prefixed by case-insensitive 'e'), or as the special literal +'pi'. As with integers, decimal floating-point numbers may +contain internal or trailing underscores. +

Real ::=Numeric Real
| pi
Numeric Real ::=(Decimal Integer | Real With Decimal Point)([Ee](- | +)?_*Decimal Integer)?
|Hexadecimal Integer
|Octal Integer
|Binary Integer
Real With Decimal Point ::=Decimal Integer.Decimal Integer?
| .Decimal Integer
+

An imaginary number literal is an optional numeric real number +followed by the letter 'i' (case-sensitive). A complex +number literal is either a real number literal or an imaginary number +literal. (Something that looks like a mixed real and imaginary +complex number, such as '1+2i', is actually an arithmetic +expression and not a single literal.) +

Complex ::=Real
|Numeric Real?i

Strings are characters bounded by double-quotation mark characters '"'. If a double-quotation mark should be used within the string, it must be escaped with a backslash, like so: '\"'. Similarly, if