mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-20 23:48:05 +03:00
Implement createToken in Syntax
This commit is contained in:
parent
882d766689
commit
9962ce9859
@ -25,7 +25,7 @@
|
||||
"coffeestack": "0.6.0",
|
||||
"diff": "git://github.com/benogle/jsdiff.git",
|
||||
"emissary": "0.19.0",
|
||||
"first-mate": "0.7.0",
|
||||
"first-mate": "0.9.0",
|
||||
"fs-plus": "0.13.0",
|
||||
"fuzzaldrin": "0.1.0",
|
||||
"git-utils": "0.29.0",
|
||||
|
@ -4,6 +4,7 @@ _ = require 'underscore-plus'
|
||||
{GrammarRegistry, ScopeSelector} = require 'first-mate'
|
||||
|
||||
{$, $$} = require './space-pen-extensions'
|
||||
Token = require './token'
|
||||
|
||||
### Public ###
|
||||
module.exports =
|
||||
@ -26,6 +27,8 @@ class Syntax extends GrammarRegistry
|
||||
serialize: ->
|
||||
{deserializer: @constructor.name, @grammarOverridesByPath}
|
||||
|
||||
createToken: (value, scopes) -> new Token({value, scopes})
|
||||
|
||||
addProperties: (args...) ->
|
||||
name = args.shift() if args.length > 2
|
||||
[selector, properties] = args
|
||||
|
@ -203,7 +203,6 @@ 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
|
||||
|
Loading…
Reference in New Issue
Block a user