Skip to content
Browse files

Site updated at 2012-10-04 15:01:39 UTC

  • Loading branch information...
1 parent 6a333cf commit 7f6414a561dd64d0af72ecf789ca074206a50c7c Sergej Tatarincev committed Oct 4, 2012
View
51 atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Harmless Programmer]]></title>
<link href="http://SevInf.github.com/atom.xml" rel="self"/>
<link href="http://SevInf.github.com/"/>
- <updated>2012-09-30T13:57:31+03:00</updated>
+ <updated>2012-10-04T18:01:32+03:00</updated>
<id>http://SevInf.github.com/</id>
<author>
<name><![CDATA[Sergej Tatarincev]]></name>
@@ -35,20 +35,20 @@ simpler task will be enough to dive in.</p>
<p>We will build a very simple static analyzer which will run from command line.
It will warn about:</p>
-<ol>
+<ul>
<li>Declared, but not called functions;</li>
<li>Calls to undeclared functions;</li>
<li>Functions declared multiple times.</li>
-</ol>
+</ul>
<p>Of course, it&#8217;s not intended for compelling with excellent <a href="http://www.jshint.com/">JSHint</a> or any other static
analyzer. The only purpose it serves is to show you the basics of JS parsing using Esprima. The things that our
analyzer will NOT do:</p>
-<ol>
+<ul>
<li>Recognize any form of function declaration except:</li>
-</ol>
+</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
@@ -60,20 +60,20 @@ analyzer will NOT do:</p>
</span></code></pre></td></tr></table></div></figure>
-<ol>
+<ul>
<li>Recognize any form of function call except:</li>
-</ol>
+</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="nx">name</span><span class="p">(...)</span>
</span></code></pre></td></tr></table></div></figure>
-<ol>
+<ul>
<li>Know something about imports, exports or predefined globals;</li>
<li>Work with multiple files.</li>
-</ol>
+</ul>
<p>This is not the flaws of a parser. All this features can be easily implemented, they are just out of scope of
@@ -88,14 +88,10 @@ Each of following commands can also be done with GUI or Windows Shell, but I&#82
OS terminal.
Create a directory for your project and install the library:</p>
-<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
-<span class='line-number'>2</span>
-<span class='line-number'>3</span>
-</pre></td><td class='code'><pre><code class='bash'><span class='line'>mkdir esprima-tutorial
-</span><span class='line'><span class="nb">cd </span>esprima-tutorial
-</span><span class='line'>npm install esprima@0.9.9
-</span></code></pre></td></tr></table></div></figure>
-
+<pre><code>mkdir esprima-tutorial
+cd esprima-tutorial
+npm install esprima@0.9.9
+</code></pre>
<p>Create a script named analyze.js with the following content:</p>
@@ -516,20 +512,13 @@ Finally, add call to <code>processResults</code> to the bottom of <code>analyzeC
<p>You should see something like this:</p>
-<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
-<span class='line-number'>2</span>
-<span class='line-number'>3</span>
-<span class='line-number'>4</span>
-<span class='line-number'>5</span>
-<span class='line-number'>6</span>
-</pre></td><td class='code'><pre><code class='bash'><span class='line'>Inf:esprima-tutorial<span class="nv">$ </span>node analyze.js test.js
-</span><span class='line'>Reading test.js
-</span><span class='line'>Function declaredTwice decalred multiple <span class="nb">times</span>
-</span><span class='line'>Function undeclared undeclared
-</span><span class='line'>Function unused declared but not called
-</span><span class='line'>Done
-</span></code></pre></td></tr></table></div></figure>
-
+<pre><code>Inf:esprima-tutorial$ node analyze.js test.js
+Reading test.js
+Function declaredTwice decalred multiple times
+Function undeclared undeclared
+Function unused declared but not called
+Done
+</code></pre>
<p>Of course, if you run it on some real code you will see all the flaws we discussed at the beginning of the
article. Again, point of the article is to teach how to use Esprima, not how to write static analyzers.</p>
View
49 blog/2012/09/29/esprima-tutorial/index.html
@@ -107,20 +107,20 @@ <h1 class="entry-title">Esprima Tutorial</h1>
<p>We will build a very simple static analyzer which will run from command line.
It will warn about:</p>
-<ol>
+<ul>
<li>Declared, but not called functions;</li>
<li>Calls to undeclared functions;</li>
<li>Functions declared multiple times.</li>
-</ol>
+</ul>
<p>Of course, it&#8217;s not intended for compelling with excellent <a href="http://www.jshint.com/">JSHint</a> or any other static
analyzer. The only purpose it serves is to show you the basics of JS parsing using Esprima. The things that our
analyzer will NOT do:</p>
-<ol>
+<ul>
<li>Recognize any form of function declaration except:</li>
-</ol>
+</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
@@ -132,20 +132,20 @@ <h1 class="entry-title">Esprima Tutorial</h1>
</span></code></pre></td></tr></table></div></figure>
-<ol>
+<ul>
<li>Recognize any form of function call except:</li>
-</ol>
+</ul>
<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
</pre></td><td class='code'><pre><code class='javascript'><span class='line'><span class="nx">name</span><span class="p">(...)</span>
</span></code></pre></td></tr></table></div></figure>
-<ol>
+<ul>
<li>Know something about imports, exports or predefined globals;</li>
<li>Work with multiple files.</li>
-</ol>
+</ul>
<p>This is not the flaws of a parser. All this features can be easily implemented, they are just out of scope of
@@ -160,14 +160,10 @@ <h1 class="entry-title">Esprima Tutorial</h1>
OS terminal.
Create a directory for your project and install the library:</p>
-<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
-<span class='line-number'>2</span>
-<span class='line-number'>3</span>
-</pre></td><td class='code'><pre><code class='bash'><span class='line'>mkdir esprima-tutorial
-</span><span class='line'><span class="nb">cd </span>esprima-tutorial
-</span><span class='line'>npm install esprima@0.9.9
-</span></code></pre></td></tr></table></div></figure>
-
+<pre><code>mkdir esprima-tutorial
+cd esprima-tutorial
+npm install esprima@0.9.9
+</code></pre>
<p>Create a script named analyze.js with the following content:</p>
@@ -588,20 +584,13 @@ <h1 class="entry-title">Esprima Tutorial</h1>
<p>You should see something like this:</p>
-<figure class='code'><figcaption><span></span></figcaption><div class="highlight"><table><tr><td class="gutter"><pre class="line-numbers"><span class='line-number'>1</span>
-<span class='line-number'>2</span>
-<span class='line-number'>3</span>
-<span class='line-number'>4</span>
-<span class='line-number'>5</span>
-<span class='line-number'>6</span>
-</pre></td><td class='code'><pre><code class='bash'><span class='line'>Inf:esprima-tutorial<span class="nv">$ </span>node analyze.js test.js
-</span><span class='line'>Reading test.js
-</span><span class='line'>Function declaredTwice decalred multiple <span class="nb">times</span>
-</span><span class='line'>Function undeclared undeclared
-</span><span class='line'>Function unused declared but not called
-</span><span class='line'>Done
-</span></code></pre></td></tr></table></div></figure>
-
+<pre><code>Inf:esprima-tutorial$ node analyze.js test.js
+Reading test.js
+Function declaredTwice decalred multiple times
+Function undeclared undeclared
+Function unused declared but not called
+Done
+</code></pre>
<p>Of course, if you run it on some real code you will see all the flaws we discussed at the beginning of the
article. Again, point of the article is to teach how to use Esprima, not how to write static analyzers.</p>
View
2 blog/categories/about/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: About | Harmless Programmer]]></title>
<link href="http://SevInf.github.com/blog/categories/about/atom.xml" rel="self"/>
<link href="http://SevInf.github.com/"/>
- <updated>2012-09-30T13:57:31+03:00</updated>
+ <updated>2012-10-04T18:01:32+03:00</updated>
<id>http://SevInf.github.com/</id>
<author>
<name><![CDATA[Sergej Tatarincev]]></name>
View
22 blog/categories/javascript/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: javascript | Harmless Programmer]]></title>
<link href="http://SevInf.github.com/blog/categories/javascript/atom.xml" rel="self"/>
<link href="http://SevInf.github.com/"/>
- <updated>2012-09-30T13:57:31+03:00</updated>
+ <updated>2012-10-04T18:01:32+03:00</updated>
<id>http://SevInf.github.com/</id>
<author>
<name><![CDATA[Sergej Tatarincev]]></name>
@@ -35,22 +35,22 @@ simpler task will be enough to dive in.</p>
<p>We will build a very simple static analyzer which will run from command line.
It will warn about:</p>
-<ol>
+<ul>
<li>Declared, but not called functions;</li>
<li>Calls to undeclared functions;</li>
<li>Functions declared multiple times.</li>
-</ol>
+</ul>
<p>Of course, it's not intended for compelling with excellent <a href="http://www.jshint.com/">JSHint</a> or any other static
analyzer. The only purpose it serves is to show you the basics of JS parsing using Esprima. The things that our
analyzer will NOT do:</p>
-<ol>
+<ul>
<li>Recognize any form of function declaration except:
<code>javascript
function name(...) {
- ...
+ ...
}
</code></li>
<li>Recognize any form of function call except:
@@ -59,7 +59,7 @@ name(...)
</code></li>
<li>Know something about imports, exports or predefined globals;</li>
<li>Work with multiple files.</li>
-</ol>
+</ul>
<p>This is not the flaws of a parser. All this features can be easily implemented, they are just out of scope of
@@ -74,11 +74,10 @@ Each of following commands can also be done with GUI or Windows Shell, but I'll
OS terminal.
Create a directory for your project and install the library:</p>
-<p><code>bash
-mkdir esprima-tutorial
+<pre><code>mkdir esprima-tutorial
cd esprima-tutorial
npm install esprima@0.9.9
-</code></p>
+</code></pre>
<p>Create a script named analyze.js with the following content:</p>
@@ -397,14 +396,13 @@ function declaredTwice() {
<p>You should see something like this:</p>
-<p><code>bash
-Inf:esprima-tutorial$ node analyze.js test.js
+<pre><code>Inf:esprima-tutorial$ node analyze.js test.js
Reading test.js
Function declaredTwice decalred multiple times
Function undeclared undeclared
Function unused declared but not called
Done
-</code></p>
+</code></pre>
<p>Of course, if you run it on some real code you will see all the flaws we discussed at the beginning of the
article. Again, point of the article is to teach how to use Esprima, not how to write static analyzers.</p>
View
22 blog/categories/node/atom.xml
@@ -4,7 +4,7 @@
<title><![CDATA[Category: node | Harmless Programmer]]></title>
<link href="http://SevInf.github.com/blog/categories/node/atom.xml" rel="self"/>
<link href="http://SevInf.github.com/"/>
- <updated>2012-09-30T13:57:31+03:00</updated>
+ <updated>2012-10-04T18:01:32+03:00</updated>
<id>http://SevInf.github.com/</id>
<author>
<name><![CDATA[Sergej Tatarincev]]></name>
@@ -35,22 +35,22 @@ simpler task will be enough to dive in.</p>
<p>We will build a very simple static analyzer which will run from command line.
It will warn about:</p>
-<ol>
+<ul>
<li>Declared, but not called functions;</li>
<li>Calls to undeclared functions;</li>
<li>Functions declared multiple times.</li>
-</ol>
+</ul>
<p>Of course, it's not intended for compelling with excellent <a href="http://www.jshint.com/">JSHint</a> or any other static
analyzer. The only purpose it serves is to show you the basics of JS parsing using Esprima. The things that our
analyzer will NOT do:</p>
-<ol>
+<ul>
<li>Recognize any form of function declaration except:
<code>javascript
function name(...) {
- ...
+ ...
}
</code></li>
<li>Recognize any form of function call except:
@@ -59,7 +59,7 @@ name(...)
</code></li>
<li>Know something about imports, exports or predefined globals;</li>
<li>Work with multiple files.</li>
-</ol>
+</ul>
<p>This is not the flaws of a parser. All this features can be easily implemented, they are just out of scope of
@@ -74,11 +74,10 @@ Each of following commands can also be done with GUI or Windows Shell, but I'll
OS terminal.
Create a directory for your project and install the library:</p>
-<p><code>bash
-mkdir esprima-tutorial
+<pre><code>mkdir esprima-tutorial
cd esprima-tutorial
npm install esprima@0.9.9
-</code></p>
+</code></pre>
<p>Create a script named analyze.js with the following content:</p>
@@ -397,14 +396,13 @@ function declaredTwice() {
<p>You should see something like this:</p>
-<p><code>bash
-Inf:esprima-tutorial$ node analyze.js test.js
+<pre><code>Inf:esprima-tutorial$ node analyze.js test.js
Reading test.js
Function declaredTwice decalred multiple times
Function undeclared undeclared
Function unused declared but not called
Done
-</code></p>
+</code></pre>
<p>Of course, if you run it on some real code you will see all the flaws we discussed at the beginning of the
article. Again, point of the article is to teach how to use Esprima, not how to write static analyzers.</p>
View
6 sitemap.xml
@@ -6,14 +6,14 @@
</url>
<url>
<loc>http://SevInf.github.com/blog/2012/09/29/esprima-tutorial/</loc>
- <lastmod>2012-09-29T18:54:20+03:00</lastmod>
+ <lastmod>2012-10-04T18:00:26+03:00</lastmod>
</url>
<url>
<loc>http://SevInf.github.com/blog/archives/</loc>
- <lastmod>2012-09-29T18:54:20+03:00</lastmod>
+ <lastmod>2012-10-04T18:00:26+03:00</lastmod>
</url>
<url>
<loc>http://SevInf.github.com/</loc>
- <lastmod>2012-09-29T18:54:20+03:00</lastmod>
+ <lastmod>2012-10-04T18:00:26+03:00</lastmod>
</url>
</urlset>

0 comments on commit 7f6414a

Please sign in to comment.
Something went wrong with that request. Please try again.