Commit Graph

2948 Commits

Author SHA1 Message Date
Corey Johnson & Nathan Sobo
c7586a0e97 Rename matchingCharachters to pairedCharachters 2012-08-08 17:42:10 -07:00
Nathan Sobo
8c5e77d325 Move theme activation to RootView 2012-08-08 17:04:54 -06:00
Nathan Sobo
c8154e4e8c Use Twilight theme stylesheet based on TextMateTheme 2012-08-08 16:55:34 -06:00
Nathan Sobo
2df05e235a Break out window.applyStylesheet from window.requireStylesheet
This will be useful in applying generated stylesheets associated with themes.
2012-08-08 16:09:23 -06:00
Corey Johnson & Nathan Sobo
3376dead06 fix broken spec 2012-08-08 14:54:11 -07:00
Corey Johnson & Nathan Sobo
8563b47dfd Merge branch 'textmate' of github.com:github/atom into textmate 2012-08-08 15:52:27 -06:00
Corey Johnson & Nathan Sobo
a8c19b1692 Fix OnigRegExp spec 2012-08-08 14:52:14 -07:00
Corey Johnson & Nathan Sobo
2945576cb7 Include themes directory in bundle 2012-08-08 14:14:20 -07:00
Corey Johnson & Nathan Sobo
221135a290 Fix broken benchmark 2012-08-08 13:19:28 -06:00
Corey Johnson & Nathan Sobo
2a945838f5 Return absolute minimum capture data from OnigRegExp 2012-08-08 12:13:54 -07:00
Corey Johnson & Nathan Sobo
93f21207ab Un-f benchmark suite 2012-08-08 11:05:01 -06:00
Corey Johnson & Nathan Sobo
472e5348e2 Update TextMateGrammar to use optimized array-based capture trees 2012-08-08 11:04:36 -06:00
Corey Johnson & Nathan Sobo
fd295faa44 OnigRegExp.getCaptureTree only returns capture tree (no capture text) 2012-08-08 11:04:13 -06:00
Corey Johnson & Nathan Sobo
e0516def80 Prioritize getCaptureTree in conditionals for tiny drops of speed 2012-08-08 10:16:36 -06:00
Nathan Sobo
f1438f2806 Optimization: Return only arrays from getCaptureTree
Creating objects and setting key-value pairs is more expensive than creating arrays with numeric indices. So this squeezes a bit more performance.
2012-08-08 09:57:42 -06:00
Nathan Sobo
c6c4d6413e Optimization attempt: Captures contain start/end position instead of text 2012-08-08 09:11:32 -06:00
Nathan Sobo
f559ad73a7 Make grammar handle lines that don't match *any* of the current rule's patterns
It's possible to get a match based on a lookahead, but not actually have any non-empty capture groups. This should be considered a failed match.
2012-08-08 08:59:13 -06:00
Corey Johnson & Nathan Sobo
827b3e29d3 Implement OnigRegExp.getCaptureTree natively 2012-08-07 16:20:02 -07:00
Corey Johnson & Nathan Sobo
088b1a1398 💄 2012-08-07 16:18:16 -07:00
Nathan Sobo
bfb559e1c5 WIP: Native version of OnigRegExp.getCaptureTree. Not wired up yet or tested. 2012-08-07 14:46:24 -06:00
Nathan Sobo
33b1c47844 Copy bundles directory in Rakefile copy task 2012-08-07 14:45:25 -06:00
Corey Johnson & Nathan Sobo
5188d75772 Add benchmark for OnigRegExp 2012-08-07 13:09:01 -06:00
Corey Johnson & Nathan Sobo
39dbcb15b7 Include end pattern in compiled regexes. Also Compile regexes for pushed rules. 2012-08-07 12:07:24 -06:00
Nathan Sobo
d520d6c859 WIP: Optimization: compile a single regex for each grammar rule
We compile a giant regex out of all the individual regexes for each pattern by or'ing together a capture group for each one. Then we use the index of the matched capture group to determine which pattern actually matched, and adjust the capture indexes of the subtree to make it appear to start from index 0, so the capture indices on the pattern align properly. There is still broken-ness on more complex patterns, but basic patterns and patterns w/ captures work.
2012-08-06 18:32:55 -06:00
Nathan Sobo
a02af2a51f Add benchmark for TokenizedBuffer w/ new TextMateGrammar tokenization. SO SLOW! 2012-08-06 18:28:51 -06:00
Nathan Sobo
6878d19a6a OnigRegExp.getCaptureTree does not include empty child captures 2012-08-06 18:27:39 -06:00
Nathan Sobo
a85345e392 Add OnigRegExp.getCaptureCount 2012-08-06 18:27:14 -06:00
Nathan Sobo
d495263b88 Update to 98aa644b of github's fork of cocoaoniguruma for captureCount method 2012-08-06 18:26:53 -06:00
Nathan Sobo
7bc6a5f24b TextMateGrammar handles nested capture groups and trailing lookahead captures
Our previous implementation only allowed for a single layer of capture groups. Now we can have captures within captures. I achieved this by converting the match into a tree before generating tokens. If there are any capture scopes specified, then we will always emit a token for every capture group in the match. This may create some redundant tokens (a serious of 2 or more tokens with the same scopes), but it will at least be technically correct. I think the overhead of removing these redundancies exceeds the cost of maintaining them for now.
2012-08-06 16:35:33 -06:00
Nathan Sobo
0d6d16a438 Move TextMateGrammar.buildCaptureTree to .getCaptureTree method on OnigRegExp 2012-08-06 11:43:44 -06:00
Nathan Sobo
32fc042929 Add TextMateGrammar.buildCaptureTree, which organizes nested captures in a tree
This will be a weapon in dealing with capture groups that nest within other capture groups, and also helps deal with trailing lookahead groups that don't belong in the main match. I made it a class method because it's stateless and that made it easier to test.
2012-08-03 23:52:58 -06:00
Nathan Sobo
fd28a3577a Improve spec description 2012-08-03 23:51:14 -06:00
Corey Johnson & Nathan Sobo
0e1d3fe3a9 wip: fixing capture group problems 2012-08-03 11:38:45 -07:00
Corey Johnson & Nathan Sobo
1a243adfcf All specs pass w/ TextMateGrammar for tokenization (auto-indent disabled) 2012-08-03 12:00:05 -06:00
Corey Johnson
08a55dfcac wip: IndentationForRow almost works TextMate preferences 2012-08-02 17:02:17 -07:00
Corey Johnson
82562c89dd Name onig-reg-exp-spec correctly 2012-08-02 16:25:34 -07:00
Corey Johnson
2d3e2b53a3 Passes TextMateBundle spec 2012-08-02 13:23:15 -07:00
Corey Johnson & Nathan Sobo
9ca4c2c347 WIP: Loading TextMate Bundle preferences globally 2012-08-02 13:04:43 -06:00
Corey Johnson
b378620c54 Add TextMateBundle which handles all bundle loading 2012-08-02 11:38:14 -07:00
Corey Johnson
81f83482b0 Rename File.getName and Directory.getName to .getBaseName 2012-08-02 11:37:49 -07:00
Corey Johnson
114847fb0f Update display buffer spec 2012-08-02 10:25:55 -07:00
Corey Johnson & Nathan Sobo
0a97cb0590 Tokenized buffer uses TextMate grammar 2012-08-02 10:05:09 -07:00
Corey Johnson & Nathan Sobo
b50b8eacca wip: hooking up tokenized buffer to textmate grammars 2012-08-01 17:54:08 -07:00
Corey Johnson & Nathan Sobo
0cdc042e71 Use text as the default grammar 2012-08-01 17:24:28 -07:00
Corey Johnson & Nathan Sobo
e6bc0e092a Add javascript bundle 2012-08-01 17:18:43 -07:00
Corey Johnson & Nathan Sobo
1d70e2e85b Add bundles for coffeeScript and ruby 2012-08-01 17:16:01 -07:00
Corey Johnson & Nathan Sobo
627a75b9c6 Removing submodules 2012-08-01 17:14:13 -07:00
Corey Johnson & Nathan Sobo
058f63c01f load all bundle grammars in window.startup 2012-08-01 17:09:29 -07:00
Corey Johnson & Nathan Sobo
370e0b896e Add TextMateGrammar.loadFromBundles() 2012-08-01 16:58:31 -07:00
Corey Johnson & Nathan Sobo
1ea5380ca6 add ruby bundle submodule 2012-08-01 16:18:02 -07:00