IronPython.Compiler.Ast.PythonNameBinder.ReportSyntaxError C# (CSharp) Method

ReportSyntaxError() private method

private ReportSyntaxError ( string message, Node node ) : void
message string
node Node
return void
        internal void ReportSyntaxError(string message, Node node) {
            // TODO: Change the error code (-1)
            _context.Errors.Add(_context.SourceUnit, message, node.Span, -1, Severity.FatalError);
            throw PythonOps.SyntaxError(message, _context.SourceUnit, node.Span, -1);
        }

Usage Example

Esempio n. 1
0
 private void Verify(PythonNameBinder binder)
 {
     if (ContainsImportStar)
     {
         binder.ReportSyntaxWarning("import * only allowed at module level", this);
     }
     if (ContainsImportStar && IsClosure)
     {
         binder.ReportSyntaxError(
             String.Format(
                 System.Globalization.CultureInfo.InvariantCulture,
                 "import * is not allowed in function '{0}' because it is a nested function",
                 Name),
             this);
     }
     if (ContainsImportStar && Parent is FunctionDefinition)
     {
         binder.ReportSyntaxError(
             String.Format(
                 System.Globalization.CultureInfo.InvariantCulture,
                 "import * is not allowed in function '{0}' because it is a nested function",
                 Name),
             this);
     }
     if (ContainsImportStar && ContainsNestedFreeVariables)
     {
         binder.ReportSyntaxError(
             String.Format(
                 System.Globalization.CultureInfo.InvariantCulture,
                 "import * is not allowed in function '{0}' because it contains a nested function with free variables",
                 Name),
             this);
     }
     if (ContainsUnqualifiedExec && ContainsNestedFreeVariables)
     {
         binder.ReportSyntaxError(
             String.Format(
                 System.Globalization.CultureInfo.InvariantCulture,
                 "unqualified exec is not allowed in function '{0}' because it contains a nested function with free variables",
                 Name),
             this);
     }
     if (ContainsUnqualifiedExec && IsClosure)
     {
         binder.ReportSyntaxError(
             String.Format(
                 System.Globalization.CultureInfo.InvariantCulture,
                 "unqualified exec is not allowed in function '{0}' because it is a nested function",
                 Name),
             this);
     }
 }
All Usage Examples Of IronPython.Compiler.Ast.PythonNameBinder::ReportSyntaxError