From 08d4f3439ddfafff244ddd14a2c1a994f8d13745 Mon Sep 17 00:00:00 2001 From: Dustin Campbell Date: Wed, 29 Nov 2017 07:22:32 -0800 Subject: [PATCH] Change internal property name from IsScript to IsScriptCommandLineParser --- .../CommandLine/CSharpCommandLineParser.cs | 30 +++++++++---------- .../CommandLine/CommonCommandLineParser.cs | 10 +++---- .../VisualBasicCommandLineParser.vb | 26 ++++++++-------- 3 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/Compilers/CSharp/Portable/CommandLine/CSharpCommandLineParser.cs b/src/Compilers/CSharp/Portable/CommandLine/CSharpCommandLineParser.cs index 57051da0429..9ee2a94b2de 100644 --- a/src/Compilers/CSharp/Portable/CommandLine/CSharpCommandLineParser.cs +++ b/src/Compilers/CSharp/Portable/CommandLine/CSharpCommandLineParser.cs @@ -18,12 +18,12 @@ namespace Microsoft.CodeAnalysis.CSharp public class CSharpCommandLineParser : CommandLineParser { public static CSharpCommandLineParser Default { get; } = new CSharpCommandLineParser(); - public static CSharpCommandLineParser Script { get; } = new CSharpCommandLineParser(isScript: true); + public static CSharpCommandLineParser Script { get; } = new CSharpCommandLineParser(isScriptCommandLineParser: true); private readonly static char[] s_quoteOrEquals = new[] { '"', '=' }; - internal CSharpCommandLineParser(bool isScript = false) - : base(CSharp.MessageProvider.Instance, isScript) + internal CSharpCommandLineParser(bool isScriptCommandLineParser = false) + : base(CSharp.MessageProvider.Instance, isScriptCommandLineParser) { } @@ -47,8 +47,8 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas { List diagnostics = new List(); List flattenedArgs = new List(); - List scriptArgs = IsScript ? new List() : null; - List responsePaths = IsScript ? new List() : null; + List scriptArgs = IsScriptCommandLineParser ? new List() : null; + List responsePaths = IsScriptCommandLineParser ? new List() : null; FlattenArgs(args, diagnostics, flattenedArgs, scriptArgs, baseDirectory, responsePaths); string appConfigPath = null; @@ -65,7 +65,7 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas DebugInformationFormat debugInformationFormat = PathUtilities.IsUnixLikePlatform ? DebugInformationFormat.PortablePdb : DebugInformationFormat.Pdb; bool debugPlus = false; string pdbPath = null; - bool noStdLib = IsScript; // don't add mscorlib from sdk dir when running scripts + bool noStdLib = IsScriptCommandLineParser; // don't add mscorlib from sdk dir when running scripts string outputDirectory = baseDirectory; ImmutableArray> pathMap = ImmutableArray>.Empty; string outputFileName = null; @@ -129,7 +129,7 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas // Process ruleset files first so that diagnostic severity settings specified on the command line via // /nowarn and /warnaserror can override diagnostic severity settings specified in the ruleset file. - if (!IsScript) + if (!IsScriptCommandLineParser) { foreach (string arg in flattenedArgs) { @@ -207,7 +207,7 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas #endif } - if (IsScript) + if (IsScriptCommandLineParser) { switch (name) { @@ -1193,7 +1193,7 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas AddDiagnostic(diagnostics, diagnosticOptions, ErrorCode.ERR_NoNetModuleOutputWhenRefOutOrRefOnly); } - if (!IsScript && !sourceFilesSpecified && (outputKind.IsNetModule() || !resourcesOrModulesSpecified)) + if (!IsScriptCommandLineParser && !sourceFilesSpecified && (outputKind.IsNetModule() || !resourcesOrModulesSpecified)) { AddDiagnostic(diagnostics, diagnosticOptions, ErrorCode.WRN_NoSources); } @@ -1261,7 +1261,7 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas languageVersion: languageVersion, preprocessorSymbols: defines.ToImmutableAndFree(), documentationMode: parseDocumentationComments ? DocumentationMode.Diagnose : DocumentationMode.None, - kind: IsScript ? SourceCodeKind.Script : SourceCodeKind.Regular, + kind: IsScriptCommandLineParser ? SourceCodeKind.Script : SourceCodeKind.Regular, features: parsedFeatures ); @@ -1318,8 +1318,8 @@ public new CSharpCommandLineArguments Parse(IEnumerable args, string bas return new CSharpCommandLineArguments { - IsScriptRunner = IsScript, - InteractiveMode = interactiveMode || IsScript && sourceFiles.Count == 0, + IsScriptRunner = IsScriptCommandLineParser, + InteractiveMode = interactiveMode || IsScriptCommandLineParser && sourceFiles.Count == 0, BaseDirectory = baseDirectory, PathMap = pathMap, Errors = diagnostics.AsImmutable(), @@ -1432,7 +1432,7 @@ private static string GetWin32Setting(string arg, string value, List // names from the files containing their entrypoints and libraries derive their names from // their first input files. - if (!IsScript && !sourceFilesSpecified) + if (!IsScriptCommandLineParser && !sourceFilesSpecified) { AddDiagnostic(diagnostics, ErrorCode.ERR_OutputNeedsName); simpleName = null; @@ -1466,7 +1466,7 @@ private static string GetWin32Setting(string arg, string value, List if (outputKind.IsNetModule()) { - Debug.Assert(!IsScript); + Debug.Assert(!IsScriptCommandLineParser); compilationName = moduleAssemblyName; } @@ -1508,7 +1508,7 @@ private ImmutableArray BuildSearchPaths(string sdkDirectoryOpt, List ParseFileArgument(string arg, string baseDirectory, IList errors) { - Debug.Assert(IsScript || !arg.StartsWith("-", StringComparison.Ordinal) && !arg.StartsWith("@", StringComparison.Ordinal)); + Debug.Assert(IsScriptCommandLineParser || !arg.StartsWith("-", StringComparison.Ordinal) && !arg.StartsWith("@", StringComparison.Ordinal)); // We remove all doubles quotes from a file name. So that, for example: // "Path With Spaces"\goo.cs diff --git a/src/Compilers/VisualBasic/Portable/CommandLine/VisualBasicCommandLineParser.vb b/src/Compilers/VisualBasic/Portable/CommandLine/VisualBasicCommandLineParser.vb index 4af5bba8f4e..8e42021a01b 100644 --- a/src/Compilers/VisualBasic/Portable/CommandLine/VisualBasicCommandLineParser.vb +++ b/src/Compilers/VisualBasic/Portable/CommandLine/VisualBasicCommandLineParser.vb @@ -25,14 +25,14 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ''' ''' Gets the current interactive command line parser. ''' - Public Shared ReadOnly Property Script As New VisualBasicCommandLineParser(isScript:=True) + Public Shared ReadOnly Property Script As New VisualBasicCommandLineParser(isScriptCommandLineParser:=True) ''' ''' Creates a new command line parser. ''' - ''' An optional parameter indicating whether to create a interactive command line parser. - Friend Sub New(Optional isScript As Boolean = False) - MyBase.New(VisualBasic.MessageProvider.Instance, isScript) + ''' An optional parameter indicating whether to create a interactive command line parser. + Friend Sub New(Optional isScriptCommandLineParser As Boolean = False) + MyBase.New(VisualBasic.MessageProvider.Instance, isScriptCommandLineParser) End Sub Private Const s_win32Manifest As String = "win32manifest" @@ -76,7 +76,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic Dim diagnostics As List(Of Diagnostic) = New List(Of Diagnostic)() Dim flattenedArgs As List(Of String) = New List(Of String)() - Dim scriptArgs As List(Of String) = If(IsScript, New List(Of String)(), Nothing) + Dim scriptArgs As List(Of String) = If(IsScriptCommandLineParser, New List(Of String)(), Nothing) ' normalized paths to directories containing response files: Dim responsePaths As New List(Of String) @@ -163,7 +163,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic ' Process ruleset files first so that diagnostic severity settings specified on the command line via ' /nowarn and /warnaserror can override diagnostic severity settings specified in the ruleset file. - If Not IsScript Then + If Not IsScriptCommandLineParser Then For Each arg In flattenedArgs Dim name As String = Nothing Dim value As String = Nothing @@ -418,7 +418,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic #End If End Select - If IsScript Then + If IsScriptCommandLineParser Then Select Case name Case "i", "i+" If value IsNot Nothing Then @@ -1205,7 +1205,7 @@ lVbRuntimePlus: AddDiagnostic(diagnostics, ERRID.ERR_NoNetModuleOutputWhenRefOutOrRefOnly) End If - If Not IsScript AndAlso Not hasSourceFiles AndAlso managedResources.IsEmpty() Then + If Not IsScriptCommandLineParser AndAlso Not hasSourceFiles AndAlso managedResources.IsEmpty() Then ' VB displays help when there is nothing specified on the command line If flattenedArgs.Any Then AddDiagnostic(diagnostics, ERRID.ERR_NoSources) @@ -1300,7 +1300,7 @@ lVbRuntimePlus: Dim compilationName As String = Nothing GetCompilationAndModuleNames(diagnostics, outputKind, sourceFiles, moduleAssemblyName, outputFileName, moduleName, compilationName) - If Not IsScript AndAlso + If Not IsScriptCommandLineParser AndAlso Not hasSourceFiles AndAlso Not managedResources.IsEmpty() AndAlso outputFileName = Nothing AndAlso @@ -1312,7 +1312,7 @@ lVbRuntimePlus: Dim parseOptions = New VisualBasicParseOptions( languageVersion:=languageVersion, documentationMode:=If(parseDocumentationComments, DocumentationMode.Diagnose, DocumentationMode.None), - kind:=If(IsScript, SourceCodeKind.Script, SourceCodeKind.Regular), + kind:=If(IsScriptCommandLineParser, SourceCodeKind.Script, SourceCodeKind.Regular), preprocessorSymbols:=AddPredefinedPreprocessorSymbols(outputKind, defines.AsImmutableOrEmpty()), features:=parsedFeatures) @@ -1369,11 +1369,11 @@ lVbRuntimePlus: ' Enable interactive mode if either `\i` option is passed in or no arguments are specified (`vbi`, `vbi script.vbx \i`). ' If the script is passed without the `\i` option simply execute the script (`vbi script.vbx`). - interactiveMode = interactiveMode Or (IsScript AndAlso sourceFiles.Count = 0) + interactiveMode = interactiveMode Or (IsScriptCommandLineParser AndAlso sourceFiles.Count = 0) Return New VisualBasicCommandLineArguments With { - .IsScriptRunner = IsScript, + .IsScriptRunner = IsScriptCommandLineParser, .InteractiveMode = interactiveMode, .BaseDirectory = baseDirectory, .Errors = diagnostics.AsImmutable(), @@ -2240,7 +2240,7 @@ lVbRuntimePlus: End If If kind.IsNetModule() Then - Debug.Assert(Not IsScript) + Debug.Assert(Not IsScriptCommandLineParser) compilationName = moduleAssemblyName Else -- GitLab