@magnusopera/fscript 0.77.0 → 0.78.1

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.
Files changed (85) hide show
  1. package/dist/FScript.Language/Ast.js +2 -2
  2. package/dist/FScript.Language/BuiltinFunctions.js +68 -67
  3. package/dist/FScript.Language/BuiltinSignatures.js +7 -7
  4. package/dist/FScript.Language/BuiltinTypes.js +3 -3
  5. package/dist/FScript.Language/Error.js +2 -2
  6. package/dist/FScript.Language/Eval.js +305 -213
  7. package/dist/FScript.Language/IncludeResolver.js +97 -79
  8. package/dist/FScript.Language/Interactive.js +149 -0
  9. package/dist/FScript.Language/Lexer.js +77 -77
  10. package/dist/FScript.Language/Parser.js +274 -272
  11. package/dist/FScript.Language/Pretty.js +4 -4
  12. package/dist/FScript.Language/Span.js +2 -2
  13. package/dist/FScript.Language/Token.js +59 -2
  14. package/dist/FScript.Language/TypeInfer.js +452 -348
  15. package/dist/FScript.Language/Types.js +22 -10
  16. package/dist/FScript.Language/Value.js +3 -2
  17. package/dist/Library.js +91 -79
  18. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Array.js +36 -35
  19. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Async.js +52 -23
  20. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/AsyncBuilder.js +23 -2
  21. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/BigInt.js +33 -32
  22. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/BitConverter.js +2 -2
  23. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/CHANGELOG.md +80 -1
  24. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Date.js +8 -15
  25. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/DateOffset.js +8 -17
  26. package/dist/fable_modules/fable-library-js.5.13.0/Directory.js +11 -0
  27. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Double.js +8 -2
  28. package/dist/fable_modules/fable-library-js.5.13.0/Environment.js +3 -0
  29. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Event.js +10 -1
  30. package/dist/fable_modules/fable-library-js.5.13.0/File.js +27 -0
  31. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/List.js +35 -21
  32. package/dist/fable_modules/fable-library-js.5.13.0/Long.js +38 -0
  33. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/MailboxProcessor.js +11 -5
  34. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Map.js +8 -4
  35. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/MutableMap.js +2 -2
  36. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/MutableSet.js +1 -1
  37. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Observable.js +5 -3
  38. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Option.js +1 -18
  39. package/dist/fable_modules/fable-library-js.5.13.0/Path.js +31 -0
  40. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Reflection.js +13 -3
  41. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/RegExp.js +53 -24
  42. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Seq.js +109 -22
  43. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Set.js +16 -3
  44. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/String.js +28 -1
  45. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/System.js +15 -9
  46. package/dist/fable_modules/fable-library-js.5.13.0/Task.js +27 -0
  47. package/dist/fable_modules/fable-library-js.5.13.0/TaskBuilder.js +72 -0
  48. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Types.js +12 -12
  49. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Util.js +15 -3
  50. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/package.json +1 -1
  51. package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/quotation.js +25 -8
  52. package/dist/fable_modules/project_cracked.json +1 -1
  53. package/package.json +1 -1
  54. package/dist/fable_modules/fable-library-js.5.2.0/Long.js +0 -47
  55. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Boolean.js +0 -0
  56. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Char.js +0 -0
  57. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Choice.js +0 -0
  58. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/CollectionUtil.js +0 -0
  59. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/ConditionalWeakTable.js +0 -0
  60. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/DateOnly.js +0 -0
  61. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Decimal.js +0 -0
  62. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Encoding.js +0 -0
  63. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/FSharp.Collections.js +0 -0
  64. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/FSharp.Core.CompilerServices.js +0 -0
  65. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/FSharp.Core.js +0 -0
  66. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Global.js +0 -0
  67. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Guid.js +0 -0
  68. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Int32.js +0 -0
  69. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/MapUtil.js +0 -0
  70. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Native.js +0 -0
  71. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Numeric.js +0 -0
  72. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/README.md +0 -0
  73. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Random.js +0 -0
  74. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Range.js +0 -0
  75. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Result.js +0 -0
  76. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Seq2.js +0 -0
  77. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/System.Collections.Generic.js +0 -0
  78. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/System.Text.js +0 -0
  79. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/TimeOnly.js +0 -0
  80. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/TimeSpan.js +0 -0
  81. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Timer.js +0 -0
  82. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Unicode.13.0.0.js +0 -0
  83. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/Uri.js +0 -0
  84. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/big.d.ts +0 -0
  85. /package/dist/fable_modules/{fable-library-js.5.2.0 → fable-library-js.5.13.0}/lib/big.js +0 -0
