gocc icon indicating copy to clipboard operation
gocc copied to clipboard

Why can not use -o and -p at the same time?

Open OhYee opened this issue 4 years ago • 2 comments

I find that when I use gocc -p xxxx/xxxx -o ./analysis xxx.bnf, the package is still the default value.

It seems that because these lines. https://github.com/goccmack/gocc/blob/19e54f37e2bc8b72e65fef4a5a484070a404ad53/internal/config/config.go#L183-L186

If I use -o and -p together, is there any possiable problems?

I just want to put the .bnf file in a single folder.

OhYee avatar Oct 03 '19 12:10 OhYee

I think it's possible this would break in a non-vGo / Go Modules context if both were allowed; the code generated could potentially reference packages that didn't exist.

However, since vGo is the default now, it might be better to check the environment first (for vGo), then react to the options.

It makes sense that both should be possible, but with a warning about the issues with older versions of Go.

tsal avatar Jan 08 '20 15:01 tsal

We are not the familiar with vGo, so a pull request to help people use gocc with vGo would be much appreciated.

awalterschulze avatar Oct 30 '20 09:10 awalterschulze