cdocparser
Advanced tools
Comparing version 0.12.2 to 0.13.0
@@ -303,3 +303,3 @@ 'use strict'; | ||
// Parse the annotation. | ||
var result = annotation.parse(getContent(line, match)); | ||
var result = annotation.parse(getContent(line, match), parsedComment, id); | ||
@@ -314,3 +314,3 @@ // If it is a boolean use the annotaion as a flag | ||
} else if (typeof parsedComment[name] === 'undefined'){ | ||
parsedComment[name] = annotation.parse(getContent(line, match)); | ||
parsedComment[name] = annotation.parse(getContent(line, match), parsedComment, id); | ||
} else { | ||
@@ -317,0 +317,0 @@ this.emit( |
{ | ||
"name": "cdocparser", | ||
"version": "0.12.2", | ||
"version": "0.13.0", | ||
"description": "Extract C style comments and extract context from source", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -101,3 +101,3 @@ CDocParser | ||
aRealAnnotation: { | ||
parse : function (annotationLine) { | ||
parse : function (annotationLine, info, id) { | ||
@@ -124,2 +124,3 @@ }, | ||
description : "[Contains all comment lines without an annotation]", | ||
commentRange : { start : [start], end : [end] }, | ||
[annotationName] : [resultOfAnnotationParser] | ||
@@ -154,3 +155,3 @@ } | ||
name : { | ||
parse : function(line){ | ||
parse : function(line, info, id){ | ||
@@ -233,2 +234,8 @@ }, | ||
#### 0.13.0 | ||
* Fix a bug where only in `multiple:false` case meta-information where included in `annotation.parse`. | ||
* Include `id` passed to `parse` method in every `annotation.parse` call. | ||
#### 0.12.2 | ||
@@ -235,0 +242,0 @@ |
@@ -514,2 +514,32 @@ var fs = require('fs'); | ||
describe('# Pass in meta information about parsed object', function(){ | ||
it('should include meta information', function(done){ | ||
var annotations = { | ||
_ : { | ||
alias : { } | ||
}, | ||
test : { | ||
parse : function(line, info, id){ | ||
assert.equal(id, 'FileID'); | ||
assert.deepEqual(info, {"description":"","commentRange":{"start":1,"end":3},"context":{"type":"demo"}}); | ||
done(); | ||
}, | ||
multiple: false | ||
} | ||
}; | ||
parser = new docParser.CommentParser(annotations); | ||
var extendedResult = parser.parse ([{ | ||
lines : ['@test hello'], | ||
context : { type : 'demo' }, | ||
commentRange : { start : 1, end :3 } | ||
}], 'FileID'); | ||
}); | ||
}); | ||
describe('File with CRLF', function(){ | ||
@@ -516,0 +546,0 @@ it('should extract comments', function (){ |
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
43678
872
343