@@ -33,7 +33,7 @@ auto violates_lifetime_safety = false;
33
33
//
34
34
35
35
// G prefix-operator:
36
- // G one of '!'
36
+ // G one of '!' '-' '+'
37
37
// G
38
38
auto is_prefix_operator (lexeme l) -> bool
39
39
{
@@ -68,7 +68,7 @@ auto is_postfix_operator(lexeme l) -> bool
68
68
69
69
70
70
// G assignment-operator:
71
- // G one of '=' '*=' '/=' '%=' '+=' '-=' '>>=' '<<='
71
+ // G one of '=' '*=' '/=' '%=' '+=' '-=' '>>=' '<<=' '&=' '^=' '|='
72
72
// G
73
73
auto is_assignment_operator (lexeme l) -> bool
74
74
{
@@ -1549,8 +1549,7 @@ class parser
1549
1549
return n;
1550
1550
}
1551
1551
1552
- if (curr ().type () == lexeme::Identifier ||
1553
- curr ().type () == lexeme::DecimalLiteral ||
1552
+ if (curr ().type () == lexeme::DecimalLiteral ||
1554
1553
curr ().type () == lexeme::FloatLiteral ||
1555
1554
curr ().type () == lexeme::StringLiteral ||
1556
1555
curr ().type () == lexeme::CharacterLiteral ||
@@ -1944,7 +1943,7 @@ class parser
1944
1943
1945
1944
// G bit-xor-expression:
1946
1945
// G bit-and-expression
1947
- // G bit-xor-expression '& ' bit-and-expression
1946
+ // G bit-xor-expression '^ ' bit-and-expression
1948
1947
// G
1949
1948
auto bit_xor_expression (bool allow_angle_operators = true ) {
1950
1949
return binary_expression<bit_xor_expression_node> (
@@ -1955,7 +1954,7 @@ class parser
1955
1954
1956
1955
// G bit-or-expression:
1957
1956
// G bit-xor-expression
1958
- // G bit-or-expression '& ' bit-xor-expression
1957
+ // G bit-or-expression '| ' bit-xor-expression
1959
1958
// G
1960
1959
auto bit_or_expression (bool allow_angle_operators = true ) {
1961
1960
return binary_expression<bit_or_expression_node> (
@@ -1990,7 +1989,7 @@ class parser
1990
1989
1991
1990
// G assignment-expression:
1992
1991
// G logical-or-expression
1993
- // G assignment-expression assignment-operator assignment -expression
1992
+ // G assignment-expression assignment-operator logical-or -expression
1994
1993
// G
1995
1994
auto assignment_expression (bool allow_angle_operators = true ) -> std::unique_ptr<assignment_expression_node> {
1996
1995
// return binary_expression<assignment_expression_node> (
@@ -2037,7 +2036,7 @@ class parser
2037
2036
2038
2037
// G expression-list:
2039
2038
// G parameter-direction? expression
2040
- // G expression-list ',' expression
2039
+ // G expression-list ',' parameter-direction? expression
2041
2040
// G
2042
2041
auto expression_list (token const * open_paren, bool inside_initializer = false ) -> std::unique_ptr<expression_list_node> {
2043
2042
auto pass = passing_style::in;
@@ -2078,6 +2077,10 @@ class parser
2078
2077
pass = passing_style::move;
2079
2078
next ();
2080
2079
}
2080
+ else if (curr ().type () == lexeme::Identifier && curr () == " forward" ) {
2081
+ pass = passing_style::forward;
2082
+ next ();
2083
+ }
2081
2084
auto expr = expression ();
2082
2085
if (!expr) {
2083
2086
error (" invalid text in expression list" );
@@ -2128,12 +2131,6 @@ class parser
2128
2131
n->id = std::move (id);
2129
2132
assert (n->id .index () == type_id_node::unqualified);
2130
2133
}
2131
- else if (curr ().type () == lexeme::Keyword || curr ().type () == lexeme::Cpp2FixedType) {
2132
- n->pos = curr ().position ();
2133
- n->id = &curr ();
2134
- next ();
2135
- assert (n->id .index () == type_id_node::keyword);
2136
- }
2137
2134
else {
2138
2135
if (!n->pc_qualifiers .empty ()) {
2139
2136
error (" '*'/'const' type qualifiers must be followed by a type name or '_' wildcard" );
@@ -2939,7 +2936,7 @@ class parser
2939
2936
2940
2937
2941
2938
// G parameter-declaration:
2942
- // G parameter-direction? declaration
2939
+ // G parameter-direction? this-specifier? declaration
2943
2940
// G
2944
2941
// G parameter-direction: one of
2945
2942
// G 'in' 'copy' 'inout' 'out' 'move' 'forward'
0 commit comments