12 Commits

Author SHA1 Message Date
Ashe Connor
99eaf5faf9 Replace the tokenizer with a flex-based scanner (#3846)
* Lex everything except SGML, multiline, SHEBANG

* Prepend SHEBANG#! to tokens

* Support SGML tag/attribute extraction

* Multiline comments

* WIP cont'd; productionifying

* Compile before test

* Add extension to gemspec

* Add flex task to build lexer

* Reentrant extra data storage

* regenerate lexer

* use prefix

* rebuild lexer on linux

* Optimise a number of operations:

* Don't read and split the entire file if we only ever use the first/last n
  lines

* Only consider the first 50KiB when using heuristics/classifying.  This can
  save a *lot* of time; running a large number of regexes over 1MiB of text
  takes a while.

* Memoize File.size/read/stat; re-reading in a 500KiB file every time `data` is
  called adds up a lot.

* Use single regex for C++

* act like #lines

* [1][-2..-1] => nil, ffs

* k may not be set
2017-10-31 11:06:56 +11:00
Brandon Black
28bce533b2 Release v5.0.2 (#3427)
* updated grammars

* bumping version

* adding .gem files to gitignore
2017-01-11 16:08:31 -08:00
Todd Berman
cc5f1c57ca Add Codemirror modes 2016-09-20 23:23:22 -07:00
Adam Roben
0d183e2e89 Ignore vendor/gems
This is where script/bootstrap places the bundle.
2014-12-18 12:14:45 -05:00
Garen Torikian
1d4149168d Add Rake task to fetch ace_modes, and skip test if there's no internet 2014-11-28 11:48:26 -08:00
Brandon Keepers
63f9d0bdeb Add Gemfile.lock sample
Gemfile.lock should not actually get classified as Ruby, but we can fix that in another PR.
2014-11-18 15:36:42 -05:00
Adam Roben
046fb18980 Add github-linguist-grammars gem
The purpose of this gem is to package up the language grammars that are
used for syntax highlighting on github.com. The grammars are TextMate,
Sublime Text, or Atom language grammars, converted to JSON and given the
filename SCOPE.json, where SCOPE is the language scope that the grammar
defines.

The github-linguist-grammars gem packages up all the grammars, and also
exports a Linguist::Grammars.path method to locate the directory
containing the grammars.

To build the gem, simply run `rake build_grammars_gem`. The grammars.yml
file lists all the repositories we download grammars from, as well as
which scopes are defined by each repository. The
script/download-grammars script takes that list and downloads and
processes the grammars into the format expected by the gem.
2014-11-13 11:03:53 -05:00
Arfon Smith
cd99ab2d6e Vendored gems 2014-10-21 18:40:43 -04:00
Brandon Keepers
156985ed52 Remove samples.json from version control 2014-09-16 10:24:05 -04:00
Arfon Smith
cac9873e20 Ignoring benchmark files 2014-07-23 10:26:21 -05:00
Sebastian Godelet
8db3638ce4 add .bundle/ and vendor to .gitignore 2014-04-22 14:10:57 +02:00
Joshua Peek
eb6df1a6f6 Ignore Gemfile.lock 2011-05-11 16:19:16 -05:00