mirror of
https://github.com/icsharpcode/ILSpy.git
synced 2026-10-12 11:09:54 +00:00
The C# syntax tree's name accessors (ParameterDeclaration.Name, GotoStatement.Label, catch variable, query continuations, ...) are convenience strings over a backing Identifier token. Names that may be absent are now typed string? and read as null when absent, instead of a non-null empty-string sentinel; required names stay non-null string. The backing token slot's nullability follows, and an empty or null assignment clears the token (empty == absent). Because the property type now carries optionality, the separate [NameSlot] attribute and its nullOnEmpty flag are redundant: a [Slot] on a string property is a name (child slots are AstNode-typed, so the type disambiguates), and the generator infers optionality from the declared nullable annotation -- which a string? declaration already requires #nullable for. The repeated empty-to-null setter body becomes Identifier.CreateIfNotEmpty. To make the annotation readable, #nullable enable is turned on across the syntax node files (the directive the inferred optionality depends on), with the attendant local nullability fixups. Consumers that feed a name into a non-null slot assert it where the variable structurally has a name. Assisted-by: Claude:claude-opus-4-8:Claude Code
39 lines
1.5 KiB
C#
39 lines
1.5 KiB
C#
//
|
|
// ContinueStatement.cs
|
|
//
|
|
// Author:
|
|
// Mike Krüger <[email protected]>
|
|
//
|
|
// Copyright (c) 2009 Novell, Inc (http://www.novell.com)
|
|
//
|
|
// Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
// of this software and associated documentation files (the "Software"), to deal
|
|
// in the Software without restriction, including without limitation the rights
|
|
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
// copies of the Software, and to permit persons to whom the Software is
|
|
// furnished to do so, subject to the following conditions:
|
|
//
|
|
// The above copyright notice and this permission notice shall be included in
|
|
// all copies or substantial portions of the Software.
|
|
//
|
|
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
// THE SOFTWARE.
|
|
|
|
#nullable enable
|
|
|
|
namespace ICSharpCode.Decompiler.CSharp.Syntax
|
|
{
|
|
/// <summary>
|
|
/// <c>continue_statement ::= 'continue' ';'</c> (C# grammar §13.10.3)
|
|
/// </summary>
|
|
[DecompilerAstNode]
|
|
public sealed partial class ContinueStatement : Statement
|
|
{
|
|
}
|
|
}
|