Skip to content

Commit

Permalink
Merge 9d8c918 into 27206d7
Browse files Browse the repository at this point in the history
  • Loading branch information
lahmatiy committed Jan 13, 2020
2 parents 27206d7 + 9d8c918 commit f2464b0
Show file tree
Hide file tree
Showing 150 changed files with 5,785 additions and 6,033 deletions.
1 change: 1 addition & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"es6": true
},
"parserOptions": {
"ecmaVersion": 2018
},
"rules": {
"no-duplicate-case": 2,
Expand Down
5 changes: 3 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/node_modules/
/.nyc_output/
/.vscode/
/tmp/
/coverage/
/node_modules/
/tmp/
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: node_js
sudo: false
script: "npm run travis"
node_js:
- "8"
- "node"
env:
- REPORTER=min
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
## next

- Removed `List#each()` and `List#eachRight()` methods, `List#forEach()` and `List#forEachRight()` should be used instead
- Changed `List` to be iterable (iterates data)
- Changed `List#first`, `List#last` and `List#isEmpty` to getters
- Changed `List#getSize()` method to `List#size` getters
- Removed `Lexer#matchDeclaration()` method
- Exposed parser's inner configuration as `parse.config`
- Changed `TokenStream#getRawLength()` to take second parameter as a function (rule) that check a char code for stop scan
- Added `consumeUntilBalanceEnd()`, `consumeUntilLeftCurlyBracket()`, `consumeUntilLeftCurlyBracketOrSemicolon()`, `consumeUntilExclamationMarkOrSemicolon()` and `consumeUntilSemicolonIncluded()` methods to parser to use with `Raw` instead of `Raw.mode`

## 1.0.0-alpha.39 (December 5, 2019)

- Fixed walker with `visit: "Declaration"` to iterate `DeclarationList` (#114)
Expand Down
22 changes: 11 additions & 11 deletions data/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
var mdnAtrules = require('mdn-data/css/at-rules.json');
var mdnProperties = require('mdn-data/css/properties.json');
var mdnSyntaxes = require('mdn-data/css/syntaxes.json');
var patch = require('./patch.json');
const mdnAtrules = require('mdn-data/css/at-rules.json');
const mdnProperties = require('mdn-data/css/properties.json');
const mdnSyntaxes = require('mdn-data/css/syntaxes.json');
const patch = require('./patch.json');

function preprocessAtrules(dict) {
var result = Object.create(null);
const result = Object.create(null);

for (var atruleName in dict) {
var atrule = dict[atruleName];
var descriptors = null;
for (const atruleName in dict) {
const atrule = dict[atruleName];
let descriptors = null;

if (atrule.descriptors) {
descriptors = Object.create(null);

for (var descriptor in atrule.descriptors) {
for (const descriptor in atrule.descriptors) {
descriptors[descriptor] = atrule.descriptors[descriptor].syntax;
}
}
Expand All @@ -31,12 +31,12 @@ function buildDictionary(dict, patchDict) {
var result = {};

// copy all syntaxes for an original dict
for (var key in dict) {
for (const key in dict) {
result[key] = dict[key].syntax;
}

// apply a patch
for (var key in patchDict) {
for (const key in patchDict) {
if (key in dict) {
if (patchDict[key].syntax) {
result[key] = patchDict[key].syntax;
Expand Down

0 comments on commit f2464b0

Please sign in to comment.