@@ -1,16 +1,16 @@
1
1
 
2
- import { isDigit, isLetterOrDigit, isLetter } from "../fable_modules/fable-library-js.5.2.0/Char.js";
3
- import { parse } from "../fable_modules/fable-library-js.5.2.0/Double.js";
2
+ import { isDigit, isLetterOrDigit, isLetter } from "../fable_modules/fable-library-js.5.13.0/Char.js";
3
+ import { parse } from "../fable_modules/fable-library-js.5.13.0/Double.js";
4
4
  import { Span, Position } from "./Span.js";
5
5
  import { Token, TokenKind } from "./Token.js";
6
- import { StringBuilder__Append_244C7CD6, StringBuilder_$ctor } from "../fable_modules/fable-library-js.5.2.0/System.Text.js";
6
+ import { StringBuilder__Append_244C7CD6, StringBuilder_$ctor } from "../fable_modules/fable-library-js.5.13.0/System.Text.js";
7
7
  import { ParseException, ParseError } from "./Error.js";
8
- import { toString } from "../fable_modules/fable-library-js.5.2.0/Types.js";
9
- import { printf, toText, substring } from "../fable_modules/fable-library-js.5.2.0/String.js";
10
- import { item } from "../fable_modules/fable-library-js.5.2.0/Array.js";
11
- import { toInt64_unchecked } from "../fable_modules/fable-library-js.5.2.0/BigInt.js";
12
- import { parse as parse_1 } from "../fable_modules/fable-library-js.5.2.0/Long.js";
13
- import { toList } from "../fable_modules/fable-library-js.5.2.0/Seq.js";
8
+ import { toString } from "../fable_modules/fable-library-js.5.13.0/Types.js";
9
+ import { printf, toText, substring } from "../fable_modules/fable-library-js.5.13.0/String.js";
10
+ import { item } from "../fable_modules/fable-library-js.5.13.0/Array.js";
11
+ import { toInt64_unchecked } from "../fable_modules/fable-library-js.5.13.0/BigInt.js";
12
+ import { parse as parse_1 } from "../fable_modules/fable-library-js.5.13.0/Long.js";
13
+ import { toList } from "../fable_modules/fable-library-js.5.13.0/Seq.js";
14
14
 
