-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DOCS] Assorted comments on the grammar productions #387
Comments
Fixesalt-name: //G alt-name:
-//G unqualified-id :
+//G identifier : Although some declarations can be without an initializer, the grammar doesn't permit the ending +//G declaration-initializer:
+//G '=' statement
+//G ';'
+//G
//G unnamed-declaration:
-//G ':' meta-functions-list? template-parameter-declaration-list? function-type requires-clause? '=' statement
-//G ':' meta-functions-list? template-parameter-declaration-list? type-id? requires-clause? '=' statement
+//G ':' meta-functions-list? template-parameter-declaration-list? function-type requires-clause? declaration-initializer
+//G ':' meta-functions-list? template-parameter-declaration-list? type-id? requires-clause? declaration-initializer
//G ':' meta-functions-list? template-parameter-declaration-list? type-id
-//G ':' meta-functions-list? template-parameter-declaration-list? 'final'? 'type' requires-clause? '=' statement
+//G ':' meta-functions-list? template-parameter-declaration-list? 'final'? 'type' requires-clause? declaration-initializer
//G ':' 'namespace' '=' statement Resolvedby commit 9585ecc. According to https://eel.is/c++draft/syntax#2.4, this shouldn't be a -list, but a -seq. According to https://eel.is/c++draft/syntax#2.4, this shouldn't be a -list. Resolvedby commit f441e43. Commit 785c44d changed the syntax: //G return-list:
- //G expression-statement
+ //G expression ';'?
//G '->' return-direction? type-id
//G '->' parameter-declaration-list Resolvedby #726. Return-by move and forward: //G return-list:
-//G '->' type-id
+//G '->' parameter-direction? type-id #251 didn't add It also added encoding-prefixes with 'R'. //G encoding-prefix: one of
-//G 'u8' 'u' 'uR' 'u8R' 'U' 'UR' 'L' 'LR' 'R'
+//G 'u8' 'u' 'U' 'L'
//G string-literal:
//G encoding-prefix? '"' s-char-seq? '"'
-//G encoding-prefix? 'R"' d-char-seq? '(' s-char-seq? ')' d-char-seq? '"'
+//G encoding-prefix? '$'? 'R"' d-char-seq? '(' s-char-seq? ')' d-char-seq? '"' template-argument-list: //G template-argument-list:
//G template-argument-list ',' template-argument
+//G template-argument Need fixingThe *-name-specifier of qualified-id lack recursion. //G qualified-id:
//G nested-name-specifier unqualified-id
//G member-name-specifier unqualified-id
//G
//G nested-name-specifier:
//G '::'
//G unqualified-id '::'
//G
//G member-name-specifier:
//G unqualified-id '.' The suffixes need to be factored out into their own production, like Cpp1. //G integer-literal:
//G binary-literal
//G hexadecimal-literal
//G decimal-literal
//G
//G binary-literal:
//G '0b' binary-digit
//G '0B' binary-digit
//G binary-literal binary-digit
//G binary-literal ''' binary-digit
//G
//G hexadecimal-literal:
//G '0x' hexadecimal-digit
//G '0X' hexadecimal-digit
//G hexadecimal-literal hexadecimal-digit
//G hexadecimal-literal ''' hexadecimal-digit
//G
//G
//G decimal-literal:
//G digit [uU][lL][lL]
//G decimal-literal digit [uU][lL][lL]
//G decimal-literal ''' digit [uU][lL][lL] Commit e38838e didn't add grammar. Seems like a string-literal can't end in an interpolation. //G string-literal:
//G encoding-prefix? '"' s-char-seq? '"'
//G encoding-prefix? 'R"' d-char-seq? '(' s-char-seq? ')' d-char-seq? '"'
//G
//G s-char-seq:
//G interpolation? s-char
//G interpolation? s-char-seq s-char |
Simplificationsid-expression can be used to simplify type-id. //G type-id:
-//G type-qualifier-seq? qualified-id
-//G type-qualifier-seq? unqualified-id
+//G type-qualifier-seq? id-expression
//G id-expression
//G qualified-id
//G unqualified-id See also parameter-declaration-list. It's possible to factor out an is-as-expression-target production. +//G is-as-expression-target:
+//G is-type-constraint
+//G is-value-constraint
+//G as-type-cast
//G is-as-expression:
//G prefix-expression
-//G is-as-expression is-type-constraint
-//G is-as-expression is-value-constraint
-//G is-as-expression as-type-cast
+//G is-as-expression is-as-expression-target
//GTODO type-id is-type-constraint
//G alternative:
-//G alt-name? is-type-constraint '=' statement
-//G alt-name? is-value-constraint '=' statement
-//G alt-name? as-type-cast '=' statement
+//G alt-name? is-as-expression-target '=' statement
//G
//G alt-name:
//G unqualified-id :
//G
//G inspect-expression:
//G 'inspect' 'constexpr'? expression '{' alternative-seq? '}'
//G 'inspect' 'constexpr'? expression '->' type-id '{' alternative-seq? '}'
//G
//G alternative-seq:
//G alternative
//G alternative-seq alternative |
ProposalsResolvedby #1183. //G return-list:
//G '->' type-id
//G '->' parameter_declaration_list The #343 can be fixed by The order of parameter-declaration's productions means that:
VisualizedSee also parameter-declaration, type-id, inspect. //G type-id:
-//G type-qualifier-seq? qualified-id
-//G type-qualifier-seq? unqualified-id
+//G type-qualifier-seq? id-expression
+//G type-qualifier-seq? function-type
//G parameter-declaration:
+//G parameter-direction? unnamed-declaration
//G this-specifier? parameter-direction? declaration
+//G this-specifier? parameter-direction? identifier
//G return-list:
//G '->' type-id
-//G '->' parameter_declaration_list Resolvedby #1183.
//G inspect-expression:
-//G 'inspect' 'constexpr'? expression '{' alternative-seq? '}'
-//G 'inspect' 'constexpr'? expression '->' type-id '{' alternative-seq? '}'
+//G 'inspect' 'constexpr'? expression return-list? '{' alternative-seq? '}' See also parameter-declaration-list. OthersCommit 928186e didn't add grammar nor updated //G iteration-statement:
//G label? 'while' logical-or-expression next-clause? compound-statement
//G label? 'do' compound-statement 'while' logical-or-expression next-clause? ';'
-//G label? 'for' expression next-clause? 'do' unnamed-declaration
+//G label? 'for' expression next-clause? 'do' parameterized-statement
+//G parameterized-statement:
+//G parameter-declaration-list statement
//G statement:
//G selection-statement
//G inspect-expression
//G return-statement
//G jump-statement
//G iteration-statement
//G compound-statement
//G declaration
+//G parameterized-statement
//G expression-statement
//G contract
//GTODO try-block Resolvedby commit ebdcd85. Although the Cpp2 grammar doesn't seem to treat //G primary-expression:
//G inspect-expression
-//G id-expression
//G literal
+//G id-expression
//G '(' expression-list ')'
//G '{' expression-list '}'
//G unnamed-declaration |
Beyond C++20See also integer-suffix. Resolvedby #483. //G postfix-expression:
//G primary-expression
//G postfix-expression postfix-operator [Note: without whitespace before the operator]
-//G postfix-expression '[' expression-list ']'
+//G postfix-expression '[' expression-list? ']'
//G postfix-expression '(' expression-list? ')'
//G postfix-expression '.' id-expression Outdated
|
Doubts |
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
//G punctuator: one of
//G '.' '..' '...' '..<' '..='
//G '::' ':'
//G '{' '}' '(' ')' '[' ']' ';' ',' '?' '$' What is |
|
Table of contents
//G
commentsSee also: #71, #392, #408.
The text was updated successfully, but these errors were encountered: