[Pkg-javascript-commits] [node-acorn-jsx] 177/484: Rename remaining *_t constructors to something sane

Bastien Roucariès rouca at moszumanska.debian.org
Sat Aug 19 14:20:22 UTC 2017


This is an automated email from the git hooks/post-receive script.

rouca pushed a commit to branch master
in repository node-acorn-jsx.

commit e5439847fd733a31423f9b02ce40b706f142acc4
Author: Marijn Haverbeke <marijnh at gmail.com>
Date:   Tue Mar 25 17:26:17 2014 +0100

    Rename remaining *_t constructors to something sane
---
 acorn.js       | 22 +++++++++++-----------
 acorn_loose.js |  8 ++++----
 index.html     | 30 ++++++++++++++++--------------
 3 files changed, 31 insertions(+), 29 deletions(-)

diff --git a/acorn.js b/acorn.js
index fe56e3c..63abcce 100644
--- a/acorn.js
+++ b/acorn.js
@@ -466,7 +466,7 @@
   // These are used when `options.locations` is on, for the
   // `tokStartLoc` and `tokEndLoc` properties.
 
-  function line_loc_t() {
+  function Position() {
     this.line = tokCurLine;
     this.column = tokPos - tokLineStart;
   }
@@ -486,7 +486,7 @@
 
   function finishToken(type, val) {
     tokEnd = tokPos;
-    if (options.locations) tokEndLoc = new line_loc_t;
+    if (options.locations) tokEndLoc = new Position;
     tokType = type;
     skipSpace();
     tokVal = val;
@@ -494,7 +494,7 @@
   }
 
   function skipBlockComment() {
-    var startLoc = options.onComment && options.locations && new line_loc_t;
+    var startLoc = options.onComment && options.locations && new Position;
     var start = tokPos, end = input.indexOf("*/", tokPos += 2);
     if (end === -1) raise(tokPos - 2, "Unterminated comment");
     tokPos = end + 2;
@@ -508,12 +508,12 @@
     }
     if (options.onComment)
       options.onComment(true, input.slice(start + 2, end), start, tokPos,
-                        startLoc, options.locations && new line_loc_t);
+                        startLoc, options.locations && new Position);
   }
 
   function skipLineComment() {
     var start = tokPos;
-    var startLoc = options.onComment && options.locations && new line_loc_t;
+    var startLoc = options.onComment && options.locations && new Position;
     var ch = input.charCodeAt(tokPos+=2);
     while (tokPos < inputLen && ch !== 10 && ch !== 13 && ch !== 8232 && ch !== 8233) {
       ++tokPos;
@@ -521,7 +521,7 @@
     }
     if (options.onComment)
       options.onComment(false, input.slice(start + 2, tokPos), start, tokPos,
-                        startLoc, options.locations && new line_loc_t);
+                        startLoc, options.locations && new Position);
   }
 
   // Called at the start of the parse and after every token. Skips
