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

Comments

@skvadrik
Copy link
Owner

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

This comment has been minimized.

Copy link
Owner Author

commented Dec 25, 2005

bug patch and test case

Original comment by: alder

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2005

- assigned_to: nobody —> helly

Original comment by: helly

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2005

Logged In: YES
user_id=271023

Fix in the scanner.

Original comment by: helly

@skvadrik

This comment has been minimized.

Copy link
Owner Author

commented Dec 27, 2005

- status: open —> closed-fixed

Original comment by: helly

@skvadrik

This comment has been minimized.

Copy link
Owner Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.