Changelog
1.0.0-alpha.26 (November 9, 2017)
Tokenizer#isBalanceEdge()
methodTokenizer.endsWith()
methodtolerant
parser option (no parsing modes anymore)property
parser option (a value parsing does not depend on property name anymore)Brackets
, Function
and Parentheses
when EOF is reachedRaw
node)Raw
node, not a declaration as before)Raw
node that represents a declaration valueValue
parse handler to return a node only with type Value
(previously it returned a Raw
node in some cases)onParseError()
is not invoked for errors occured on selector or declaration value parsing in some casesonParseError()
to stop parsing if handler throws an exceptiongrammar.walk()
to invoke passed handler on entering to node rather than on leaving the nodegrammar.walk()
to take a walk handler pair as an object, i.e. walk(node, { enter: fn, leave: fn })
Lexer#match*()
methods to take a node of any type, but with a children
fieldLexer#match(syntax, node)
methodLexer#matchType()
method to stop return a positive result for the CSS wide keywordsChangelog
1.0.0-alpha25 (October 9, 2017)
onParseError()
handlerRaw
node in tolerant mode instead of being ignoredRule
node as part of selector instead of being ignoredparseAtrulePrelude
behaviour to parseRulePrelude
Raw
node wraping into AtrulePrelude
when parseAtrulePrelude
is disabledtranslateWithSourceMap()
, flattening the string (because of mixing building string and indexing into it) turned it into a quadratic algorithm (approximate numbers can be found in the quiz created by this case)property()
Changelog
1.0.0-alpha24 (September 14, 2017)
selector
to prelude
. The reasons: spec names this part so, and this branch can contain not only a selector (SelectorList
) but also a raw payload (Raw
). What's changed:
Rule.selector
to Rule.prelude
parseSelector
parser option to parseRulePrelude
SelectorList
Lexer#checkStructure()
Changelog
1.0.0-alpha23 (September 10, 2017)
Tokenizer#getRawLength()
's false positive balance match to the end of input in some cases (#56)walk()
, walkUp()
etc)expression
to prelude
(since spec names it so)
AtruleExpression
node type → AtrulePrelude
Atrule.expression
field → Atrule.prelude
parseAtruleExpression
parser's option → parseAtrulePrelude
atruleExpression
parse context → atrulePrelude
atruleExpression
walk context reference → atrulePrelude
Changelog
1.0.0-alpha22 (September 8, 2017)
{}-block
in tolerant modeDeclarationList
require('css-tree/lib/parser')
(#47)+n
when AnPlusB.a
is +1
to be "round-trip" with parserrequire('css-tree/lib/generator')
require('css-tree/lib/walker')
(#47)default
keyword to the list of invalid values for <custom-ident>
(since it reversed per spec)toPlainObject()
and fromPlainObject()
) moved to lib/convertor
(entry point is require('css-tree/lib/convertor')
)Changelog
1.0.0-alpha21 (September 5, 2017)
Raw
token typeurl()
with raw as url to be more spec complientTokenizer#balance
array computation on token layoutTokenizer#getRawLength()
to compute a raw length with respect of block balanceTokenizer#getTokenStart(offset)
method to get token start offset by token indexidx
and balance
fields to each token of Tokenizer#dump()
method resultonParseError
optionRaw
node to use a new approach. Since now a Raw
node builds in parser#Raw()
function onlyparser#Raw()
, it takes 5 parameters now (it might to be changed in future)parser#tolerantParse()
to pass a start token index to fallback function instead of source offsetAtruleExpression
consuming in tolerant modeAtruleExpression
node into null
AtruleExpression
handler to always return a node (before it could return a null
in some cases)#
multiplierSyntaxReferenceError
syntax.fork()
Changelog
1.0.0-alpha20 (August 28, 2017)
Atrule
token type (<at-rule-token>
per spec)Function
token type (<function-token>
per spec)Url
token typeTokenizer#getTypes()
method with Tokenizer#dump()
to get all tokens as an arrayTokenizer.TYPE.Whitespace
to Tokenizer.TYPE.WhiteSpace
Tokenizer.findWhitespaceEnd()
to Tokenizer.findWhiteSpaceEnd()
tolerant: true
option). In this mode parse errors are never occour and any invalid part of CSS turns into a Raw
node. Current safe points: Atrule
, AtruleExpression
, Rule
, Selector
and Declaration
. Feature is experimental and further improvements are planned.Atrule.expression
to contain a AtruleExpression
node or null
only (other node types is wrapping into a AtruleExpression
node)AttributeSelector.operator
to AttributeSelector.matcher
translate()
method is now can take a function as second argument, that recieves every generated chunk. When no function is passed, default handler is used, it concats all the chunks and method returns a string.x
unit to <resolution>
generic typezero or more
multipliers)ASTNode
node type to contain a reference to AST node#
multipliertranslate()
function to get a handler as third argument (optional). That handler recieves result of node traslation and can be used for decoration purposes. See exampleSyntaxParseError
to grammar exportSequence
for Group
node type (Sequence
node type removed)explicit
boolean property for Group
nonEmpty
Group's property to disallowEmpty
Group
when it contains a single Group
term (return this Group
as a result)Lexer#matchProperty()
and Lexer#matchType()
to return an object instead of match tree. A match tree stores in matched
field when AST is matched to grammar successfully, otherwise an error in error
field. The result object also has some methods to test AST node against a match tree: getTrace()
, isType()
, isProperty()
and isKeyword()
Lexer#matchDeclaration()
methodLexer#lastMatchError
(error stores in match result object in error
field)Lexer#findValueSegments()
, Lexer#findDeclarationValueSegments()
and Lexer#findAllSegments
)SyntaxReferenceError
for unknown property and type referencesproperty()
function: variable
→ custom
line
and column
) of Error
and exception on attempt to write in iOS SafariChangelog
1.0.0-alpha19 (April 24, 2017)
List
class with new methods:
List#prepend(item)
List#prependData(data)
List#insertData(data)
List#insertList(list)
List#replace(item, itemOrList)
Changelog
1.0.0-alpha17 (March 13, 2017)
syntax
exports
to expose a default syntaxcreateSyntax()
method to create a new syntax from scratchfork()
method to create a new syntax based on given via extensionmediaQueryList
and mediaQuery
parsing contextsCDO
and CDC
node types#
and +
)@font-face
at-rulechroma()
to legacy IE filter functionsHexColor
to consume hex only\0
and \9
hacks (#2)Ratio
terms
Ratio
termRatio
term!ie
)true
for important
field in case identifier equals to important
and string otherwiseParser
classreadSelectorSequence()
, readSequenceFallback()
and readSelectorSequenceFallback
methodsAtruleExpression
, Selector
and Value
translateMarkup(ast, before, after)
method for complex casestranslateWithSourceMap
to be more flexible (based on translateMarkup
, additional work to be done in next releases)checkStructure(ast)
method to check AST structure based on syntax definitionmdn/data
<'offset-position'>
syntax<position>
property with -webkit-sticky
(@sergejmueller, #37)gen:syntax
) to generate AST format reference page (docs/ast.md
) using syntax definition