ether-code 0.9.1 → 0.9.4

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.
@@ -307,7 +307,7 @@ class EtherLexer {
307
307
  this.tokens.push(new Token(TokenType.DEDENT, '', this.line, 1, indent))
308
308
  }
309
309
  if (this.indentStack[this.indentStack.length - 1] !== indent) {
310
- this.tokens.push(new Token(TokenType.ERROR, 'Indentation incohérente', this.line, 1, indent))
310
+ this.tokens.push(new Token(TokenType.ERROR, 'Indentation incohérente', this.line, 1, indent))
311
311
  }
312
312
  }
313
313
  }
@@ -419,7 +419,7 @@ class EtherLexer {
419
419
  break
420
420
  }
421
421
  if (this.peek() === '\n') {
422
- this.tokens.push(new Token(TokenType.ERROR, 'Chaîne non terminée', startLine, startCol, this.currentIndent))
422
+ this.tokens.push(new Token(TokenType.ERROR, 'Chaîne non terminée', startLine, startCol, this.currentIndent))
423
423
  return
424
424
  }
425
425
  }
@@ -684,6 +684,7 @@ class EtherLexer {
684
684
  'sous chaine', 'couper espaces', 'encoder json', 'decoder json',
685
685
  'fichier existe', 'lire fichier', 'ecrire fichier',
686
686
  'somme tableau', 'filtrer tableau', 'mapper tableau',
687
+ 'fusionner tableaux', 'reduire tableau', 'inverser tableau',
687
688
  'compter elements', 'tableau cles', 'tableau valeurs',
688
689
  'hacher mot', 'verifier mot',
689
690
  'hacher mot de', 'verifier mot de',
@@ -754,6 +755,7 @@ class EtherLexer {
754
755
  'sous chaine', 'couper espaces', 'encoder json', 'decoder json',
755
756
  'fichier existe', 'lire fichier', 'ecrire fichier',
756
757
  'somme tableau', 'filtrer tableau', 'mapper tableau',
758
+ 'fusionner tableaux', 'reduire tableau', 'inverser tableau',
757
759
  'compter elements', 'tableau cles', 'tableau valeurs',
758
760
  'hacher mot', 'verifier mot',
759
761
  'hacher mot de passe', 'verifier mot de passe',
@@ -999,7 +1001,7 @@ class EtherLexer {
999
1001
  break
1000
1002
 
1001
1003
  default:
1002
- this.tokens.push(new Token(TokenType.ERROR, `Caractère inattendu: ${char}`, startLine, startCol, this.currentIndent))
1004
+ this.tokens.push(new Token(TokenType.ERROR, `Caractère inattendu: ${char}`, startLine, startCol, this.currentIndent))
1003
1005
  }
1004
1006
  }
1005
1007
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ether-code",
3
- "version": "0.9.1",
3
+ "version": "0.9.4",
4
4
  "description": "Ether - Le langage intentionnel",
5
5
  "main": "cli/compiler.js",
6
6
  "bin": {
@@ -533,6 +533,16 @@ class EtherParserPHP extends EtherParserBase {
533
533
  })
534
534
  } while (this.match(TokenType.COMMA))
535
535
 
536
+ if (imports.length === 1) {
537
+ return {
538
+ type: 'UseStatement',
539
+ useType: useType,
540
+ name: imports[0].path,
541
+ alias: imports[0].alias,
542
+ imports: imports
543
+ }
544
+ }
545
+
536
546
  return {
537
547
  type: 'UseStatement',
538
548
  useType: useType,
@@ -625,6 +635,9 @@ class EtherParserPHP extends EtherParserBase {
625
635
  type: 'ClassDeclaration',
626
636
  name: name,
627
637
  modifiers: modifiers,
638
+ abstract: modifiers.includes('abstract'),
639
+ final: modifiers.includes('final'),
640
+ readonly: modifiers.includes('readonly'),
628
641
  superClass: superClass,
629
642
  interfaces: interfaces,
630
643
  body: body
@@ -1337,7 +1350,7 @@ class EtherParserPHP extends EtherParserBase {
1337
1350
 
1338
1351
  alternate = {
1339
1352
  type: 'IfStatement',
1340
- condition: elseCondition,
1353
+ test: elseCondition,
1341
1354
  consequent: elseConsequent,
1342
1355
  alternate: null
1343
1356
  }
@@ -1366,7 +1379,7 @@ class EtherParserPHP extends EtherParserBase {
1366
1379
 
1367
1380
  return {
1368
1381
  type: 'IfStatement',
1369
- condition: condition,
1382
+ test: condition,
1370
1383
  consequent: consequent,
1371
1384
  alternate: alternate
1372
1385
  }
@@ -1695,7 +1708,7 @@ class EtherParserPHP extends EtherParserBase {
1695
1708
 
1696
1709
  return {
1697
1710
  type: 'WhileStatement',
1698
- condition: condition,
1711
+ test: condition,
1699
1712
  body: body
1700
1713
  }
1701
1714
  }
@@ -1726,7 +1739,7 @@ class EtherParserPHP extends EtherParserBase {
1726
1739
  return {
1727
1740
  type: 'DoWhileStatement',
1728
1741
  body: body,
1729
- condition: condition
1742
+ test: condition
1730
1743
  }
1731
1744
  }
1732
1745