cmark

My personal build of CMark ✏️

Commit
7bfb5dd6915fd455e93086fc2b546802bdd77027
Parent
05c60132f4ba80f5d62d99e7d0be27715ade06e5
Author
John MacFarlane <jgm@berkeley.edu>
Date

JS: sourceloc -> sourcepos for confirmity with cmark.

Diffstat

2 files changed, 5 insertions, 5 deletions

Status File Name N° Changes Insertions Deletions
Modified js/lib/blocks.js 4 2 2
Modified js/lib/node.js 6 3 3
diff --git a/js/lib/blocks.js b/js/lib/blocks.js
@@ -482,7 +482,7 @@ var incorporateLine = function(ln, line_number) {
               container.t === 'FencedCode' ||
               (container.t === 'ListItem' &&
                !container.firstChild &&
-               container.sourceloc[0][0] === line_number));
+               container.sourcepos[0][0] === line_number));
 
         var cont = container;
         while (cont.parent) {
@@ -548,7 +548,7 @@ var finalize = function(block, line_number) {
         return 0;
     }
     block.open = false;
-    block.sourceloc[1] = [line_number, this.lastLineLength + 1];
+    block.sourcepos[1] = [line_number, this.lastLineLength + 1];
 
     switch (block.t) {
     case 'Paragraph':
diff --git a/js/lib/node.js b/js/lib/node.js
@@ -60,14 +60,14 @@ NodeWalker.prototype.next = function(){
     return {entering: entering, node: cur};
 };
 
-function Node(nodeType, sourceloc) {
+function Node(nodeType, sourcepos) {
     this.t = nodeType;
     this.parent = null;
     this.firstChild = null;
     this.lastChild = null;
     this.prev = null;
     this.next = null;
-    this.sourceloc = sourceloc;
+    this.sourcepos = sourcepos;
     this.last_line_blank = false;
     this.open = true;
     this.strings = undefined;
@@ -167,7 +167,7 @@ Node.prototype.toAST = function() {
     var cur;
     var result = { t: this.t };
 
-    var propsToShow = ['t', 'c', 'list_data', 'sourceloc', 'info', 'level'];
+    var propsToShow = ['t', 'c', 'list_data', 'sourcepos', 'info', 'level'];
 
     for (var i = 0; i < propsToShow.length; i++) {
         var prop = propsToShow[i];