Comparing version 0.5.1 to 0.5.2
@@ -12,6 +12,11 @@ #!/usr/bin/env node | ||
var typeExpression = process.argv[2]; | ||
var jsdoc = process.argv[3] === '--jsdoc' ? true : false; | ||
var parsedType; | ||
var opts = { | ||
jsdoc: jsdoc | ||
}; | ||
function usage() { | ||
console.log(util.format('Usage:\n %s [typeExpression]', command)); | ||
console.log(util.format('Usage:\n %s typeExpression [--jsdoc]', command)); | ||
} | ||
@@ -24,3 +29,3 @@ | ||
try { | ||
parsedType = catharsis.parse(typeExpression); | ||
parsedType = catharsis.parse(typeExpression, opts); | ||
} catch (e) { | ||
@@ -27,0 +32,0 @@ console.error(util.format('Unable to parse "%s" (exception follows):', typeExpression)); |
{ | ||
"version": "0.5.1", | ||
"version": "0.5.2", | ||
"name": "catharsis", | ||
@@ -4,0 +4,0 @@ "description": "A JavaScript parser for Google Closure Compiler and JSDoc type expressions.", |
@@ -146,2 +146,4 @@ # Catharsis # | ||
+ 0.5.2 (March 2013): The `parse()` method now correctly parses function types when JSDoc-style type | ||
expressions are enabled. | ||
+ 0.5.1 (March 2013): Newlines and extra spaces are now removed from type expressions before they | ||
@@ -148,0 +150,0 @@ are parsed. |
@@ -171,3 +171,21 @@ 'use strict'; | ||
} | ||
}, | ||
{ | ||
description: 'standard function type (should still parse if JSDoc expressions are allowed)', | ||
expression: 'function(this:my.namespace.Class, my.Class)=', | ||
parsed: { | ||
type: Types.FunctionType, | ||
params: [ | ||
{ | ||
type: Types.NameExpression, | ||
name: 'my.Class' | ||
} | ||
], | ||
'this': { | ||
type: Types.NameExpression, | ||
name: 'my.namespace.Class' | ||
}, | ||
optional: true | ||
} | ||
} | ||
]; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
273134
2670
213