Class ErasedPlusTriviaNode
Preserves a unary + written before an expression (RD-VBAL §5.6.9.3): x = +1, Foo +x.
public sealed record ErasedPlusTriviaNode : SyntaxNode, IEquatable<SyntaxNode>, IEquatable<ErasedPlusTriviaNode>
- Inheritance
-
ErasedPlusTriviaNode
- Implements
- Inherited Members
- Extension Methods
Remarks
A unary + is no code. MS-VBAL's grammar has no unary +, and the VBE erases one from the code, whether it is typed or imported:
x = +1 is x = 1, and +"1" is the String "1". So no node of the syntax tree stands for it. The expression after it is the
node it would be without it, of its own type: Foo +x passes x by reference, and Set o = +obj assigns the object.
It is still source, kept as the module's trivia is, so that a formatter or an exporter can write the module back out as it was read, and a diagnostic can say where it is.
Constructors
ErasedPlusTriviaNode(SyntaxNodeId, SourceLocation)
Preserves a unary + written before an expression (RD-VBAL §5.6.9.3): x = +1, Foo +x.
public ErasedPlusTriviaNode(SyntaxNodeId Identity, SourceLocation SourceLocation)
Parameters
IdentitySyntaxNodeIdA unique identifier for this specific syntax node.
SourceLocationSourceLocationThe document location (
Uri+Range) of the+.
Remarks
A unary + is no code. MS-VBAL's grammar has no unary +, and the VBE erases one from the code, whether it is typed or imported:
x = +1 is x = 1, and +"1" is the String "1". So no node of the syntax tree stands for it. The expression after it is the
node it would be without it, of its own type: Foo +x passes x by reference, and Set o = +obj assigns the object.
It is still source, kept as the module's trivia is, so that a formatter or an exporter can write the module back out as it was read, and a diagnostic can say where it is.