Accept declare expression in pragma
(_conditional_quantified_expression): accept declare expression; rename Fixes parsing error that occurred in GNATprove source code. add test.
This commit is contained in:
parent
73d90b439d
commit
07019a9929
|
|
@ -661,10 +661,11 @@ module.exports = grammar({
|
||||||
$.if_expression,
|
$.if_expression,
|
||||||
$.case_expression,
|
$.case_expression,
|
||||||
),
|
),
|
||||||
_conditional_quantified_expression: $ => choice(
|
_conditional_quantified_declare_expression: $ => choice(
|
||||||
$.if_expression,
|
$.if_expression,
|
||||||
$.case_expression,
|
$.case_expression,
|
||||||
$.quantified_expression,
|
$.quantified_expression,
|
||||||
|
$.declare_expression,
|
||||||
),
|
),
|
||||||
quantified_expression: $ => seq( // ARM 4.5.8
|
quantified_expression: $ => seq( // ARM 4.5.8
|
||||||
reservedWord('for'),
|
reservedWord('for'),
|
||||||
|
|
@ -1862,7 +1863,7 @@ module.exports = grammar({
|
||||||
'(',
|
'(',
|
||||||
choice(
|
choice(
|
||||||
comma_separated_list_of($.pragma_argument_association),
|
comma_separated_list_of($.pragma_argument_association),
|
||||||
$._conditional_quantified_expression,
|
$._conditional_quantified_declare_expression,
|
||||||
),
|
),
|
||||||
')',
|
')',
|
||||||
)),
|
)),
|
||||||
|
|
|
||||||
|
|
@ -3331,7 +3331,7 @@
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"_conditional_quantified_expression": {
|
"_conditional_quantified_declare_expression": {
|
||||||
"type": "CHOICE",
|
"type": "CHOICE",
|
||||||
"members": [
|
"members": [
|
||||||
{
|
{
|
||||||
|
|
@ -3345,6 +3345,10 @@
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "quantified_expression"
|
"name": "quantified_expression"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "SYMBOL",
|
||||||
|
"name": "declare_expression"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
@ -11287,7 +11291,7 @@
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "SYMBOL",
|
"type": "SYMBOL",
|
||||||
"name": "_conditional_quantified_expression"
|
"name": "_conditional_quantified_declare_expression"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -8865,6 +8865,10 @@
|
||||||
"type": "case_expression",
|
"type": "case_expression",
|
||||||
"named": true
|
"named": true
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"type": "declare_expression",
|
||||||
|
"named": true
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "identifier",
|
"type": "identifier",
|
||||||
"named": true
|
"named": true
|
||||||
|
|
|
||||||
8243
src/parser.c
8243
src/parser.c
File diff suppressed because it is too large
Load Diff
|
|
@ -129,3 +129,38 @@ end;
|
||||||
(expression
|
(expression
|
||||||
(term
|
(term
|
||||||
(identifier))))))))))
|
(identifier))))))))))
|
||||||
|
|
||||||
|
================================================================================
|
||||||
|
declare expression in pragma
|
||||||
|
================================================================================
|
||||||
|
|
||||||
|
package P is
|
||||||
|
pragma Assert
|
||||||
|
(declare
|
||||||
|
E : constant Integer := 123;
|
||||||
|
begin
|
||||||
|
E = 123);
|
||||||
|
end P;
|
||||||
|
|
||||||
|
--------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
(compilation
|
||||||
|
(compilation_unit
|
||||||
|
(package_declaration
|
||||||
|
(identifier)
|
||||||
|
(pragma_g
|
||||||
|
(identifier)
|
||||||
|
(declare_expression
|
||||||
|
(object_declaration
|
||||||
|
(identifier)
|
||||||
|
(identifier)
|
||||||
|
(expression
|
||||||
|
(term
|
||||||
|
(numeric_literal))))
|
||||||
|
(expression
|
||||||
|
(term
|
||||||
|
(identifier))
|
||||||
|
(relational_operator)
|
||||||
|
(term
|
||||||
|
(numeric_literal)))))
|
||||||
|
(identifier))))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user