'\$*"""(?s:.*?)(?:"""|\z)', 'class' => 'string'], // 逐語的文字列 @"…"(""でエスケープ、複数行可)、$@"…"、@$"…" ['re' => '(?:\$@|@\$|@)"(?:[^"]|"")*"?', 'class' => 'string'], // 補間文字列 $"…" ['re' => '\$"(?:[^"\\\\\n]|\\\\.)*"?', 'class' => 'string'], ]; protected array $tokens = [ 'keyword' => [ 'abstract', 'as', 'base', 'break', 'case', 'catch', 'checked', 'class', 'const', 'continue', 'default', 'delegate', 'do', 'else', 'enum', 'event', 'explicit', 'extern', 'finally', 'fixed', 'for', 'foreach', 'goto', 'if', 'implicit', 'in', 'interface', 'internal', 'is', 'lock', 'namespace', 'new', 'operator', 'out', 'override', 'params', 'private', 'protected', 'public', 'readonly', 'ref', 'return', 'sealed', 'sizeof', 'stackalloc', 'static', 'struct', 'switch', 'this', 'throw', 'try', 'typeof', 'unchecked', 'unsafe', 'using', 'virtual', 'volatile', 'while', // 文脈依存(「value」「select」「file」等、変数名によく使う単語は除く) 'alias', 'and', 'async', 'await', 'get', 'global', 'init', 'managed', 'nameof', 'not', 'notnull', 'or', 'partial', 'record', 'required', 'scoped', 'set', 'unmanaged', 'var', 'when', 'where', 'with', 'yield', ], 'constant' => [ 'true', 'false', 'null', ], 'type' => [ 'bool', 'byte', 'sbyte', 'char', 'decimal', 'double', 'float', 'int', 'uint', 'nint', 'nuint', 'long', 'ulong', 'short', 'ushort', 'object', 'string', 'void', 'dynamic', 'Boolean', 'Byte', 'SByte', 'Char', 'Decimal', 'Double', 'Single', 'Int16', 'Int32', 'Int64', 'Int128', 'UInt16', 'UInt32', 'UInt64', 'IntPtr', 'UIntPtr', 'Half', 'Object', 'String', 'Guid', 'DateTime', 'TimeSpan', 'Span', 'ReadOnlySpan', 'Memory', 'ReadOnlyMemory', 'List', 'Dictionary', 'HashSet', 'Queue', 'Stack', 'LinkedList', 'SortedList', 'SortedDictionary', 'Array', 'Tuple', 'ValueTuple', 'IEnumerable', 'IEnumerator', 'ICollection', 'IList', 'IDictionary', 'IReadOnlyList', 'IDisposable', 'IComparable', 'IEquatable', 'Task', 'ValueTask', 'Action', 'Func', 'Predicate', 'EventHandler', 'Exception', 'ArgumentException', 'ArgumentNullException', 'InvalidOperationException', 'NotImplementedException', 'Console', 'Math', 'MathF', 'Convert', 'Enumerable', 'StringBuilder', 'Thread', 'CancellationToken', 'Stream', 'File', 'Path', 'Directory', 'Random', 'Vector2', 'Vector3', 'Vector4', 'Matrix4x4', 'Quaternion', ], ]; }