We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
func TestFieldCustomOptions(t *testing.T) { proto := `foo.bar lots = 1 [foo={hello:1}, bar=2];` p := newParserOn(proto) f := newNormalField() err := f.parse(p) if err != nil { t.Fatal(err) } if got, want := f.Type, "foo.bar"; got != want { t.Errorf("got [%v] want [%v]", got, want) } if got, want := f.Name, "lots"; got != want { t.Errorf("got [%v] want [%v]", got, want) } if got, want := len(f.Options), 2; got != want { t.Fatalf("got [%v] want [%v]", got, want) } if got, want := f.Options[0].Name, "foo"; got != want { t.Errorf("got [%v] want [%v]", got, want) } if got, want := f.Options[1].Name, "bar"; got != want { t.Errorf("got [%v] want [%v]", got, want) } if got, want := f.Options[1].Constant.Source, "2"; got != want { t.Errorf("got [%v] want [%v]", got, want) } }
This returns:
<input>:1:37: found "=" but expected [option aggregate key colon :]
This fails if bar is a non-primitive as well. If foo is a primitive and bar is a non-primitive, this passes.
bar
foo
The text was updated successfully, but these errors were encountered:
I think the problem is in Option.parseAggregate, see #50
Option.parseAggregate
Sorry, something went wrong.
Any update on this?
fix issue #49, option parsing
93f1d61
Closing this, will re-open if needed. Thanks!
No branches or pull requests
This returns:
This fails if
bar
is a non-primitive as well. Iffoo
is a primitive andbar
is a non-primitive, this passes.The text was updated successfully, but these errors were encountered: