Prexonite, a .NET hosted scripting language with a focus on meta-programming and embedded DSLs
0

Configure Feed

Select the types of activity you want to include in your feed.

remove redundant attributes

authored by

Christian Klauser and committed by
Christian Klauser
(Dec 11, 2023, 10:42 PM +0100) 2be38894 5bbe6542

+22 -49
+2 -2
Prexonite/Compiler/AST/AstExpr.cs
··· 5 5 6 6 public abstract class AstExpr : AstNode 7 7 { 8 - protected AstExpr([JetBrains.Annotations.NotNull] ISourcePosition position) 8 + protected AstExpr(ISourcePosition position) 9 9 : base(position) 10 10 { 11 11 } 12 12 13 - internal AstExpr([JetBrains.Annotations.NotNull] Parser p) 13 + internal AstExpr(Parser p) 14 14 : base(p) 15 15 { 16 16 }
+3 -4
Prexonite/Compiler/Build/ISelfAssemblingPlan.cs
··· 21 21 /// </summary> 22 22 /// <para>Behavior is not defined if the search path is being modified while this build plan is 23 23 /// assembling modules.</para> 24 - [NotNull, PublicAPI] 24 + [PublicAPI] 25 25 IList<string> SearchPaths { get; } 26 26 27 27 /// <summary> ··· 33 33 /// instructions</param> 34 34 /// <param name="token">The cancellation token for this asynchronous operation.</param> 35 35 /// <returns>A task that represents the build plan assembly in progress.</returns> 36 - [NotNull, PublicAPI] 36 + [PublicAPI] 37 37 Task<ITargetDescription> AssembleAsync(ISource source, CancellationToken token = default); 38 38 39 39 /// <summary> 40 40 /// The set of standard library modules to implicitly link against. Can be suppressed on a per-module basis via the <see cref="Module.NoStandardLibraryKey"/> tag. 41 41 /// </summary> 42 - [NotNull, PublicAPI] 42 + [PublicAPI] 43 43 ISet<ModuleName> StandardLibrary { get; } 44 44 45 45 /// <summary> ··· 50 50 /// <param name="source">The source text to read. Must be a module.</param> 51 51 /// <param name="token"></param> 52 52 /// <returns>A description of the supplied module. Its dependencies might not be satisfied at this point.</returns> 53 - [NotNull] 54 53 Task<ITargetDescription> RegisterModule(ISource source, CancellationToken token = default); 55 54 }
+2 -9
Prexonite/Compiler/Build/Internal/SelfAssemblingPlan.cs
··· 45 45 { 46 46 static readonly TraceSource _trace = Plan.Trace; 47 47 48 - [NotNull] 49 48 readonly AdHocTaskCache<string, PreflightResult> _preflightCache = new(); 50 49 51 - [NotNull] 52 50 readonly AdHocTaskCache<string, ITargetDescription> _targetCreationCache = new(); 53 51 54 52 public IList<string> SearchPaths { get; } = new ThreadSafeList<string>(); ··· 154 152 public ISet<ModuleName> StandardLibrary => _standardLibrary; 155 153 156 154 157 - [NotNull] 158 155 Task<PreflightResult> _orderPreflight(RefSpec refSpec, CancellationToken token) 159 156 { 160 157 if (refSpec.ResolvedPath == null) ··· 171 168 }, token); 172 169 } 173 170 174 - [NotNull] 175 171 async Task<PreflightResult> _performPreflight(RefSpec refSpec, CancellationToken token) 176 172 // requires refSpec.Source != null 177 173 // ensures result != null ··· 250 246 } 251 247 } 252 248 253 - static FileInfo? _getPath([NotNull] ISource source) 249 + static FileInfo? _getPath(ISource source) 254 250 { 255 251 return source is FileSource fileSource ? fileSource.File : null; 256 252 } 257 253 258 - [NotNull] 259 254 static readonly Regex _fileReferencePattern = new(@"^([/.]|[a-zA-Z]:)"); 260 255 261 256 static RefSpec _parseRefSpec(MetaEntry entry) ··· 282 277 } 283 278 } 284 279 285 - [NotNull] 286 - async Task<RefSpec> _resolveRefSpec([NotNull] RefSpec refSpec, CancellationToken token, SelfAssemblyMode mode) 280 + async Task<RefSpec> _resolveRefSpec(RefSpec refSpec, CancellationToken token, SelfAssemblyMode mode) 287 281 // requires refSpec.ModuleName != null || refSpec.Source != null || refSpec.rawPath != null || refSpec.ResolvedPath != null 288 282 // ensures result == refSpec && (TargetDescriptions.Contains(result) || refSpec.ErrorMessage != null) 289 283 { ··· 526 520 { 527 521 public volatile ModuleName? ModuleName; 528 522 529 - [NotNull] 530 523 public readonly List<RefSpec> References = new(); 531 524 532 525 public volatile string? ErrorMessage;
+1 -4
Prexonite/Compiler/DeclarationScope.cs
··· 11 11 [DebuggerDisplay("declaration scope {ToString()}")] 12 12 public class DeclarationScope 13 13 { 14 - [NotNull] 15 14 public Namespace Namespace => _LocalNamespace; 16 15 17 - [NotNull] 18 16 internal LocalNamespace _LocalNamespace { get; } 19 17 20 18 public QualifiedId PathPrefix { get; } ··· 22 20 /// <summary> 23 21 /// Symbol store for symbols local to the scope (private, not necessarily exported) 24 22 /// </summary> 25 - [NotNull] 26 23 public SymbolStore Store { get; } 27 24 28 - internal DeclarationScope([NotNull] LocalNamespace ns, QualifiedId pathPrefix, [NotNull] SymbolStore store) 25 + internal DeclarationScope(LocalNamespace ns, QualifiedId pathPrefix, SymbolStore store) 29 26 { 30 27 _LocalNamespace = ns ?? throw new ArgumentNullException(nameof(ns)); 31 28 PathPrefix = pathPrefix;
+3 -4
Prexonite/Compiler/ErrorMessageException.cs
··· 6 6 7 7 public class ErrorMessageException : PrexoniteException 8 8 { 9 - public ErrorMessageException([NotNull] Message compilerMessage) 9 + public ErrorMessageException(Message compilerMessage) 10 10 : base(compilerMessage.Text) 11 11 { 12 12 CompilerMessage = compilerMessage ?? throw new ArgumentNullException(nameof(compilerMessage)); 13 13 } 14 14 15 - public ErrorMessageException(string message, [NotNull] Message compilerMessage) : base(message) 15 + public ErrorMessageException(string message, Message compilerMessage) : base(message) 16 16 { 17 17 CompilerMessage = compilerMessage ?? throw new ArgumentNullException(nameof(compilerMessage)); 18 18 } 19 19 20 - public ErrorMessageException(string message, [NotNull] Message compilerMessage, Exception? innerException) : base(message, innerException) 20 + public ErrorMessageException(string message, Message compilerMessage, Exception? innerException) : base(message, innerException) 21 21 { 22 22 CompilerMessage = compilerMessage ?? throw new ArgumentNullException(nameof(compilerMessage)); 23 23 } 24 24 25 - [NotNull] 26 25 public Message CompilerMessage { get; } 27 26 }
+1 -2
Prexonite/Compiler/Internal/EntityRefMExprParser.cs
··· 7 7 8 8 static class EntityRefMExprParser 9 9 { 10 - [NotNull] 11 - public static EntityRef Parse([NotNull] MExpr expr) 10 + public static EntityRef Parse(MExpr expr) 12 11 { 13 12 // ReSharper disable TooWideLocalVariableScope 14 13 string internalId;
+2 -5
Prexonite/Compiler/LoaderOptions.cs
··· 44 44 ExternalSymbols = new EmptySymbolView<Symbol>(); 45 45 } 46 46 47 - public LoaderOptions([NotNull] Engine parentEngine, [NotNull] Application targetApplication, ISymbolView<Symbol>? externalSymbols) 47 + public LoaderOptions(Engine parentEngine, Application targetApplication, ISymbolView<Symbol>? externalSymbols) 48 48 { 49 49 ParentEngine = parentEngine ?? throw new ArgumentNullException(nameof(parentEngine)); 50 50 TargetApplication = targetApplication ?? throw new ArgumentNullException(nameof(targetApplication)); ··· 59 59 60 60 public Application? TargetApplication { get; } 61 61 62 - [NotNull] 63 62 public ISymbolView<Symbol> ExternalSymbols { get; } 64 63 65 64 bool? _registerCommands; ··· 140 139 set => _flagLiteralsEnabled = value; 141 140 } 142 141 143 - [CanBeNull] 144 142 string? _storeNewLine; 145 143 146 144 /// <summary> ··· 148 146 /// </summary> 149 147 /// <see cref="Loader.Store(System.Text.StringBuilder)"/> 150 148 [PublicAPI] 151 - [NotNull] 152 149 public string StoreNewLine 153 150 { 154 151 get => _storeNewLine ?? "\n"; ··· 164 161 165 162 #endregion 166 163 167 - public void InheritFrom([NotNull] LoaderOptions options) 164 + public void InheritFrom(LoaderOptions options) 168 165 { 169 166 if (options == null) 170 167 throw new ArgumentNullException(nameof(options));
+2 -4
Prexonite/Compiler/Symbolic/Internal/LocalNamespace.cs
··· 32 32 /// <param name="logicalName">The logical name to derive a physical name from.</param> 33 33 /// <returns>A physical name, related to the logical name provided.</returns> 34 34 /// <exception cref="InvalidOperationException"><see cref="Prefix"/> has not been assigned yet.</exception> 35 - [NotNull] 36 - public string DerivePhysicalName([NotNull] string logicalName) 35 + public string DerivePhysicalName(string logicalName) 37 36 { 38 37 if (logicalName == null) 39 38 throw new ArgumentNullException(nameof(logicalName)); ··· 54 53 /// <remarks> 55 54 /// <para>Use the <see cref="Namespace"/> interface to list all symbols included in this namespace, not just the ones defined in this module.</para> 56 55 /// </remarks> 57 - [NotNull] 58 56 public abstract IEnumerable<KeyValuePair<string, Symbol>> Exports { get; } 59 57 60 58 /// <summary> ··· 71 69 /// Adds a set of declarations to the exports of this namespace. Will replace conflicting symbols instead of merging with them. 72 70 /// </summary> 73 71 /// <param name="exportScope">The set of symbols to export.</param> 74 - public abstract void DeclareExports([NotNull] IEnumerable<KeyValuePair<string, Symbol>> exportScope); 72 + public abstract void DeclareExports(IEnumerable<KeyValuePair<string, Symbol>> exportScope); 75 73 76 74 #endregion 77 75
+3 -3
Prexonite/Compiler/Symbolic/NamespaceSymbol.cs
··· 17 17 return "namespace"; 18 18 } 19 19 20 - NamespaceSymbol([NotNull] ISourcePosition position, [NotNull] Namespace @namespace) 20 + NamespaceSymbol(ISourcePosition position, Namespace @namespace) 21 21 { 22 22 Position = position; 23 23 Namespace = @namespace; ··· 53 53 return Namespace.GetHashCode(); 54 54 } 55 55 56 - internal static NamespaceSymbol _Create([NotNull] Namespace @namespace, [NotNull] ISourcePosition position) 56 + internal static NamespaceSymbol _Create(Namespace @namespace, ISourcePosition position) 57 57 { 58 58 return new(position, @namespace); 59 59 } ··· 109 109 /// <param name="messageSink"></param> 110 110 /// <param name="errors">If non-null, collects instead of reports errors (other messages are reported directly); Otherwise errors are reported too.</param> 111 111 /// <returns>The namespace symbol or null if the symbol is not actually a namespace symbol (has already been reported as an error). If an error collection list (<paramref name="errors"/>) has been supplied, can be non-null when errors are present)</returns> 112 - public static NamespaceSymbol? UnwrapNamespaceSymbol([NotNull] Symbol symbol, [NotNull] ISourcePosition symbolPosition, 112 + public static NamespaceSymbol? UnwrapNamespaceSymbol(Symbol symbol, ISourcePosition symbolPosition, 113 113 IMessageSink? messageSink, IList<Message>? errors = null) 114 114 { 115 115 if (symbol == null)
-2
Prexonite/Compiler/Symbolic/SymbolStore.cs
··· 77 77 /// <param name="conflictUnionSource">A sequence of symbols, possibly from multiple stores, that the newly created store should provide a unified view of.</param> 78 78 /// <returns>A new symbol store.</returns> 79 79 [PublicAPI] 80 - [JetBrains.Annotations.NotNull] 81 80 public static SymbolStore Create(ISymbolView<Symbol>? parent = null, IEnumerable<SymbolInfo>? conflictUnionSource = null) 82 81 { 83 82 return new ConflictUnionFallbackStore(parent,conflictUnionSource); ··· 116 115 /// <summary> 117 116 /// Provides access to all local declarations of a symbol store (symbols that were declared via <see cref="Declare"/>). 118 117 /// </summary> 119 - [JetBrains.Annotations.NotNull] 120 118 public abstract IEnumerable<KeyValuePair<string, Symbol>> LocalDeclarations { get; } 121 119 122 120 //TODO (Ticket #108) Find a good place for the method CreateSymbolNotFoundError
+2 -8
Prexonite/Compiler/Symbolic/SymbolStoreBuilder.cs
··· 37 37 38 38 public abstract class SymbolStoreBuilder 39 39 { 40 - public abstract void Forward(SymbolOrigin sourceDescription, [JetBrains.Annotations.NotNull] ISymbolView<Symbol> source, [JetBrains.Annotations.NotNull] IEnumerable<SymbolTransferDirective> directives); 40 + public abstract void Forward(SymbolOrigin sourceDescription, ISymbolView<Symbol> source, IEnumerable<SymbolTransferDirective> directives); 41 41 public abstract SymbolStore ToSymbolStore(); 42 42 43 - [JetBrains.Annotations.NotNull] 44 43 public static SymbolStoreBuilder Create(ISymbolView<Symbol>? existingNamespace) 45 44 { 46 45 return new Impl{ ExistingNamespace = existingNamespace }; 47 46 } 48 47 49 - [JetBrains.Annotations.NotNull] 50 48 public static SymbolStoreBuilder Create() 51 49 { 52 50 return new Impl(); ··· 58 56 59 57 sealed class ImportStatement : List<SymbolTransferDirective> 60 58 { 61 - [JetBrains.Annotations.NotNull] 62 59 public ISymbolView<Symbol> Source { get; } 63 60 64 - [JetBrains.Annotations.NotNull] 65 61 public SymbolOrigin Origin { get; } 66 62 67 - public ImportStatement([JetBrains.Annotations.NotNull] ISymbolView<Symbol> source, [JetBrains.Annotations.NotNull] SymbolOrigin origin) 63 + public ImportStatement(ISymbolView<Symbol> source, SymbolOrigin origin) 68 64 { 69 65 Source = source ?? throw new ArgumentNullException(nameof(source)); 70 66 Origin = origin ?? throw new ArgumentNullException(nameof(origin)); ··· 103 99 { 104 100 public override ISymbolView<Symbol>? ExistingNamespace { get; set; } 105 101 106 - [JetBrains.Annotations.NotNull] 107 102 readonly ImportStatementSet _statements = new(); 108 103 109 104 public override void Forward(SymbolOrigin sourceDescription, ISymbolView<Symbol> source, ··· 169 164 // ReSharper restore ImplicitlyCapturedClosure 170 165 } 171 166 172 - [JetBrains.Annotations.NotNull] 173 167 static IEnumerable<SymbolInfo> _applyDirectivesWildcard(ImportStatement import, 174 168 IEnumerable<KeyValuePair<string, Symbol>> symbolSource, 175 169 HashSet<string> drops, Dictionary<string, List<string>> renames)
+1 -2
Prexonite/IIndirectCall.cs
··· 33 33 /// </para> 34 34 /// </remarks> 35 35 /// <returns>The result of the call. Should <strong>never</strong> be null.</returns> 36 - [NotNull] 37 - PValue IndirectCall([NotNull] StackContext sctx, [NotNull] PValue[] args); 36 + PValue IndirectCall(StackContext sctx, PValue[] args); 38 37 }