Celerity
RepositoryFinancesDiscussionsDiscordZulip
  • Home
  • Installation
  • Language
    • Basic Concepts
      • Modules and Code Reuse
      • Types and Values
      • Optional Type Checking
      • Mutability and Freezing
      • Pattern Matching
      • Error Handling
      • Agents and Communication
      • Garbage Collection
      • Startup and Termination
    • Lexical Structure
      • Shebang Line
      • Blanks
      • Comments
      • Operators
      • Punctuators
      • Keywords
      • Identifiers
      • Literals
    • Modules
    • Attributes
    • Declarations
      • Use Declaration
      • Type Declaration
      • Constant Declaration
      • Function Declaration
      • Test Declaration
    • Types
      • Special Types
        • Any Type
        • Unknown Type
        • Union Type
        • Variable Type
      • Nominal Type
      • Literal Type
      • Boolean Type
      • Integer Type
      • Real Type
      • Atom Type
      • String Type
      • Reference Type
      • Handle Type
      • Module Type
      • Record Type
      • Error Type
      • Tuple Type
      • Array Type
      • Set Type
      • Map Type
      • Function Type
      • Agent Type
    • Statements
      • Let Statement
      • Defer Statement
      • Expression Statement
    • Expressions
      • Value Expressions
        • Literal Expression
        • Module Expression
        • Record Expression
        • Error Expression
        • Tuple Expression
        • Array Expression
        • Set Expression
        • Map Expression
        • Lambda Expression
      • Operator Expressions
        • Unary Expressions
        • Additive Expressions
        • Multiplicative Expressions
        • Bitwise Expressions
        • Shift Expressions
        • Logical Expressions
        • Relational Expressions
      • Control Expressions
        • If Expression
        • Condition Expression
        • Match Expression
        • Receive Expression
        • While Expression
        • For Expression
        • Try Expression
        • Return Expression
        • Raise Expression
        • Next Expression
        • Break Expression
      • Parenthesized Expression
      • Block Expression
      • This Expression
      • Meta Expression
      • Assert Expression
      • Identifier Expression
      • Assignment Expression
      • Field Expression
      • Index Expression
      • Call Expression
      • Send Expression
    • Patterns
      • Wildcard Pattern
      • Literal Pattern
      • String Pattern
      • Module Pattern
      • Record Pattern
      • Error Pattern
      • Tuple Pattern
      • Array Pattern
      • Map Pattern
      • Set Pattern
  • Tooling
    • CLI Driver
    • Project Configuration
    • Editor Extensions
    • Analysis Diagnostics
      • Syntax Diagnostics
        • Syntax Diagnostic E0000
        • Syntax Diagnostic E0001
        • Syntax Diagnostic E0002
        • Syntax Diagnostic E0003
        • Syntax Diagnostic E0004
        • Syntax Diagnostic E0005
        • Syntax Diagnostic E0006
        • Syntax Diagnostic E0007
        • Syntax Diagnostic E0008
        • Syntax Diagnostic E0009
        • Syntax Diagnostic E0010
        • Syntax Diagnostic E0011
        • Syntax Diagnostic E0012
        • Syntax Diagnostic E0013
        • Syntax Diagnostic E0014
        • Syntax Diagnostic E0015
        • Syntax Diagnostic E0016
        • Syntax Diagnostic E0017
        • Syntax Diagnostic E0018
        • Syntax Diagnostic E0019
        • Syntax Diagnostic E0020
        • Syntax Diagnostic E0038
        • Syntax Diagnostic E0039
        • Syntax Diagnostic E0040
      • Semantic Diagnostics
        • Semantic Diagnostic E0021
        • Semantic Diagnostic E0022
        • Semantic Diagnostic E0023
        • Semantic Diagnostic E0024
        • Semantic Diagnostic E0025
        • Semantic Diagnostic E0026
        • Semantic Diagnostic E0027
        • Semantic Diagnostic E0028
        • Semantic Diagnostic E0029
        • Semantic Diagnostic E0030
        • Semantic Diagnostic E0031
        • Semantic Diagnostic E0032
        • Semantic Diagnostic E0033
        • Semantic Diagnostic E0034
        • Semantic Diagnostic E0035
        • Semantic Diagnostic E0036
        • Semantic Diagnostic E0037
    • Lints
      • Test Without Assert
      • Undocumented Public Symbol
      • Unreachable Code
      • Unused Local Symbol
      • Uppercase Base Indicator
Powered by GitBook

Copyright © Vezel Contributors

On this page
  • Nil Literal
  • Boolean Literal
  • Integer Literal
  • Real Literal
  • Atom Literal
  • String Literal
  • Regular String Literal
  • Verbatim String Literal
  • Block String Literal
Edit on GitHub
Export as PDF
  1. Language
  2. Lexical Structure

Literals

literal ::= nil-literal |
            boolean-literal |
            integer-literal |
            real-literal |
            atom-literal |
            string-literal

Nil Literal

nil-literal ::= 'nil'

Boolean Literal

boolean-literal ::= 'true' |
                    'false'

Integer Literal

integer-literal ::= binary-integer-literal |
                    octal-integer-literal |
                    decimal-integer-literal |
                    hexadecimal-integer-literal
binary-integer-literal ::= '0' [bB] binary-digit ('_'* binary-digit)*
binary-digit ::= [0-1]
octal-integer-literal ::= '0' [oO] octal-digit ('_'* octal-digit)*
octal-digit ::= [0-7]
decimal-integer-literal ::= decimal-digit ('_'* decimal-digit)*
decimal-digit ::= [0-9]
hexadecimal-integer-literal ::= '0' [xX] hexadecimal-digit ('_'* hexadecimal-digit)*
hexadecimal-digit ::= [0-9a-fA-F]

Real Literal

real-literal ::= real-part '.' real-part ([eE] [+-]? real-part)?
real-part ::= decimal-digit ('_'* decimal-digit)*

Atom Literal

atom-literal ::= ':' (upper-identifier |
                      lower-identifier |
                      discard-identifier)

String Literal

string-literal ::= regular-string-literal |
                   verbatim-string-literal |
                   block-string-literal

Regular String Literal

regular-string-literal ::= '"' ([^#xa#xd#x85#x2028#x2029"\] |
                                regular-string-escape-sequence)* '"'
regular-string-escape-sequence ::= '\' (regular-string-escape-simple |
                                        regular-string-escape-unicode)
regular-string-escape-simple ::= [0aAbBeEfFnNrRtTvV"\]
regular-string-escape-unicode ::= [uU] hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit hexadecimal-digit

Verbatim String Literal

verbatim-string-literal ::= '"""' '"'* [^#xa#xd#x85#x2028#x2029]+ '"""' '"'*

Block String Literal

block-string-literal ::= '"""' '"'* white-space* line-break block-string-line white-space* '"""' '"'*
block-string-line ::= [^#xa#xd#x85#x2028#x2029]* line-break

Last updated 2 years ago