
      </rule>
      <rule pattern="!=|==|&lt;&lt;|&gt;&gt;|[-+/*%=&lt;&gt;]">
        <token type="Operator"/>
      </rule>
      <rule pattern="(compile_intrinsic|compile_error|continue|recover|return|repeat|lambda|elseif|object|#share|match|#send|#read|ifdef|until|embed|while|where|error|break|with|else|#any|this|then|tag|for|trn|try|ref|use|var|val|let|end|iso|box|in|if|do)\b">
        <token type="Keyword"/>
      </rule>
      <rule pattern="(actor|class|struct|primitive|interface|trait|type)((?:\s)+)">
        <bygroups>
          <token type="Keyword"/>
          <token type="Text"/>
        </bygroups>
        <push state="typename"/>
      </rule>
      <rule pattern="(new|fun|be)((?:\s)+)">
        <bygroups>
          <token type="Keyword"/>
          <token type="Text"/>
        </bygroups>
        <push state="methodname"/>
      </rule>
      <rule pattern="(DisposableActor|NullablePointer|AsioEventNotify|UnsignedInteger|RuntimeOptions|DoNotOptimise|FloatingPoint|SignedInteger|ReadElement|ArrayValues|StringBytes|StringRunes|InputNotify|InputStream|AsioEventID|ByteSeqIter|AmbientAuth|Comparable|ArrayPairs|Stringable|OutStream|SourceLoc|ArrayKeys|StdStream|Equatable|AsioEvent|Iterator|Platform|Unsigned|Greater|Compare|Integer|Pointer|ReadSeq|ByteSeq|String|Number|Signed|Float|USize|Stdin|ILong|ISize|HasEq|Array|ULong|Equal|I128|U128|Bool|Less|Real|None|Seq|I64|Any|F32|F64|U64|U32|I32|Int|I16|U16|Env|I8|U8)\b">
        <token type="KeywordType"/>
      </rule>
      <rule pattern="_?[A-Z]\w*">
        <token type="NameClass"/>
      </rule>
      <rule pattern="string\(\)">
        <token type="NameOther"/>
      </rule>
      <rule pattern="(\d+\.\d*|\.\d+|\d+)[eE][+-]?\d+">
        <token type="LiteralNumberFloat"/>
      </rule>
      <rule pattern="0x[0-9a-fA-F]+">
        <token type="LiteralNumberHex"/>
      </rule>
      <rule pattern="\d+">
        <token type="LiteralNumberInteger"/>
      </rule>
      <rule pattern="(true|false)\b">
        <token type="Keyword"/>
      </rule>
      <rule pattern="_\d*">
        <token type="Name"/>
      </rule>
      <rule pattern="_?[a-z][\w\&#39;_]*">
        <token type="Name"/>
      </rule>
    </state>
    <state name="typename">
      <rule pattern="(iso|trn|ref|val|box|tag)?((?:\s)*)(_?[A-Z]\w*)">
        <bygroups>
          <token type="Keyword"/>
          <token type="Text"/>
          <token type="NameClass"/>
        </bygroups>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="methodname">
      <rule pattern="(iso|trn|ref|val|box|tag)?((?:\s)*)(_?[a-z]\w*)">
        <bygroups>
          <token type="Keyword"/>
          <token type="Text"/>
          <token type="NameFunction"/>
        </bygroups>
        <pop depth="1"/>
      </rule>
    </state>
    <state name="nested_comment">
      <rule pattern="[^*/]+">
        <token type="CommentMultiline"/>
      </rule>
      <rule pattern="/\*">
        <token type="CommentMultiline"/>
        <push/>
      </rule>
      <rule pattern="\*/">
        <token type="CommentMultiline"/>
        <pop depth="1"/>
      </rule>
      <rule pattern="[*/]">
        <token type="CommentMultiline"/>
      </rule>
    </state>
  </rules>
</lexer>