Skip to content

Commit

Permalink
🐛 Ignore EOL comment before first #define
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Dec 28, 2023
1 parent d80b546 commit e0ce965
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions abm/js/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,16 +813,19 @@ class ConfigSchema {
log("... EOL comment", line_number);
}
else {
// If the line is not a comment, we're done with the EOL comment
const cstring = comment_buff.join('\n');
if (last_added_ref.comment) {
// A (block or slash) comment was already added
last_added_ref.notes = cstring;
//console.log("Extra comment", cstring);
}
else {
last_added_ref.comment = cstring;
//console.log("EOL comment", cstring);
if (last_added_ref !== undefined) { // Ignore EOL comments before any #define
// If the line is not a comment, we're done with the EOL comment
const cstring = comment_buff.join('\n');
// If the comment property exists treat the extra comment as "notes"
if (last_added_ref.comment) {
// A (block or slash) comment was already added
last_added_ref.notes = cstring;
//console.log("Extra comment", cstring);
}
else {
last_added_ref.comment = cstring;
//console.log("EOL comment", cstring);
}
}
comment_buff = [];
state = Parse.NORMAL;
Expand Down

0 comments on commit e0ce965

Please sign in to comment.