@@ -724,7 +724,7 @@
   function readToken(forceRegexp) {
     if (!forceRegexp) tokStart = tokPos;
     else tokPos = tokStart + 1;
-    if (options.locations) tokStartLoc = new line_loc_t;
+    if (options.locations) tokStartLoc = new Position;
     if (forceRegexp) return readRegexp();
     if (tokPos >= inputLen) return finishToken(_eof);
 
@@ -1005,7 +1005,7 @@
   
   exports.Node = Node;
 
-  function node_loc_t() {
+  function SourceLocation() {
     this.start = tokStartLoc;
     this.end = null;
     if (sourceFile !== null) this.source = sourceFile;
@@ -1014,7 +1014,7 @@
   function startNode() {
     var node = new Node();
     if (options.locations)
-      node.loc = new node_loc_t();
+      node.loc = new SourceLocation();
     if (options.directSourceFile)
       node.sourceFile = options.directSourceFile;
     if (options.ranges)
@@ -1030,7 +1030,7 @@
     var node = new Node();
     node.start = other.start;
     if (options.locations) {
-      node.loc = new node_loc_t();
+      node.loc = new SourceLocation();
       node.loc.start = other.loc.start;
     }
     if (options.ranges)
@@ -1115,7 +1115,7 @@
 
   function parseTopLevel(program) {
     lastStart = lastEnd = tokPos;
-    if (options.locations) lastEndLoc = new line_loc_t;
+    if (options.locations) lastEndLoc = new Position;
     inFunction = strict = null;
     labels = [];
     readToken();
diff --git a/acorn_loose.js b/acorn_loose.js
index 9d44df8..5f3780b 100644
--- a/acorn_loose.js
+++ b/acorn_loose.js
@@ -201,7 +201,7 @@
   
   exports.Node = Node;
 
-  function node_loc_t(start) {
+  function SourceLocation(start) {
     this.start = start || token.startLoc || {line: 1, column: 0};
     this.end = null;
     if (sourceFile !== null) this.source = sourceFile;
@@ -210,7 +210,7 @@
   function startNode() {
     var node = new Node(token.start);
     if (options.locations)
-      node.loc = new node_loc_t();
+      node.loc = new SourceLocation();
     if (options.directSourceFile)
       node.sourceFile = options.directSourceFile;
     return node;
@@ -219,7 +219,7 @@
   function startNodeFrom(other) {
     var node = new Node(other.start);
     if (options.locations)
-      node.loc = new node_loc_t(other.loc.start);
+      node.loc = new SourceLocation(other.loc.start);
     return node;
   }
 
@@ -233,7 +233,7 @@
 
   function getDummyLoc() {
     if (options.locations) {
-      var loc = new node_loc_t();
+      var loc = new SourceLocation();
       loc.end = loc.start;
       return loc;
     }
diff --git a/index.html b/index.html
index dc3f283..edbc4ca 100644
--- a/index.html
+++ b/index.html
@@ -278,7 +278,7 @@ line break). Used to count lines.</p>             </td>             <td class="c
     <span class="k">if</span> <span class="p">(</span><span class="nx">code</span> <span class="o"><</span> <span class="mi">123</span><span class="p">)</span><span class="k">return</span> <span class="kc">true</span><span class="p">;</span>
     <span class="k">return</span> <span class="nx">code</span> <span class="o">>=</span> <span class="mh">0xaa</span> <span class="o">&&</span> <span class="nx">nonASCIIidentifier</span><span class="p">.</span><span class="nx">test</span><span class="p">(</span><span class="nb">String</span><span class="p">.</span><span class="nx">fromCharCode</span><span class="p">(</span><span class="nx">code</span><span class="p">));</span>
   <span class="p">};</span></pre></div>             </td>           </tr>                               <tr id="section-53">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-53">¶</a>               </div>               <h2>Tokenizer</h2>             </td>             <td class="code">               <div class="highlight"><pre></pre></div>             </td>           </tr>                               <tr id="section [...]
-<code>tokStartLoc</code> and <code>tokEndLoc</code> properties.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">line_loc_t</span><span class="p">()</span> <span class="p">{</span>
+<code>tokStartLoc</code> and <code>tokEndLoc</code> properties.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">Position</span><span class="p">()</span> <span class="p">{</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">line</span> <span class="o">=</span> <span class="nx">tokCurLine</span><span class="p">;</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">column</span> <span class="o">=</span> <span class="nx">tokPos</span> <span class="o">-</span> <span class="nx">tokLineStart</span><span class="p">;</span>
   <span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-55">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-55">¶</a>               </div>               <p>Reset the token state. Used at the start of a parse.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx"> [...]
@@ -290,7 +290,7 @@ line break). Used to count lines.</p>             </td>             <td class="c
 <code>tokRegexpAllowed</code>, and skips the space after the token, so that
 the next one's <code>tokStart</code> will point at the right position.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">finishToken</span><span class="p">(</span><span class="nx">type</span><span class="p">,</span> <span class="nx">val</span><span class="p">)</span> <span class="p">{</span>
     <span class="nx">tokEnd</span> <span class="o">=</span> <span class="nx">tokPos</span><span class="p">;</span>
-    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">tokEndLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">tokEndLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">;</span>
     <span class="nx">tokType</span> <span class="o">=</span> <span class="nx">type</span><span class="p">;</span>
     <span class="nx">skipSpace</span><span class="p">();</span>
     <span class="nx">tokVal</span> <span class="o">=</span> <span class="nx">val</span><span class="p">;</span>
@@ -298,7 +298,7 @@ the next one's <code>tokStart</code> will point at the right position.</p>
   <span class="p">}</span>
 
   <span class="kd">function</span> <span class="nx">skipBlockComment</span><span class="p">()</span> <span class="p">{</span>
-    <span class="kd">var</span> <span class="nx">startLoc</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span> <span class="o">&&</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">startLoc</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span> <span class="o">&&</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">;</span>
     <span class="kd">var</span> <span class="nx">start</span> <span class="o">=</span> <span class="nx">tokPos</span><span class="p">,</span> <span class="nx">end</span> <span class="o">=</span> <span class="nx">input</span><span class="p">.</span><span class="nx">indexOf</span><span class="p">(</span><span class="s2">"*/"</span><span class="p">,</span> <span class="nx">tokPos</span> <span class="o">+=</span> <span class="mi">2</span><span class="p">);</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">end</span> <span class="o">===</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="nx">raise</span><span class="p">(</span><span class="nx">tokPos</span> <span class="o">-</span> <span class="mi">2</span><span class="p">,</span> <span class="s2">"Unterminated comment"</span><span class="p">);</span>
     <span class="nx">tokPos</span> <span class="o">=</span> <span class="nx">end</span> <span class="o">+</span> <span class="mi">2</span><span class="p">;</span>
@@ -312,12 +312,12 @@ the next one's <code>tokStart</code> will point at the right position.</p>
     <span class="p">}</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span><span class="p">)</span>
       <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span><span class="p">(</span><span class="kc">true</span><span class="p">,</span> <span class="nx">input</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">start</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">end</span><span class="p">),</span> <span class="nx">start</span><span class="p">,</span> <sp [...]
-                        <span class="nx">startLoc</span><span class="p">,</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">);</span>
+                        <span class="nx">startLoc</span><span class="p">,</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">);</span>
   <span class="p">}</span>
 
   <span class="kd">function</span> <span class="nx">skipLineComment</span><span class="p">()</span> <span class="p">{</span>
     <span class="kd">var</span> <span class="nx">start</span> <span class="o">=</span> <span class="nx">tokPos</span><span class="p">;</span>
-    <span class="kd">var</span> <span class="nx">startLoc</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span> <span class="o">&&</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">;</span>
+    <span class="kd">var</span> <span class="nx">startLoc</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span> <span class="o">&&</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">;</span>
     <span class="kd">var</span> <span class="nx">ch</span> <span class="o">=</span> <span class="nx">input</span><span class="p">.</span><span class="nx">charCodeAt</span><span class="p">(</span><span class="nx">tokPos</span><span class="o">+=</span><span class="mi">2</span><span class="p">);</span>
     <span class="k">while</span> <span class="p">(</span><span class="nx">tokPos</span> <span class="o"><</span> <span class="nx">inputLen</span> <span class="o">&&</span> <span class="nx">ch</span> <span class="o">!==</span> <span class="mi">10</span> <span class="o">&&</span> <span class="nx">ch</span> <span class="o">!==</span> <span class="mi">13</span> <span class="o">&&</span> <span class="nx">ch</span> <span class="o">!==</span> <span class="mi">8232</sp [...]
       <span class="o">++</span><span class="nx">tokPos</span><span class="p">;</span>
@@ -325,7 +325,7 @@ the next one's <code>tokStart</code> will point at the right position.</p>
     <span class="p">}</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span><span class="p">)</span>
       <span class="nx">options</span><span class="p">.</span><span class="nx">onComment</span><span class="p">(</span><span class="kc">false</span><span class="p">,</span> <span class="nx">input</span><span class="p">.</span><span class="nx">slice</span><span class="p">(</span><span class="nx">start</span> <span class="o">+</span> <span class="mi">2</span><span class="p">,</span> <span class="nx">tokPos</span><span class="p">),</span> <span class="nx">start</span><span class="p">,</span> [...]
-                        <span class="nx">startLoc</span><span class="p">,</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">);</span>
+                        <span class="nx">startLoc</span><span class="p">,</span> <span class="nx">options</span><span class="p">.</span><span class="nx">locations</span> <span class="o">&&</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">);</span>
   <span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-57">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-57">¶</a>               </div>               <p>Called at the start of the parse and after every token. Skips
 whitespace and comments, and.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">skipSpace</span><span class="p">()</span> <span class="p">{</span>
     <span class="k">while</span> <span class="p">(</span><span class="nx">tokPos</span> <span class="o"><</span> <span class="nx">inputLen</span><span class="p">)</span> <span class="p">{</span>
@@ -497,7 +497,7 @@ of the type given by its first argument.</p>             </td>             <td c
   <span class="kd">function</span> <span class="nx">readToken</span><span class="p">(</span><span class="nx">forceRegexp</span><span class="p">)</span> <span class="p">{</span>
     <span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="nx">forceRegexp</span><span class="p">)</span> <span class="nx">tokStart</span> <span class="o">=</span> <span class="nx">tokPos</span><span class="p">;</span>
     <span class="k">else</span> <span class="nx">tokPos</span> <span class="o">=</span> <span class="nx">tokStart</span> <span class="o">+</span> <span class="mi">1</span><span class="p">;</span>
-    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">tokStartLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">tokStartLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">;</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">forceRegexp</span><span class="p">)</span> <span class="k">return</span> <span class="nx">readRegexp</span><span class="p">();</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">tokPos</span> <span class="o">>=</span> <span class="nx">inputLen</span><span class="p">)</span> <span class="k">return</span> <span class="nx">finishToken</span><span class="p">(</span><span class="nx">_eof</span><span class="p">);</span>
 
@@ -712,22 +712,24 @@ tests ("use strict"; 010; -- should fail).</p>             </td>             <td
     <span class="p">}</span>
     <span class="nx">skipSpace</span><span class="p">();</span>
     <span class="nx">readToken</span><span class="p">();</span>
-  <span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-84">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-84">¶</a>               </div>               <p>Start an AST node, attaching a start offset.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">node_t</ [...]
+  <span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-84">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-84">¶</a>               </div>               <p>Start an AST node, attaching a start offset.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">Node</sp [...]
     <span class="k">this</span><span class="p">.</span><span class="nx">type</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">start</span> <span class="o">=</span> <span class="nx">tokStart</span><span class="p">;</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">end</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
   <span class="p">}</span>
+  
+  <span class="nx">exports</span><span class="p">.</span><span class="nx">Node</span> <span class="o">=</span> <span class="nx">Node</span><span class="p">;</span>
 
-  <span class="kd">function</span> <span class="nx">node_loc_t</span><span class="p">()</span> <span class="p">{</span>
+  <span class="kd">function</span> <span class="nx">SourceLocation</span><span class="p">()</span> <span class="p">{</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">start</span> <span class="o">=</span> <span class="nx">tokStartLoc</span><span class="p">;</span>
     <span class="k">this</span><span class="p">.</span><span class="nx">end</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">sourceFile</span> <span class="o">!==</span> <span class="kc">null</span><span class="p">)</span> <span class="k">this</span><span class="p">.</span><span class="nx">source</span> <span class="o">=</span> <span class="nx">sourceFile</span><span class="p">;</span>
   <span class="p">}</span>
 
   <span class="kd">function</span> <span class="nx">startNode</span><span class="p">()</span> <span class="p">{</span>
-    <span class="kd">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">node_t</span><span class="p">();</span>
+    <span class="kd">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Node</span><span class="p">();</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span>
-      <span class="nx">node</span><span class="p">.</span><span class="nx">loc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">node_loc_t</span><span class="p">();</span>
+      <span class="nx">node</span><span class="p">.</span><span class="nx">loc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">SourceLocation</span><span class="p">();</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">directSourceFile</span><span class="p">)</span>
       <span class="nx">node</span><span class="p">.</span><span class="nx">sourceFile</span> <span class="o">=</span> <span class="nx">options</span><span class="p">.</span><span class="nx">directSourceFile</span><span class="p">;</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">ranges</span><span class="p">)</span>
@@ -736,10 +738,10 @@ tests ("use strict"; 010; -- should fail).</p>             </td>             <td
   <span class="p">}</span></pre></div>             </td>           </tr>                               <tr id="section-85">             <td class="docs">               <div class="pilwrap">                 <a class="pilcrow" href="#section-85">¶</a>               </div>               <p>Start a node whose start offset information should be based on
 the start of another node. For example, a binary operator node is
 only started after its left-hand side has already been parsed.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">startNodeFrom</span><span class="p">(</span><span class="nx">other</span><span class="p">)</span> <span class="p">{</span>
-    <span class="kd">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">node_t</span><span class="p">();</span>
+    <span class="kd">var</span> <span class="nx">node</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Node</span><span class="p">();</span>
     <span class="nx">node</span><span class="p">.</span><span class="nx">start</span> <span class="o">=</span> <span class="nx">other</span><span class="p">.</span><span class="nx">start</span><span class="p">;</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="p">{</span>
-      <span class="nx">node</span><span class="p">.</span><span class="nx">loc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">node_loc_t</span><span class="p">();</span>
+      <span class="nx">node</span><span class="p">.</span><span class="nx">loc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">SourceLocation</span><span class="p">();</span>
       <span class="nx">node</span><span class="p">.</span><span class="nx">loc</span><span class="p">.</span><span class="nx">start</span> <span class="o">=</span> <span class="nx">other</span><span class="p">.</span><span class="nx">loc</span><span class="p">.</span><span class="nx">start</span><span class="p">;</span>
     <span class="p">}</span>
     <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">ranges</span><span class="p">)</span>
@@ -786,7 +788,7 @@ statements, and wraps them in a Program node.  Optionally takes a
 <code>program</code> argument.  If present, the statements will be appended
 to its body instead of creating a new node.</p>             </td>             <td class="code">               <div class="highlight"><pre>  <span class="kd">function</span> <span class="nx">parseTopLevel</span><span class="p">(</span><span class="nx">program</span><span class="p">)</span> <span class="p">{</span>
     <span class="nx">lastStart</span> <span class="o">=</span> <span class="nx">lastEnd</span> <span class="o">=</span> <span class="nx">tokPos</span><span class="p">;</span>
-    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">lastEndLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">line_loc_t</span><span class="p">;</span>
+    <span class="k">if</span> <span class="p">(</span><span class="nx">options</span><span class="p">.</span><span class="nx">locations</span><span class="p">)</span> <span class="nx">lastEndLoc</span> <span class="o">=</span> <span class="k">new</span> <span class="nx">Position</span><span class="p">;</span>
     <span class="nx">inFunction</span> <span class="o">=</span> <span class="nx">strict</span> <span class="o">=</span> <span class="kc">null</span><span class="p">;</span>
     <span class="nx">labels</span> <span class="o">=</span> <span class="p">[];</span>
     <span class="nx">readToken</span><span class="p">();</span>

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/node-acorn-jsx.git



More information about the Pkg-javascript-commits mailing list