module

Noir::CSharpDecl

The declarations of one C# source file, read off CSharpLexer's masked view: namespaces (block and file-scoped), types (class / struct / interface / record / enum, partial, generic, with their base list and primary-constructor parameters), and each type's members (methods, constructors with their : base(...) arguments, properties, fields), every one with its attributes as structured nodes.

Structure is read from the masked chars (strings and comments blanked), so a ], ,, ( or { inside a literal or comment never moves a boundary; every text the nodes carry comes from the comment-blanked code (CSharpLexer#code_source), so string literals keep their value.

Method bodies are not entered: a body is one span. One linear pass per nesting level, no file access.

Constants

LITERAL_RE = /\A"((?:[^"\\\n]|\\.)*)"\z/
MODIFIERS = Set {"public", "private", "protected", "internal", "static", "abstract", "sealed", "partial", "virtual", "override", "readonly", "new", "extern", "unsafe", "async", "volatile", "const", "required", "file", "fixed", "ref", "implicit", "explicit"}
PARAM_MODIFIERS = Set {"ref", "out", "in", "params", "this", "scoped", "readonly"}
TYPE_KEYWORDS = Set {"class", "struct", "interface", "enum", "record"}
VERBATIM_RE = /\A@"((?:[^"]|"")*)"\z/

Class methods

literal(text : String) : String | Nil
Source
simple_name(text : String) : String

global::A.B.Name<T>(args) -> Name.

Source

Nested types