15
15
  function isIdentStart(c) {
16
16
  if (isLetter(c)) {
@@ -41,51 +41,51 @@ function mkSpan(sourceName, line, col, length) {
41
41
  function keywordToken(ident) {
42
42
  switch (ident) {
43
43
  case "let":
44
- return new TokenKind(10, []);
44
+ return TokenKind.Let;
45
45
  case "rec":
46
- return new TokenKind(11, []);
46
+ return TokenKind.Rec;
47
47
  case "and":
48
- return new TokenKind(12, []);
48
+ return TokenKind.And;
49
49
  case "type":
50
- return new TokenKind(45, []);
50
+ return TokenKind.Type;
51
51
  case "typeof":
52
- return new TokenKind(46, []);
52
+ return TokenKind.Typeof;
53
53
  case "nameof":
54
- return new TokenKind(47, []);
54
+ return TokenKind.Nameof;
55
55
  case "of":
56
- return new TokenKind(48, []);
56
+ return TokenKind.Of;
57
57
  case "fun":
58
- return new TokenKind(13, []);
58
+ return TokenKind.Fun;
59
59
  case "match":
60
- return new TokenKind(14, []);
60
+ return TokenKind.Match;
61
61
  case "with":
62
- return new TokenKind(15, []);
62
+ return TokenKind.With;
63
63
  case "when":
64
- return new TokenKind(16, []);
64
+ return TokenKind.When;
65
65
  case "if":
66
- return new TokenKind(17, []);
66
+ return TokenKind.If;
67
67
  case "then":
68
- return new TokenKind(18, []);
68
+ return TokenKind.Then;
69
69
  case "else":
70
- return new TokenKind(19, []);
70
+ return TokenKind.Else;
71
71
  case "elif":
72
- return new TokenKind(20, []);
72
+ return TokenKind.Elif;
73
73
  case "raise":
74
- return new TokenKind(21, []);
74
+ return TokenKind.Raise;
75
75
  case "for":
76
- return new TokenKind(22, []);
76
+ return TokenKind.For;
77
77
  case "import":
78
- return new TokenKind(39, []);
78
+ return TokenKind.Import;
79
79
  case "as":
80
- return new TokenKind(40, []);
80
+ return TokenKind.As;
81
81
  case "include":
82
- return new TokenKind(41, []);
82
+ return TokenKind.Include;
83
83
  case "module":
84
- return new TokenKind(42, []);
84
+ return TokenKind.Module;
85
85
  case "true":
86
- return new TokenKind(9, [true]);
86
+ return new TokenKind(/* BoolLit */ 9, [true]);
87
87
  case "false":
88
- return new TokenKind(9, [false]);
88
+ return new TokenKind(/* BoolLit */ 9, [false]);
89
89
  default:
90
90
  return undefined;
91
91
  }
@@ -292,7 +292,7 @@ export function tokenizeWithSourceName(sourceName, src) {
292
292
  cCol = ((cCol + 1) | 0);
293
293
  }
294
294
  if ((idx < src.length) && (src[idx] === "\n")) {
295
- addToken(new TokenKind(1, []), mkSpan(sourceName, line, col, 1), tokens);
295
+ addToken(TokenKind.Newline, mkSpan(sourceName, line, col, 1), tokens);
296
296
  i = ((idx + 1) | 0);
297
297
  line = ((line + 1) | 0);
298
298
  col = 1;
@@ -302,7 +302,7 @@ export function tokenizeWithSourceName(sourceName, src) {
302
302
  while ((i < src.length) && (src[i] !== "\n")) {
303
303
  i = ((i + 1) | 0);
304
304
  }
305
- addToken(new TokenKind(1, []), mkSpan(sourceName, line, col, 1), tokens);
305
+ addToken(TokenKind.Newline, mkSpan(sourceName, line, col, 1), tokens);
306
306
  if ((i < src.length) && (src[i] === "\n")) {
307
307
  i = ((i + 1) | 0);
308
308
  line = ((line + 1) | 0);
@@ -321,19 +321,19 @@ export function tokenizeWithSourceName(sourceName, src) {
321
321
  const current = item(indentStack.length - 1, indentStack) | 0;
322
322
  if (newIndent > current) {
323
323
  void (indentStack.push(newIndent));
324
- addToken(new TokenKind(2, []), span, tokens);
324
+ addToken(TokenKind.Indent, span, tokens);
325
325
  }
326
326
  else if (newIndent < current) {
327
327
  let j = indentStack.length - 1;
328
328
  while ((j > 0) && (item(j, indentStack) > newIndent)) {
329
329
  indentStack.splice(j, 1);
330
- addToken(new TokenKind(3, []), span, tokens);
330
+ addToken(TokenKind.Dedent, span, tokens);
331
331
  j = ((j - 1) | 0);
332
332
  }
333
333
  if (item(indentStack.length - 1, indentStack) !== newIndent) {
334
334
  if ((((parenDepth > 0) ? true : (bracketDepth > 0)) ? true : (braceDepth > 0)) && (item(indentStack.length - 1, indentStack) < newIndent)) {
335
335
  void (indentStack.push(newIndent));
336
- addToken(new TokenKind(2, []), span, tokens);
336
+ addToken(TokenKind.Indent, span, tokens);
337
337
  }
338
338
  else {
339
339
  throw new ParseException(new ParseError("Inconsistent indentation", span));
@@ -751,7 +751,7 @@ export function tokenizeWithSourceName(sourceName, src) {
751
751
  break;
752
752
  }
753
753
  case 2: {
754
- addToken(new TokenKind(1, []), mkSpan(sourceName, line, col, 1), tokens);
754
+ addToken(TokenKind.Newline, mkSpan(sourceName, line, col, 1), tokens);
755
755
  i = ((i + 1) | 0);
756
756
  line = ((line + 1) | 0);
757
757
  col = 1;
@@ -771,7 +771,7 @@ export function tokenizeWithSourceName(sourceName, src) {
771
771
  case 5: {
772
772
  const patternInput = readString(sourceName, src, i, line, col);
773
773
  const idx_1 = patternInput[1] | 0;
774
- addToken(new TokenKind(7, [patternInput[0]]), mkSpan(sourceName, line, col, idx_1 - i), tokens);
774
+ addToken(new TokenKind(/* StringLit */ 7, [patternInput[0]]), mkSpan(sourceName, line, col, idx_1 - i), tokens);
775
775
  i = (idx_1 | 0);
776
776
  line = (patternInput[2] | 0);
777
777
  col = (patternInput[3] | 0);
@@ -780,7 +780,7 @@ export function tokenizeWithSourceName(sourceName, src) {
780
780
  case 6: {
781
781
  const patternInput_1 = readInterpolatedRaw(sourceName, src, i, line, col);
782
782
  const idx_2 = patternInput_1[1] | 0;
783
- addToken(new TokenKind(8, [patternInput_1[0]]), mkSpan(sourceName, line, col, idx_2 - i), tokens);
783
+ addToken(new TokenKind(/* InterpString */ 8, [patternInput_1[0]]), mkSpan(sourceName, line, col, idx_2 - i), tokens);
784
784
  i = (idx_2 | 0);
785
785
  line = (patternInput_1[2] | 0);
786
786
  col = (patternInput_1[3] | 0);
@@ -803,10 +803,10 @@ export function tokenizeWithSourceName(sourceName, src) {
803
803
  const text = substring(src, start, idx_3 - start);
804
804
  const span_4 = mkSpan(sourceName, line, startCol, idx_3 - start);
805
805
  if (hasDot) {
806
- addToken(new TokenKind(6, [parseFloatLiteral(text)]), span_4, tokens);
806
+ addToken(new TokenKind(/* FloatLit */ 6, [parseFloatLiteral(text)]), span_4, tokens);
807
807
  }
808
808
  else {
809
- addToken(new TokenKind(5, [toInt64_unchecked(parse_1(text, 511, false, 64))]), span_4, tokens);
809
+ addToken(new TokenKind(/* IntLit */ 5, [toInt64_unchecked(parse_1(text, 511, false, 64))]), span_4, tokens);
810
810
  }
811
811
  i = (idx_3 | 0);
812
812
  col = ((startCol + (idx_3 - start)) | 0);
@@ -823,7 +823,7 @@ export function tokenizeWithSourceName(sourceName, src) {
823
823
  const span_5 = mkSpan(sourceName, line, startCol_1, idx_4 - start_1);
824
824
  const matchValue = keywordToken(ident);
825
825
  if (matchValue == null) {
826
- addToken(new TokenKind(4, [ident]), span_5, tokens);
826
+ addToken(new TokenKind(/* Ident */ 4, [ident]), span_5, tokens);
827
827
  }
828
828
  else {
829
829
  const k = matchValue;
@@ -843,37 +843,37 @@ export function tokenizeWithSourceName(sourceName, src) {
843
843
  break;
844
844
  }
845
845
  case 9: {
846
- addToken(new TokenKind(24, []), mkSpan(sourceName, line, col, 2), tokens);
846
+ addToken(TokenKind.Arrow, mkSpan(sourceName, line, col, 2), tokens);
847
847
  i = ((i + 2) | 0);
848
848
  col = ((col + 2) | 0);
849
849
  break;
850
850
  }
851
851
  case 10: {
852
- addToken(new TokenKind(61, []), mkSpan(sourceName, line, col, 2), tokens);
852
+ addToken(TokenKind.Cons, mkSpan(sourceName, line, col, 2), tokens);
853
853
  i = ((i + 2) | 0);
854
854
  col = ((col + 2) | 0);
855
855
  break;
856
856
  }
857
857
  case 11: {
858
- addToken(new TokenKind(56, []), mkSpan(sourceName, line, col, 2), tokens);
858
+ addToken(TokenKind.LessEqual, mkSpan(sourceName, line, col, 2), tokens);
859
859
  i = ((i + 2) | 0);
860
860
  col = ((col + 2) | 0);
861
861
  break;
862
862
  }
863
863
  case 12: {
864
- addToken(new TokenKind(57, []), mkSpan(sourceName, line, col, 2), tokens);
864
+ addToken(TokenKind.GreaterEqual, mkSpan(sourceName, line, col, 2), tokens);
865
865
  i = ((i + 2) | 0);
866
866
  col = ((col + 2) | 0);
867
867
  break;
868
868
  }
869
869
  case 13: {
870
- addToken(new TokenKind(58, []), mkSpan(sourceName, line, col, 2), tokens);
870
+ addToken(TokenKind.AndAnd, mkSpan(sourceName, line, col, 2), tokens);
871
871
  i = ((i + 2) | 0);
872
872
  col = ((col + 2) | 0);
873
873
  break;
874
874
  }
875
875
  case 14: {
876
- addToken(new TokenKind(32, []), mkSpan(sourceName, line, col, 2), tokens);
876
+ addToken(TokenKind.BarRBracket, mkSpan(sourceName, line, col, 2), tokens);
877
877
  if (bracketDepth > 0) {
878
878
  bracketDepth = ((bracketDepth - 1) | 0);
879
879
  }
@@ -882,87 +882,87 @@ export function tokenizeWithSourceName(sourceName, src) {
882
882
  break;
883
883
  }
884
884
  case 15: {
885
- addToken(new TokenKind(59, []), mkSpan(sourceName, line, col, 2), tokens);
885
+ addToken(TokenKind.OrOr, mkSpan(sourceName, line, col, 2), tokens);
886
886
  i = ((i + 2) | 0);
887
887
  col = ((col + 2) | 0);
888
888
  break;
889
889
  }
890
890
  case 16: {
891
- addToken(new TokenKind(60, []), mkSpan(sourceName, line, col, 2), tokens);
891
+ addToken(TokenKind.PipeForward, mkSpan(sourceName, line, col, 2), tokens);
892
892
  i = ((i + 2) | 0);
893
893
  col = ((col + 2) | 0);
894
894
  break;
895
895
  }
896
896
  case 17: {
897
- addToken(new TokenKind(49, []), mkSpan(sourceName, line, col, 1), tokens);
897
+ addToken(TokenKind.Plus, mkSpan(sourceName, line, col, 1), tokens);
898
898
  i = ((i + 1) | 0);
899
899
  col = ((col + 1) | 0);
900
900
  break;
901
901
  }
902
902
  case 18: {
903
- addToken(new TokenKind(50, []), mkSpan(sourceName, line, col, 1), tokens);
903
+ addToken(TokenKind.Minus, mkSpan(sourceName, line, col, 1), tokens);
904
904
  i = ((i + 1) | 0);
905
905
  col = ((col + 1) | 0);
906
906
  break;
907
907
  }
908
908
  case 19: {
909
- addToken(new TokenKind(51, []), mkSpan(sourceName, line, col, 1), tokens);
909
+ addToken(TokenKind.Star, mkSpan(sourceName, line, col, 1), tokens);
910
910
  i = ((i + 1) | 0);
911
911
  col = ((col + 1) | 0);
912
912
  break;
913
913
  }
914
914
  case 20: {
915
- addToken(new TokenKind(52, []), mkSpan(sourceName, line, col, 1), tokens);
915
+ addToken(TokenKind.Slash, mkSpan(sourceName, line, col, 1), tokens);
916
916
  i = ((i + 1) | 0);
917
917
  col = ((col + 1) | 0);
918
918
  break;
919
919
  }
920
920
  case 21: {
921
- addToken(new TokenKind(53, []), mkSpan(sourceName, line, col, 1), tokens);
921
+ addToken(TokenKind.Percent, mkSpan(sourceName, line, col, 1), tokens);
922
922
  i = ((i + 1) | 0);
923
923
  col = ((col + 1) | 0);
924
924
  break;
925
925
  }
926
926
  case 22: {
927
- addToken(new TokenKind(25, []), mkSpan(sourceName, line, col, 1), tokens);
927
+ addToken(TokenKind.Equals, mkSpan(sourceName, line, col, 1), tokens);
928
928
  inLetBindingHead = false;
929
929
  i = ((i + 1) | 0);
930
930
  col = ((col + 1) | 0);
931
931
  break;
932
932
  }
933
933
  case 23: {
934
- addToken(new TokenKind(54, []), mkSpan(sourceName, line, col, 1), tokens);
934
+ addToken(TokenKind.Less, mkSpan(sourceName, line, col, 1), tokens);
935
935
  i = ((i + 1) | 0);
936
936
  col = ((col + 1) | 0);
937
937
  break;
938
938
  }
939
939
  case 24: {
940
- addToken(new TokenKind(55, []), mkSpan(sourceName, line, col, 1), tokens);
940
+ addToken(TokenKind.Greater, mkSpan(sourceName, line, col, 1), tokens);
941
941
  i = ((i + 1) | 0);
942
942
  col = ((col + 1) | 0);
943
943
  break;
944
944
  }
945
945
  case 25: {
946
- addToken(new TokenKind(26, []), mkSpan(sourceName, line, col, 1), tokens);
946
+ addToken(TokenKind.Bar, mkSpan(sourceName, line, col, 1), tokens);
947
947
  i = ((i + 1) | 0);
948
948
  col = ((col + 1) | 0);
949
949
  break;
950
950
  }
951
951
  case 26: {
952
- addToken(new TokenKind(62, []), mkSpan(sourceName, line, col, 1), tokens);
952
+ addToken(TokenKind.Append, mkSpan(sourceName, line, col, 1), tokens);
953
953
  i = ((i + 1) | 0);
954
954
  col = ((col + 1) | 0);
955
955
  break;
956
956
  }
957
957
  case 27: {
958
- addToken(new TokenKind(27, []), mkSpan(sourceName, line, col, 1), tokens);
958
+ addToken(TokenKind.LParen, mkSpan(sourceName, line, col, 1), tokens);
959
959
  parenDepth = ((parenDepth + 1) | 0);
960
960
  i = ((i + 1) | 0);
961
961
  col = ((col + 1) | 0);
962
962
  break;
963
963
  }
964
964
  case 28: {
965
- addToken(new TokenKind(28, []), mkSpan(sourceName, line, col, 1), tokens);
965
+ addToken(TokenKind.RParen, mkSpan(sourceName, line, col, 1), tokens);
966
966
  if (parenDepth > 0) {
967
967
  parenDepth = ((parenDepth - 1) | 0);
968
968
  }
@@ -971,21 +971,21 @@ export function tokenizeWithSourceName(sourceName, src) {
971
971
  break;
972
972
  }
973
973
  case 29: {
974
- addToken(new TokenKind(31, []), mkSpan(sourceName, line, col, 2), tokens);
974
+ addToken(TokenKind.LBracketBar, mkSpan(sourceName, line, col, 2), tokens);
975
975
  bracketDepth = ((bracketDepth + 1) | 0);
976
976
  i = ((i + 2) | 0);
977
977
  col = ((col + 2) | 0);
978
978
  break;
979
979
  }
980
980
  case 30: {
981
- addToken(new TokenKind(29, []), mkSpan(sourceName, line, col, 1), tokens);
981
+ addToken(TokenKind.LBracket, mkSpan(sourceName, line, col, 1), tokens);
982
982
  bracketDepth = ((bracketDepth + 1) | 0);
983
983
  i = ((i + 1) | 0);
984
984
  col = ((col + 1) | 0);
985
985
  break;
986
986
  }
987
987
  case 31: {
988
- addToken(new TokenKind(30, []), mkSpan(sourceName, line, col, 1), tokens);
988
+ addToken(TokenKind.RBracket, mkSpan(sourceName, line, col, 1), tokens);
989
989
  if (bracketDepth > 0) {
990
990
  bracketDepth = ((bracketDepth - 1) | 0);
991
991
  }
@@ -994,50 +994,50 @@ export function tokenizeWithSourceName(sourceName, src) {
994
994
  break;
995
995
  }
996
996
  case 32: {
997
- addToken(new TokenKind(33, []), mkSpan(sourceName, line, col, 1), tokens);
997
+ addToken(TokenKind.Semicolon, mkSpan(sourceName, line, col, 1), tokens);
998
998
  i = ((i + 1) | 0);
999
999
  col = ((col + 1) | 0);
1000
1000
  break;
1001
1001
  }
1002
1002
  case 33: {
1003
- addToken(new TokenKind(34, []), mkSpan(sourceName, line, col, 1), tokens);
1003
+ addToken(TokenKind.Comma, mkSpan(sourceName, line, col, 1), tokens);
1004
1004
  i = ((i + 1) | 0);
1005
1005
  col = ((col + 1) | 0);
1006
1006
  break;
1007
1007
  }
1008
1008
  case 34: {
1009
- addToken(new TokenKind(35, []), mkSpan(sourceName, line, col, 1), tokens);
1009
+ addToken(TokenKind.Colon, mkSpan(sourceName, line, col, 1), tokens);
1010
1010
  i = ((i + 1) | 0);
1011
1011
  col = ((col + 1) | 0);
1012
1012
  break;
1013
1013
  }
1014
1014
  case 35: {
1015
- addToken(new TokenKind(37, []), mkSpan(sourceName, line, col, 2), tokens);
1015
+ addToken(TokenKind.RangeDots, mkSpan(sourceName, line, col, 2), tokens);
1016
1016
  i = ((i + 2) | 0);
1017
1017
  col = ((col + 2) | 0);
1018
1018
  break;
1019
1019
  }
1020
1020
  case 36: {
1021
- addToken(new TokenKind(36, []), mkSpan(sourceName, line, col, 1), tokens);
1021
+ addToken(TokenKind.Dot, mkSpan(sourceName, line, col, 1), tokens);
1022
1022
  i = ((i + 1) | 0);
1023
1023
  col = ((col + 1) | 0);
1024
1024
  break;
1025
1025
  }
1026
1026
  case 37: {
1027
- addToken(new TokenKind(38, []), mkSpan(sourceName, line, col, 1), tokens);
1027
+ addToken(TokenKind.Hash, mkSpan(sourceName, line, col, 1), tokens);
1028
1028
  i = ((i + 1) | 0);
1029
1029
  col = ((col + 1) | 0);
1030
1030
  break;
1031
1031
  }
1032
1032
  case 38: {
1033
- addToken(new TokenKind(43, []), mkSpan(sourceName, line, col, 1), tokens);
1033
+ addToken(TokenKind.LBrace, mkSpan(sourceName, line, col, 1), tokens);
1034
1034
  braceDepth = ((braceDepth + 1) | 0);
1035
1035
  i = ((i + 1) | 0);
1036
1036
  col = ((col + 1) | 0);
1037
1037
  break;
1038
1038
  }
1039
1039
  case 39: {
1040
- addToken(new TokenKind(44, []), mkSpan(sourceName, line, col, 1), tokens);
1040
+ addToken(TokenKind.RBrace, mkSpan(sourceName, line, col, 1), tokens);
1041
1041
  if (braceDepth > 0) {
1042
1042
  braceDepth = ((braceDepth - 1) | 0);
1043
1043
  }
@@ -1052,12 +1052,12 @@ export function tokenizeWithSourceName(sourceName, src) {
1052
1052
  }
1053
1053
  }
1054
1054
  }
1055
- addToken(new TokenKind(1, []), mkSpan(sourceName, line, col, 1), tokens);
1055
+ addToken(TokenKind.Newline, mkSpan(sourceName, line, col, 1), tokens);
1056
1056
  while (indentStack.length > 1) {
1057
1057
  indentStack.splice(indentStack.length - 1, 1);
1058
- addToken(new TokenKind(3, []), mkSpan(sourceName, line, col, 1), tokens);
1058
+ addToken(TokenKind.Dedent, mkSpan(sourceName, line, col, 1), tokens);
1059
1059
  }
1060
- addToken(new TokenKind(0, []), mkSpan(sourceName, line, col, 1), tokens);
1060
+ addToken(TokenKind.EOF, mkSpan(sourceName, line, col, 1), tokens);
1061
1061
  return toList(tokens);
1062
1062
  }
1063
1063