When global declarations are true, we do not push/pop the context of the symbol manager. This removes a spurious assertion that checked whether a pop in this case was greater than the actual context level of the symbol manager.
Fixes cvc5/cvc5-projects#370.
}
( k=INTEGER_LITERAL
{ unsigned num = AntlrInput::tokenToUnsigned(k);
- if(num > PARSER_STATE->scopeLevel()) {
- PARSER_STATE->parseError("Attempted to pop above the top stack "
- "frame.");
- }
+ // we don't compare num to PARSER_STATE->scopeLevel() here, since
+ // when global declarations is true, the scope level of the parser
+ // is not indicative of the context level.
if(num == 0) {
cmd->reset(new EmptyCommand());
} else if(num == 1) {
regress0/parser/linear_arithmetic_err3.smt2
regress0/parser/named-attr-error.smt2
regress0/parser/named-attr.smt2
+ regress0/parser/proj-issue370-push-pop-global.smt2
regress0/parser/quoted-define-fun.smt2
regress0/parser/shadow_fun_symbol_all.smt2
regress0/parser/shadow_fun_symbol_nirat.smt2
--- /dev/null
+; COMMAND-LINE: -i
+; EXIT: 0
+(set-option :global-declarations true)
+(set-logic ALL)
+(push 2)
+(pop 2)