|
@@ -629,8 +629,8 @@ var configuratorApp = (function(){
|
629
|
629
|
}
|
630
|
630
|
|
631
|
631
|
if (info.type) {
|
632
|
|
- var comment = '';
|
633
|
632
|
// Get the end-of-line comment, if there is one
|
|
633
|
+ var comment = '';
|
634
|
634
|
findDef = new RegExp('.*#define[ \\t].*/[/*]+[ \\t]*(.*)');
|
635
|
635
|
if (info.line.search(findDef) >= 0) {
|
636
|
636
|
comment = info.line.replace(findDef, '$1');
|
|
@@ -638,12 +638,15 @@ var configuratorApp = (function(){
|
638
|
638
|
else {
|
639
|
639
|
// Get all the comments immediately before the item
|
640
|
640
|
var r, s;
|
641
|
|
- findDef = new RegExp('([ \\t]*(//|#)[^\n]+\n){1,4}\\s{0,1}' + info.line, 'g');
|
|
641
|
+ findDef = new RegExp('(([ \\t]*(//|#)[^\n]+\n){1,4})([ \\t]*\n){0,1}' + info.line, 'g');
|
642
|
642
|
if (r = findDef.exec(txt)) {
|
643
|
|
- findDef = new RegExp('^[ \\t]*//+[ \\t]*([^#].*)[ \\t]*$', 'gm');
|
644
|
|
- while((s = findDef.exec(r[0])) !== null) {
|
645
|
|
- if (s[1].match(/\/\/[ \\t]*#define/) == null)
|
646
|
|
- comment += s[1] + "\n";
|
|
643
|
+ findDef = new RegExp('^[ \\t]*(//+[ \\t]*.*)[ \\t]*$', 'gm');
|
|
644
|
+ while((s = findDef.exec(r[1])) !== null) {
|
|
645
|
+ if (s[1].match(/^\/\/[ \\t]*#define[ \\t]/) != null) {
|
|
646
|
+ comment = '';
|
|
647
|
+ break;
|
|
648
|
+ }
|
|
649
|
+ comment += s[1] + "\n";
|
647
|
650
|
}
|
648
|
651
|
}
|
649
|
652
|
}
|