1
0
Fork 0

Multiple spaces now properly handled in keyword parser

closure/master
Mike Gerwitz 2011-01-18 19:33:33 -05:00
parent 7dab5c7b20
commit 96f5b8ff58
2 changed files with 7 additions and 2 deletions

View File

@ -43,7 +43,7 @@ exports.parseKeywords = function ( prop )
{ {
// the keywords are all words, except for the last, which is the // the keywords are all words, except for the last, which is the
// property name // property name
keywords = prop.split( ' ' ); keywords = prop.split( /\s+/ );
name = keywords.pop(); name = keywords.pop();
var i = keywords.length; var i = keywords.length;

View File

@ -131,6 +131,9 @@ var common = require( './common' ),
'public bogus keywords foo3': '', 'public bogus keywords foo3': '',
'public static final method': function() {}, 'public static final method': function() {},
// tricky tricky
'lots of spaces': function() {},
}, },
parsed_keywords = {}, parsed_keywords = {},
@ -141,6 +144,8 @@ var common = require( './common' ),
foo3: { 'public': true, 'bogus': true, 'keywords': true }, foo3: { 'public': true, 'bogus': true, 'keywords': true },
method: { 'public': true, 'static': true, 'final': true }, method: { 'public': true, 'static': true, 'final': true },
spaces: { 'lots': true, 'of': true },
} }
; ;
@ -162,7 +167,7 @@ var common = require( './common' ),
parsed_keywords[ prop ], parsed_keywords[ prop ],
expected[ prop ], expected[ prop ],
"Keywords are properly recognized and made available for " + "Keywords are properly recognized and made available for " +
"interpretation" "interpretation (" + prop + ")"
); );
} }
} )(); } )();