ether-code 0.5.8 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cli/ether.js CHANGED
@@ -6,7 +6,7 @@ const http = require('http')
6
6
  const { EtherCompiler } = require('./compiler')
7
7
  const { Watcher } = require('./watcher')
8
8
 
9
- const VERSION = '0.5.8'
9
+ const VERSION = '0.6.0'
10
10
 
11
11
  const COLORS = {
12
12
  reset: '\x1b[0m',
package/ether-parser.js CHANGED
@@ -719,7 +719,8 @@ class EtherParser {
719
719
  'filtre': ['fond'],
720
720
  'decoupe': ['fond'],
721
721
  'découpe': ['fond'],
722
- 'origine': ['transformation', 'perspective']
722
+ 'origine': ['transformation', 'perspective'],
723
+ 'liste': ['style', 'ordonnee', 'description']
723
724
  }
724
725
 
725
726
  let property = token.value
@@ -803,13 +804,13 @@ class EtherParser {
803
804
  } else if (current.type === TokenType.MINUS) {
804
805
  if (current.value === '--') {
805
806
  valueParts.push('--')
806
- } else if (lastType === TokenType.LPAREN || lastType === TokenType.MINUS) {
807
+ } else if (lastType === TokenType.LPAREN) {
807
808
  valueParts.push(current.value)
808
- } else if (needsSpace) {
809
- valueParts.push(' ' + current.value)
810
809
  } else {
811
- valueParts.push(current.value)
810
+ valueParts.push(' ' + current.value)
812
811
  }
812
+ } else if (current.type === TokenType.PLUS) {
813
+ valueParts.push(' +')
813
814
  } else if (current.type === TokenType.COLON) {
814
815
  valueParts.push(':')
815
816
  } else if (current.type === TokenType.DOT) {
@@ -1416,23 +1416,26 @@ class CSSGenerator {
1416
1416
  const translatedSelectors = selectors.map(s => this.translateSelector(s))
1417
1417
  const isRoot = translatedSelectors.some(s => s === ':root')
1418
1418
 
1419
- this.writeLine(`${translatedSelectors.join(', ')} {`)
1420
- this.indent++
1421
-
1422
1419
  const declarations = node.declarations || node.properties || []
1423
- for (const decl of declarations) {
1424
- this.generateDeclaration(decl, isRoot)
1425
- }
1420
+
1421
+ if (declarations.length > 0 || node.children) {
1422
+ this.writeLine(`${translatedSelectors.join(', ')} {`)
1423
+ this.indent++
1426
1424
 
1427
- if (node.children) {
1428
- for (const child of node.children) {
1429
- this.generateNode(child)
1425
+ for (const decl of declarations) {
1426
+ this.generateDeclaration(decl, isRoot)
1430
1427
  }
1431
- }
1432
1428
 
1433
- this.indent--
1434
- this.writeLine('}')
1435
- this.writeLine('')
1429
+ if (node.children) {
1430
+ for (const child of node.children) {
1431
+ this.generateNode(child)
1432
+ }
1433
+ }
1434
+
1435
+ this.indent--
1436
+ this.writeLine('}')
1437
+ this.writeLine('')
1438
+ }
1436
1439
 
1437
1440
  if (node.nestedRules) {
1438
1441
  for (const nested of node.nestedRules) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ether-code",
3
- "version": "0.5.8",
3
+ "version": "0.6.0",
4
4
  "description": "Ether - Le langage intentionnel",
5
5
  "main": "cli/compiler.js",
6
6
  "bin": {