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

re2c cannot accept {0,} #21

Closed
skvadrik opened this issue Dec 25, 2005 · 5 comments
Closed

re2c cannot accept {0,} #21

skvadrik opened this issue Dec 25, 2005 · 5 comments
Assignees

Comments

@skvadrik
Copy link
Owner

@skvadrik skvadrik commented Dec 25, 2005

It actually crashes if this form is ever used.

I attached a patch and a test case for this bug.

With this branch working it might be possible to
express one of the “factor” alternatives in “parser.y” as:

| primary close
{
switch($2){
case ‘*’:
$$ = new CloseVOp($1, 0, -1);
break;
case ‘+’:
$$ = new CloseVOp($1, 1, -1);
break;
case ‘?’:
$$ = new CloseVOp($1, 0, 1);
break;
}
}

IMHO, but might be easier to read.

Original comment by: alder

@skvadrik
Copy link
Owner Author

@skvadrik skvadrik commented Dec 25, 2005

bug patch and test case

Original comment by: alder

Loading

@skvadrik
Copy link
Owner Author

@skvadrik skvadrik commented Dec 27, 2005

- assigned_to: nobody —> helly

Original comment by: helly

Loading

@skvadrik
Copy link
Owner Author

@skvadrik skvadrik commented Dec 27, 2005

Logged In: YES
user_id=271023

Fix in the scanner.

Original comment by: helly

Loading

@skvadrik
Copy link
Owner Author

@skvadrik skvadrik commented Dec 27, 2005

- status: open —> closed-fixed

Original comment by: helly

Loading

@skvadrik
Copy link
Owner Author

@skvadrik skvadrik commented Dec 28, 2005

Logged In: YES
user_id=492233

Well, “{0,}” obviously is “*”, but making an explicit
substitude in the scanner (a workaround really) still leaves
a “hole” in CloseVOp::compile. IMHO, it might look nicer if
you do fix that method instead. The fix in my patch, I
think, actually makes that method work correctly for all
acceptable parameters.

Original comment by: alder

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant