asterisk(*) should be once or not at all

This commit is contained in:
Cloud Wu
2015-07-03 10:58:40 +08:00
parent 08dabd51c8
commit 55cf9375fc

View File

@@ -81,7 +81,7 @@ end
local typedef = P { local typedef = P {
"ALL", "ALL",
FIELD = namedpat("field", (name * blanks * tag * blank0 * ":" * blank0 * (C"*")^0 * typename * mainkey^0)), FIELD = namedpat("field", (name * blanks * tag * blank0 * ":" * blank0 * (C"*")^-1 * typename * mainkey^0)),
STRUCT = P"{" * multipat(V"FIELD" + V"TYPE") * P"}", STRUCT = P"{" * multipat(V"FIELD" + V"TYPE") * P"}",
TYPE = namedpat("type", P"." * name * blank0 * V"STRUCT" ), TYPE = namedpat("type", P"." * name * blank0 * V"STRUCT" ),
SUBPROTO = Ct((C"request" + C"response") * blanks * (typename + V"STRUCT")), SUBPROTO = Ct((C"request" + C"response") * blanks * (typename + V"STRUCT")),