Skip to content
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

Use word_opt instead of tag_opt #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

moratorium08
Copy link

Changes Made

I changed tag_opt to word_opt to handle identifiers correctly.

Bugs Fixed

Previously, there was a bug that produced an error like the following:

(declare-fun andx (Int) Bool)
(assert (andx 1))
(error "
  unknown identifier x at [2:13]:
    |
  2 | (assert (andx 1))
    |             ^
")

This occurred because HoIce's parser behaved as follows:

if self.tag_opt("and") {
                stack.push(Frame::And(vec![]));
                continue 'go_down;

tag_opt only checks if the first three characters match "and", but it doesn't verify if the next character is an alphabetic character or something that can be part of an identifier.

The correct functionality is provided by word_opt, so I updated some uses of tag_opt to word_opt.

@AdrienChampion AdrienChampion self-requested a review October 3, 2024 07:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant