From 1e8f56c92e5d4fa8abad7b2d57a0bf3aef84916f Mon Sep 17 00:00:00 2001 From: Ulysse Prygiel Date: Tue, 10 Feb 2015 12:12:23 +0100 Subject: [PATCH] @type pragma supports curly braces. --- context-free-parser.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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':