# All files / src/tokenizer/keyword index.js

100% Statements 7/7
100% Branches 0/0
100% Functions 0/0
100% Lines 7/7

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    28x
    28x
    28x

    28x

    28x

    28x
    28x

     // @flow
    import Trie from "../../utils/trie";
    import token from "../token";
    import Syntax from "../../Syntax";

    const supported = [
      // EcmaScript
      "break",
      "if",
      "else",
      "import",
      "from",
      "export",
      "return",
      "switch",
      "case",
      "default",
      "const",
      "let",
      "for",
      "continue",
      "do",
      "while",

      // walt replacement, matching s-expression syntax
      "function",

      // s-expression
      "global",
      "module",
      "type",
      "lambda",
    ];

    export const nosupport = [
      "catch",
      "extends",
      "super",
      // There is no concept of this in wast
      "this",
      "debugger",
      // vars and lets are replaced with types (i32, f32, etc)
      "var",
      // no classes in wast
      "class",
      "try",
      "catch",
      "finally",
      // Everything is statically typed
      "typeof",
    ];

    const trie = new Trie(supported);
    const root = trie.fsearch;

    export default token(root, Syntax.Keyword, supported);