mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Move TextMateGrammar.buildCaptureTree to .getCaptureTree method on OnigRegExp
This commit is contained in:
@@ -54,22 +54,6 @@ class TextMateGrammar
|
||||
else if name == "$self"
|
||||
@initialRule
|
||||
|
||||
@buildCaptureTree: (captures, startPositions, totalCaptures=captures.length) ->
|
||||
index = totalCaptures - captures.length
|
||||
text = captures.shift()
|
||||
startPosition = startPositions.shift()
|
||||
endPosition = startPosition + text.length
|
||||
|
||||
tree = { index, text, position: startPosition }
|
||||
|
||||
childCaptures = []
|
||||
while startPositions[0] < endPosition
|
||||
childCaptures.push(@buildCaptureTree(captures, startPositions, totalCaptures))
|
||||
|
||||
tree.captures = childCaptures if childCaptures.length
|
||||
tree
|
||||
|
||||
|
||||
class Rule
|
||||
grammar: null
|
||||
scopeName: null
|
||||
|
||||
@@ -7,6 +7,7 @@ fs = require 'fs'
|
||||
_ = require 'underscore'
|
||||
$ = require 'jquery'
|
||||
{CoffeeScript} = require 'coffee-script'
|
||||
require 'onig-reg-exp'
|
||||
|
||||
windowAdditions =
|
||||
rootViewParentSelector: 'body'
|
||||
|
||||
Reference in New Issue
Block a user