Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
JSure is a fast, standalone Javascript checker.
OCaml JavaScript Ruby
branch: master

Implement -no-color option.

latest commit f7c32e2160
Berke Durak authored
Failed to load latest commit information.
misc Updated options.rb
tests Guess what, yet another float lexeme fix.
.hgignore Added .hgignore.
AUTHORS Credit.
CHANGES Implement -no-color option.
LICENSE Initial import.
Makefile Fix parsing issues reported by Michael Dayah.
README Changelog, and note in readme about semicolons.
_tags Initial import.
ansi.ml Implement -no-color option.
ansi.mli Implement -no-color option.
ast.ml Now handles octal and hexadecimal integer litterals, and uses int32s.
cache.ml Initial import.
check.ml Warn unused, undefined variables.
conduit.ml Initial import.
conduit.mli Initial import.
convert.ml Now handles octal and hexadecimal integer litterals, and uses int32s.
ecma-262.pdf Initial import.
ecma.peg Guess what, yet another float lexeme fix.
ecmalexer.lex Initial import.
ecmarex.peg Initial import.
eval.ml Now handles octal and hexadecimal integer litterals, and uses int32s.
excerpt.ml Implement -no-color option.
fake_ansi.ml Implement -no-color option.
forbidden.properties Initial import.
generate.ml Now handles octal and hexadecimal integer litterals, and uses int32s.
jsure.ml Implement -no-color option.
levenshtein.ml Initial import.
liner.ml Also display source excerpt on syntax errors.
manual.txt Initial import.
minefield.ml Initial import.
myocamlbuild.ml Included README and binaries.
opt.ml Add -undefined-variables
pffpsf.ml Initial import.
process.ml Implement -no-color option.
qwerty.ml Initial import.
source.ml Also display source excerpt on syntax errors.
test_ecma.ml Initial import.
version.ml Implement -no-color option.

README

Installation instructions
=========================

* Pre-compiled binaries for Linux are available in bin/
* To compile Jsure:
  - Get, build and install Aurochs from http://aurochs.fr/
  - make
  - PREFIX=/usr/local make install

Important note
==============
I have recently discovered that the Javascript grammar allows you to omit
semicolons in most circumstances.  Actually, it is more on the order
of tolerating forgotten semicolons than "allowing" their omission, because the
parser described in the ECMA specification is supposed to backtrack and retry
when it doesn't find an expected semicolon.  Of course this (1) supposes
a particular parsing method and (2) makes the suggested parser run slowly.

Unfortunately I would need to completely rewrite my Javascript grammar
(and possibly make hacks to Aurochs) to support the omission of semicolons.

I think omitting semicolons is very bad practice.  For one thing, it
makes the source more ambiguous and harder to read.  For another thing,
it departs from common C and Java syntactic conventions.  Fortunately,
it seems that only a handful of people systematically omit semicolons.

I'm saying a handful but I have only seen one such case:  someone whose
Javascript looked like

  function GetLen_(G) { var K, L, C = ""	// Get good margin
    G.Len.value = K = L = Math.max(G.Len.value, 1)
    while (--K) C += " " ; G.Result.value = C + "|"
    return L }

I guess people who'll use Jsure are not in the business of obfuscating
their source (there are tools for that), so I'll leave semicolons mandatory.
Something went wrong with that request. Please try again.