forked from jquery/esprima
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.html
133 lines (117 loc) · 5.69 KB
/
validate.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<!--[if IE 8]> <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<title>Esprima: Syntax Validator</title>
<meta name="viewport" content="width=device-width" />
<link rel="stylesheet" href="../assets/orion/built-editor.css">
<link rel="stylesheet" href="../assets/style.css">
<link rel="stylesheet" href="../assets/foundation/foundation.min.css">
</head>
<body>
<!-- Navigation bar -->
<div class="row">
<div class="twelve columns">
<nav class="top-bar">
<ul>
<li class="name">
<h1><a href="../index.html">Esprima</a></h1>
</li>
</ul>
<section>
<ul class="right">
<li class="divider show-for-medium-and-up"></li>
<li class="has-dropdown">
<a href="../demo/index.html">Demo</a>
<ul class="dropdown">
<li><label>Static Analysis</label></li>
<li><a href="../demo/parse.html">Online Parsing</a></li>
<li><a href="../demo/validate.html">Syntax Validator</a></li>
<li><a href="../demo/precedence.html">Operator Precedence</a></li>
<li><a href="../demo/collector.html">Regex Collector</a></li>
<li><label>Dynamic Tracing</label></li>
<li><a href="../demo/functiontrace.html">Function Instrumentation</a></li>
<li><label>Code Transformation</label></li>
<li><a href="../demo/rewrite.html">Source Rewrite</a></li>
<li><a href="../demo/minify.html">Minifiy & Obfuscate</a></li>
<li><label>Editing Tools</label></li>
<li><a href="../demo/highlight.html">Identifier Highlight</a></li>
<li><a href="../demo/rename.html">Rename Refactoring</a></li>
<li><a href="../demo/autocomplete.html">Autocomplete</a></li>
</ul>
</li>
<li class="has-dropdown">
<a href="#">Project</a>
<ul class="dropdown">
<li><a href="http://github.com/ariya/esprima">Git Repository</a></li>
<li><a href="https://travis-ci.org/ariya/esprima">Continuous Integration</a></li>
<li><a href="http://groups.google.com/group/esprima">Mailing List</a></li>
<li><a href="http://issues.esprima.org/">Issue Tracker</a></li>
<li class="divider"></li>
<li><label>QA</label></li>
<li><a href="../test/index.html">Unit Tests</a></li>
<li><a href="../test/benchmarks.html">Benchmarks Suite</a></li>
<li><a href="../test/compat.html">Compatibility Tests</a></li>
<li><a href="../test/compare.html">Speed Comparison</a></li>
<li><a href="../test/module.html">Module Loading</a></li>
<li><a href="../test/coverage.html">Coverage Analysis</a></li>
</ul>
</li>
<li><a href="../doc/index.html">Documentation</a></li>
</ul>
</section>
</nav>
</div>
</div>
<!-- Title and subtitle -->
<div class="row">
<div class="twelve columns">
<h3 class="subheader"><strong>Syntax Validator</strong> checks for mistakes and errors</h3>
</div>
</div>
<!-- Main content -->
<div class="row">
<div class="eight columns">
<pre id="editor" spellcheck="false" style="height: 350px">
return 42; // Return statement not inside a function
function f() {
'use strict';
// No more octal
var x = 042;
// Duplicate property
var y = { x: 1, x: 2 };
// With statement can't be used
with (z) {}
}
</pre>
<div id="info" class="alert-box success">No result yet.</div>
</div>
<div class="four columns">
<div class="panel">
<p>Unlike a typical code linter, this syntax validator does <strong>not</strong> care about coding styles and formatting.</p>
<p>If there is a syntax error, the sign <img src="data:image/gif;base64,R0lGODlhEAAQANUAAP7bc//egf/ij/7ijv/jl/7kl//mnv7lnv/uwf7CTP7DTf7DT/7IW//Na/7Na//NbP7QdP/dmbltAIJNAF03AMSAJMSCLKqASa2DS6uBSquCSrGHTq6ETbCHT7WKUrKIUcCVXL+UXMOYX8GWXsSZYMiib6+ETbOIUcOXX86uhd3Muf///wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACH5BAEAACsALAAAAAAQABAAAAZowJVwSCwaj0ihikRSJYcoBEL0XKlGkcjImQQhJBREKFnyICoThKeE/AAW6AXgdPyUAgrLJBEo0YsbAQyDhAEdRRwDDw8OaA4NDQImRBgFEJdglxAEGEQZKQcHBqOkKRpFF6mqq1WtrUEAOw=="> will be shown in the left-side gutter. Placing the mouse cursor over that sign will reveal the complete error description.</p>
</div>
<p>For a command-line usage, check <tt>esvalidate</tt> from <a href="https://npmjs.org/package/esprima">Esprima package</a> (for Node.js).
There is also a plugin for <a href="http://gruntjs.com/">Grunt</a> called <a href="https://github.com/ariya/grunt-jsvalidate">grunt-jsvalidate</a>.
Ant users can take a look at an exemplary <a href="https://github.com/ariya/ant-javascript-validate">Ant task</a> for syntax validation.</p>
</div>
</div>
<!-- Footer -->
<div class="row copyright">
<div class="six columns">
<p>Esprima is created and mantained by <a href="http://ariya.ofilabs.com/about">Ariya Hidayat</a>.</p>
</div>
<div class="six columns">
<ul class="link-list right">
<li><a href="http://twitter.com/esprima">@Esprima</a></li>
<li><a href="https://github.com/ariya/esprima">GitHub</a></li>
</ul>
</div>
</div>
<script src="../esprima.js"></script>
<script src="../assets/orion/built-editor.min.js"></script>
<script src="../assets/orion/customeditor.js"></script>
<script src="validate.js"></script>
</body>
</html>