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

ocamllex extended to bind to list types for variable bindings with a + or * regexp #4770

Closed
vicuna opened this issue Apr 15, 2009 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Apr 15, 2009

Original bug ID: 4770
Reporter: @dra27
Status: acknowledged (set by @damiendoligez on 2009-04-29T13:53:18Z)
Resolution: open
Priority: normal
Severity: feature
Version: 3.11.0
Category: tools (ocaml{lex,yacc,dep,debug,...})
Monitored by: @glondu @yakobowski

Bug description

In the following ocamllex script:

rule test = parse
"foo" (' '+ ("bar"+ as matched))+
{matched}
{
test (Lexing.from_string "foo bar barbar barbarbar")
}

The result is "barbarbar" - i.e. the variable [matched] corresponds to its final string match.

Would it be particularly difficult for [matched] to be inferred as of type string list and so map to ["bar"; "barbar"; "barbarbar"] in this instance?

Additional information

I would think it's reasonable that noone would write a script like that at the moment as only returning the final match is probably both not useful and also undefined behaviour.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

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

No branches or pull requests

1 participant