mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
Create tokens in TokenizedBuffer
This commit is contained in:
@@ -203,6 +203,7 @@ class TokenizedBuffer extends Model
|
||||
lineEnding = @buffer.lineEndingForRow(row)
|
||||
tabLength = @getTabLength()
|
||||
{ tokens, ruleStack } = @grammar.tokenizeLine(line, ruleStack, row is 0)
|
||||
tokens = (new Token(token) for token in tokens)
|
||||
new TokenizedLine({tokens, ruleStack, tabLength, lineEnding})
|
||||
|
||||
# FIXME: benogle says: These are actually buffer rows as all buffer rows are
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
_ = require 'underscore-plus'
|
||||
Token = require './token'
|
||||
|
||||
### Internal ###
|
||||
|
||||
module.exports =
|
||||
class TokenizedLine
|
||||
constructor: ({tokens, @lineEnding, @ruleStack, @startBufferColumn, @fold, tabLength}) ->
|
||||
tokens = (new Token(token) for token in tokens)
|
||||
@tokens = @breakOutAtomicTokens(tokens, tabLength)
|
||||
@startBufferColumn ?= 0
|
||||
@text = _.pluck(@tokens, 'value').join('')
|
||||
|
||||
Reference in New Issue
Block a user