@danielx/civet 0.2.8 → 0.2.9

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/dist/main.js CHANGED
@@ -498,6 +498,8 @@ var require_parser = __commonJS({
498
498
  BinaryOp,
499
499
  UnaryOp,
500
500
  ModuleItem,
501
+ StatementListItem,
502
+ PostfixConditional,
501
503
  Statement,
502
504
  EmptyStatement,
503
505
  BlockStatement,
@@ -726,10 +728,10 @@ var require_parser = __commonJS({
726
728
  var $L82 = $L("delete");
727
729
  var $L83 = $L("void");
728
730
  var $L84 = $L("typeof");
729
- var $L85 = $L(";");
730
- var $L86 = $L("if");
731
- var $L87 = $L("else");
732
- var $L88 = $L("unless");
731
+ var $L85 = $L("if");
732
+ var $L86 = $L("unless");
733
+ var $L87 = $L(";");
734
+ var $L88 = $L("else");
733
735
  var $L89 = $L("loop");
734
736
  var $L90 = $L("do");
735
737
  var $L91 = $L("while");
@@ -1434,7 +1436,7 @@ var require_parser = __commonJS({
1434
1436
  return BracedBlock$0(state) || BracedBlock$1(state) || BracedBlock$2(state);
1435
1437
  }
1436
1438
  }
1437
- var SingleNestedBlockExpression$0 = $TS($S(PushIndent, $E($S(Nested, $C(Declaration, Statement))), $C($C($N($S(Nested, $C(Declaration, Statement))), $S(PopIndent, $N($EXPECT($L30, fail, 'SingleNestedBlockExpression ""')))), PopIndent)), function($skip, $loc, $0, $1, $2, $3) {
1439
+ var SingleNestedBlockExpression$0 = $TS($S(PushIndent, $E($S(Nested, StatementListItem)), $C($C($N($S(Nested, StatementListItem)), $S(PopIndent, $N($EXPECT($L30, fail, 'SingleNestedBlockExpression ""')))), PopIndent)), function($skip, $loc, $0, $1, $2, $3) {
1438
1440
  var exp = $2;
1439
1441
  if (exp)
1440
1442
  return exp;
@@ -1464,7 +1466,7 @@ var require_parser = __commonJS({
1464
1466
  return NestedBlockExpressions$0(state);
1465
1467
  }
1466
1468
  }
1467
- var BlockExpression$0 = $S(Nested, $C(Declaration, Statement), StatementDelimiter);
1469
+ var BlockExpression$0 = $S(Nested, StatementListItem, StatementDelimiter);
1468
1470
  function BlockExpression(state) {
1469
1471
  if (state.verbose)
1470
1472
  console.log("ENTER:", "BlockExpression");
@@ -1874,13 +1876,45 @@ var require_parser = __commonJS({
1874
1876
  }
1875
1877
  var ModuleItem$0 = ImportDeclaration;
1876
1878
  var ModuleItem$1 = ExportDeclaration;
1877
- var ModuleItem$2 = Declaration;
1878
- var ModuleItem$3 = Statement;
1879
+ var ModuleItem$2 = StatementListItem;
1879
1880
  function ModuleItem(state) {
1880
1881
  if (state.tokenize) {
1881
- return $TOKEN("ModuleItem", state, ModuleItem$0(state) || ModuleItem$1(state) || ModuleItem$2(state) || ModuleItem$3(state));
1882
+ return $TOKEN("ModuleItem", state, ModuleItem$0(state) || ModuleItem$1(state) || ModuleItem$2(state));
1882
1883
  } else {
1883
- return ModuleItem$0(state) || ModuleItem$1(state) || ModuleItem$2(state) || ModuleItem$3(state);
1884
+ return ModuleItem$0(state) || ModuleItem$1(state) || ModuleItem$2(state);
1885
+ }
1886
+ }
1887
+ var StatementListItem$0 = $TS($S($C(Declaration, Statement), $E(PostfixConditional)), function($skip, $loc, $0, $1, $2) {
1888
+ var statement = $1;
1889
+ var cond = $2;
1890
+ if (cond)
1891
+ return [cond, statement, "}"];
1892
+ return $0;
1893
+ });
1894
+ function StatementListItem(state) {
1895
+ if (state.verbose)
1896
+ console.log("ENTER:", "StatementListItem");
1897
+ if (state.tokenize) {
1898
+ return $TOKEN("StatementListItem", state, StatementListItem$0(state));
1899
+ } else {
1900
+ return StatementListItem$0(state);
1901
+ }
1902
+ }
1903
+ var PostfixConditional$0 = $TS($S($Q(TrailingComment), $C($EXPECT($L85, fail, 'PostfixConditional "if"'), $EXPECT($L86, fail, 'PostfixConditional "unless"')), NonIdContinue, Expression), function($skip, $loc, $0, $1, $2, $3, $4) {
1904
+ var ws = $1;
1905
+ var cond = $2;
1906
+ var exp = $4;
1907
+ if (cond === "if")
1908
+ return [ws, "if(", exp, ") {"];
1909
+ return [ws, "if(!(", exp, ")) {"];
1910
+ });
1911
+ function PostfixConditional(state) {
1912
+ if (state.verbose)
1913
+ console.log("ENTER:", "PostfixConditional");
1914
+ if (state.tokenize) {
1915
+ return $TOKEN("PostfixConditional", state, PostfixConditional$0(state));
1916
+ } else {
1917
+ return PostfixConditional$0(state);
1884
1918
  }
1885
1919
  }
1886
1920
  var Statement$0 = KeywordStatement;
@@ -1899,7 +1933,7 @@ var require_parser = __commonJS({
1899
1933
  return Statement$0(state) || Statement$1(state) || Statement$2(state) || Statement$3(state) || Statement$4(state) || Statement$5(state) || Statement$6(state) || Statement$7(state) || Statement$8(state);
1900
1934
  }
1901
1935
  }
1902
- var EmptyStatement$0 = $S($Q(TrailingComment), $Y($EXPECT($L85, fail, 'EmptyStatement ";"')));
1936
+ var EmptyStatement$0 = $S($Q(TrailingComment), $Y($EXPECT($L87, fail, 'EmptyStatement ";"')));
1903
1937
  function EmptyStatement(state) {
1904
1938
  if (state.verbose)
1905
1939
  console.log("ENTER:", "EmptyStatement");
@@ -1919,8 +1953,8 @@ var require_parser = __commonJS({
1919
1953
  return BlockStatement$0(state);
1920
1954
  }
1921
1955
  }
1922
- var IfStatement$0 = $S($EXPECT($L86, fail, 'IfStatement "if"'), Condition, Block, $E($S(__, $EXPECT($L87, fail, 'IfStatement "else"'), Block)));
1923
- var IfStatement$1 = $TS($S($EXPECT($L88, fail, 'IfStatement "unless"'), Condition, Block), function($skip, $loc, $0, $1, $2, $3) {
1956
+ var IfStatement$0 = $S($EXPECT($L85, fail, 'IfStatement "if"'), Condition, Block, $E($S(__, $EXPECT($L88, fail, 'IfStatement "else"'), Block)));
1957
+ var IfStatement$1 = $TS($S($EXPECT($L86, fail, 'IfStatement "unless"'), Condition, Block), function($skip, $loc, $0, $1, $2, $3) {
1924
1958
  var condition = $2;
1925
1959
  var block = $3;
1926
1960
  return ["if", condition.map((c) => {
@@ -1983,7 +2017,7 @@ var require_parser = __commonJS({
1983
2017
  return WhileStatement$0(state);
1984
2018
  }
1985
2019
  }
1986
- var ForStatement$0 = $S($EXPECT($L92, fail, 'ForStatement "for"'), __, $EXPECT($L1, fail, 'ForStatement "("'), __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, $EXPECT($L85, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L85, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L2, fail, 'ForStatement ")"'), Block);
2020
+ var ForStatement$0 = $S($EXPECT($L92, fail, 'ForStatement "for"'), __, $EXPECT($L1, fail, 'ForStatement "("'), __, $C(LexicalDeclaration, VariableStatement, $E(Expression)), __, $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L87, fail, 'ForStatement ";"'), __, $E(Expression), $EXPECT($L2, fail, 'ForStatement ")"'), Block);
1987
2021
  function ForStatement(state) {
1988
2022
  if (state.verbose)
1989
2023
  console.log("ENTER:", "ForStatement");
@@ -2704,7 +2738,7 @@ var require_parser = __commonJS({
2704
2738
  return __$0(state);
2705
2739
  }
2706
2740
  }
2707
- var StatementDelimiter$0 = $S($Q(TrailingComment), $EXPECT($L85, fail, 'StatementDelimiter ";"'), $Q(TrailingComment));
2741
+ var StatementDelimiter$0 = $S($Q(TrailingComment), $EXPECT($L87, fail, 'StatementDelimiter ";"'), $Q(TrailingComment));
2708
2742
  var StatementDelimiter$1 = $T($Y(EOS), function(value) {
2709
2743
  return [";", value];
2710
2744
  });
@@ -2949,7 +2983,7 @@ var require_parser = __commonJS({
2949
2983
  return InterfaceProperty$0(state);
2950
2984
  }
2951
2985
  }
2952
- var InterfacePropertyDelimiter$0 = $S($Q(_), $EXPECT($L85, fail, 'InterfacePropertyDelimiter ";"'));
2986
+ var InterfacePropertyDelimiter$0 = $S($Q(_), $EXPECT($L87, fail, 'InterfacePropertyDelimiter ";"'));
2953
2987
  var InterfacePropertyDelimiter$1 = $Y($S($Q(_), $EXPECT($L16, fail, 'InterfacePropertyDelimiter "}"')));
2954
2988
  var InterfacePropertyDelimiter$2 = $T($Y($S(__, $EXPECT($L16, fail, 'InterfacePropertyDelimiter "}"'))), function(value) {
2955
2989
  return ";";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@danielx/civet",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "CoffeeScript style syntax for TypeScript",
5
5
  "main": "dist/main.js",
6
6
  "bin": {