diff options
| author | robot-piglet <[email protected]> | 2025-04-23 18:13:40 +0300 | 
|---|---|---|
| committer | robot-piglet <[email protected]> | 2025-04-23 18:26:05 +0300 | 
| commit | 58e50fbe999692bfde1c6a175ccf0d59f55b9658 (patch) | |
| tree | 2121d3e4413423e05c7204e099f1994d96e7be9e /yql/essentials/docs/en | |
| parent | ac324b9ce470cd7bec4d18dbe5e77495e96f92b8 (diff) | |
Intermediate changes
commit_hash:9b9fa862d523687c3eb883e9b94c2ecef522cda8
Diffstat (limited to 'yql/essentials/docs/en')
| -rw-r--r-- | yql/essentials/docs/en/syntax/lexer.md | 25 | 
1 files changed, 11 insertions, 14 deletions
| diff --git a/yql/essentials/docs/en/syntax/lexer.md b/yql/essentials/docs/en/syntax/lexer.md index 9e57b15d646..c63ad8e745e 100644 --- a/yql/essentials/docs/en/syntax/lexer.md +++ b/yql/essentials/docs/en/syntax/lexer.md @@ -1,11 +1,11 @@  # Lexical structure -The query in the YQL language is a valid UTF-8 text consisting of **statements** separated by semicolons (`;`). -The last semicolon can be omitted. -Each command is a sequence of **tokens** that are valid for this command. -Tokens can be **keywords**, **identifiers**, **literals**, and so on. -Tokens are separated by whitespace characters (space, tab, line feed) or **comments**. The comment is not a part of the command and is syntactically equivalent to a space character. +The query in the YQL language is a valid UTF-8 text consisting of **statements** separated by semicolons (`;`). The last semicolon can be omitted. + +Each command is a sequence of **tokens** that are valid for this command. Tokens can be **keywords**, **identifiers**, **literals**, and so on. Tokens are separated by whitespace characters (space, tab, line feed) or **comments**. + +The comment is not a part of the command and is syntactically equivalent to a space character.  ## Syntax compatibility modes {#lexer-modes} @@ -33,6 +33,7 @@ SELECT 1; -- A single-line comment  ```  In C++ syntax compatibility mode (default), a multiline comment ends with the **nearest** `*/`. +  The ANSI SQL syntax compatibility mode accounts for nesting of multiline comments:  ```yql @@ -45,8 +46,7 @@ SELECT * FROM T; /* this is a comment /* this is a nested comment, without ansi_  **Keywords** are tokens that have a fixed value in the YQL language. Examples of keywords: `SELECT`, `INSERT`, `FROM`, `ACTION`, and so on. Keywords are case-insensitive, that is, `SELECT` and `SeLEcT` are equivalent to each other.  The list of keywords is not fixed and is going to expand as the language develops. A keyword can't contain numbers and begin or end with an underscore. -**Identifiers** are tokens that identify the names of tables, columns, and other objects in YQL. Identifiers in YQL are always case-sensitive. -An identifier can be written in the body of the program without any special formatting, if the identifier: +**Identifiers** are tokens that identify the names of tables, columns, and other objects in YQL. Identifiers in YQL are always case-sensitive. An identifier can be written in the body of the program without any special formatting, if the identifier:  * Is not a keyword  * Begins with a Latin letter or underscore @@ -84,12 +84,9 @@ SELECT 1 as "column with "" double quote"; -- column name will be: column with "  ## SQL hints {#sql-hints} -SQL hints are special settings with which a user can modify a query execution plan -(for example, enable/disable specific optimizations or force the JOIN execution strategy). -Unlike [PRAGMA](pragma.md), SQL hints act locally – they are linked to a specific point in the YQL query (normally, after the keyword) -and affect only the corresponding statement or even a part of it. -SQL hints are a set of settings "name-value list" and defined inside special comments — -comments with SQL hints must have `+` as the first character: +SQL hints are special settings with which a user can modify a query execution plan (for example, enable/disable specific optimizations or force the JOIN execution strategy). Unlike [PRAGMA](pragma.md), SQL hints act locally – they are linked to a specific point in the YQL query (normally, after the keyword) and affect only the corresponding statement or even a part of it. + +SQL hints are a set of settings "name-value list" and defined inside special comments — comments with SQL hints must have `+` as the first character:  ```yql  --+ Name1(Value1 Value2 Value3) Name2(Value4) ... @@ -158,7 +155,7 @@ In the C++ syntax compatibility mode (default), you can use double quotes instea  SELECT "string with\n newline, \x0a newline and \" backtick ";  ``` -In ASNI SQL compatibility mode, double quotes are used for IDs, and the only escaping that can be used for string literals is a pair of single quotes: +In ANSI SQL compatibility mode, double quotes are used for IDs, and the only escaping that can be used for string literals is a pair of single quotes:  ```yql  --!ansi_lexer | 
