Windows-powershell / PowerShell-master /src /System.Management.Automation /engine /lang /interface /PSParseError.cs
Download PowerShell-master/src/System.Management.Automation/engine/lang/interface/PSParseError.cs from MegaBites-AI/Windows-powershell: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/src/System.Management.Automation/engine/lang/interface/PSParseError.cs
- Command line
-
hf download hf://datasets/MegaBites-AI/Windows-powershell/PowerShell-master/src/System.Management.Automation/engine/lang/interface/PSParseError.cs
-
curl -L -o PSParseError.cs https://huggingface.co/datasets/MegaBites-AI/Windows-powershell/resolve/main/PowerShell-master/src/System.Management.Automation/engine/lang/interface/PSParseError.cs
1.57 kB
| // Copyright (c) Microsoft Corporation. | |
| // Licensed under the MIT License. | |
| /********************************************************************++ | |
| Project: PowerShell | |
| Contents: PowerShell error interface for syntax editors | |
| Classes: System.Management.Automation.PSParseError | |
| --********************************************************************/ | |
| using Dbg = System.Management.Automation.Diagnostics; | |
| namespace System.Management.Automation | |
| { | |
| /// <summary> | |
| /// This is a class that represents a syntax error from parsing. | |
| /// </summary> | |
| public sealed class PSParseError | |
| { | |
| internal PSParseError(RuntimeException rte) | |
| { | |
| Dbg.Assert(rte != null, "exception argument should not be null"); | |
| Dbg.Assert(rte.ErrorToken != null, "token for exception should not be null"); | |
| Message = rte.Message; | |
| Token = new PSToken(rte.ErrorToken); | |
| } | |
| internal PSParseError(Language.ParseError error) | |
| { | |
| Message = error.Message; | |
| Token = new PSToken(error.Extent); | |
| } | |
| /// <summary> | |
| /// The token that indicates the error location. | |
| /// </summary> | |
| /// <remarks> | |
| /// This can either be the real token at which place the error happens or a position | |
| /// token indicating the location where error happens. | |
| /// </remarks> | |
| public PSToken Token { get; } | |
| /// <summary> | |
| /// Error message. | |
| /// </summary> | |
| public string Message { get; } | |
| } | |
| } | |