diff --git a/context-free-parser.js b/context-free-parser.js index a6e27d4..f2c1f30 100644 --- a/context-free-parser.js +++ b/context-free-parser.js @@ -77,7 +77,10 @@ // sub-feature pragmas case 'default': case 'type': - subCurrent[pragma] = content; + var typeRe = /\{(.+)\}$/, + type = content.trim().match(typeRe); + // accepts `{String}` or the legacy format `String` + subCurrent[pragma] = type ? type[1] : content; break; case 'param':