コード例 #1
0
ファイル: AssertHelpers.cs プロジェクト: chenzuo/nquery
		public static void AreEqual(CompilationError[] expectedCompilationErrors, CompilationErrorCollection actualCompilationErrors)
		{
			if (expectedCompilationErrors == null && actualCompilationErrors != null)
				Assert.Fail("No errors expected, but errors occured during query execution.\r\nActual errors:\r\n\r\n{0}", GetErrors(actualCompilationErrors));

			if (expectedCompilationErrors != null && actualCompilationErrors == null)
				Assert.Fail("Expected errors, but no errors occured during query execution.\r\nExpected errors:\r\n\r\n{0}", GetErrors(expectedCompilationErrors));

			try
			{
				if (expectedCompilationErrors == null)
					return;

				Assert.AreEqual(expectedCompilationErrors.Length, actualCompilationErrors.Count);

				for (int i = 0; i < expectedCompilationErrors.Length; i++)
				{
					Assert.AreEqual(expectedCompilationErrors[i].Id, actualCompilationErrors[i].Id, "Error message {0} of {1} is different", i + 1, expectedCompilationErrors.Length);
					Assert.AreEqual(expectedCompilationErrors[i].Text, actualCompilationErrors[i].Text, "Error message {0} of {1} is different", i + 1, expectedCompilationErrors.Length);
				}
			}
			catch (AssertFailedException ex)
			{
				string msg = String.Format("Expected query errors do not match actual query errors. See inner exception for first mismatch.\r\nActual errors:\r\n\r\n{0}\r\nExpected errors:\r\n\r\n{1}", GetErrors(actualCompilationErrors), GetErrors(expectedCompilationErrors));
				throw new Exception(msg, ex);
			}
		}
コード例 #2
0
ファイル: Output.cs プロジェクト: YannikB/PawnPlus
        private void outBox_DoubleClick(object sender, EventArgs e)
        {
            SendKeys.Send("{HOME}+{END}");
            SendKeys.Flush();

            int lineIndex = this.outBox.GetLineFromCharIndex(this.outBox.SelectionStart);

            if (lineIndex < Workspace.Compilation.Result.Errors.Count)
            {
                CompilationError error = Workspace.Compilation.Result.Errors[lineIndex];

                if (File.Exists(error.FilePath) == true)
                {
                    Workspace.OpenFile(error.FilePath, true);
                }

                Workspace.SetActiveEditor(error.FilePath, true);

                // Focus on the error line.
                int line = error.Line;

                Workspace.CurrentEditor.TextEditor.ScrollToLine(line);
                Workspace.CurrentEditor.TextEditor.TextArea.Caret.Line = line;
                Workspace.CurrentEditor.TextEditor.TextArea.Caret.BringCaretToView();
                Workspace.CurrentEditor.TextEditor.TextArea.Caret.Show();
            }
        }
コード例 #3
0
 private void GotoError(CompilationError compilationError)
 {
     if (compilationError.SourceRange != SourceRange.None)
     {
         TextRange offsetAndLength = _actiproLink.GetTextRange(compilationError.SourceRange);
         syntaxEditor.SelectedView.Selection.SelectRange(offsetAndLength.StartOffset, offsetAndLength.Length);
         syntaxEditor.Focus();
     }
 }
コード例 #4
0
 private void errorListView_DoubleClick(object sender, EventArgs e)
 {
     if (errorsListView.FocusedItem != null)
     {
         CompilationError compilationError = errorsListView.FocusedItem.Tag as CompilationError;
         if (compilationError != null)
         {
             GotoError(compilationError);
         }
     }
 }
コード例 #5
0
 internal static void Internal_OnCompileEvent(string message, string file, int line, bool isError)
 {
     if (isError)
     {
         CompilationError?.Invoke(message, file, line);
     }
     else
     {
         CompilationWarning?.Invoke(message, file, line);
     }
 }
コード例 #6
0
        public void TestSyntaxErrorExtraParensFunc()
        {
            string condition = "as_number(\"2\")) = 24";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new HashSet <Endpoint>());
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error: unmatched closing ')'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 15), new ErrorPosition(1, 16)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #7
0
        public void TestArgumentError()
        {
            string condition = "as_number(true) = true";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new HashSet <Endpoint>());
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Invalid arguments to built-in function 'as_number': as_number(bool)", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 10)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #8
0
        public void TestSyntaxErrorMissingParens()
        {
            string condition = "(2 + 22 = 24";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new HashSet <Endpoint>());
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(1, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error: missing closing ')'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 2)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #9
0
        public void TestSyntaxErrorExtraParens()
        {
            string condition = "(2 + 22 )) = 24";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error: unmatched closing ')'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 10), new ErrorPosition(1, 11)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #10
0
        public static TestDefinition FromXml(XmlDocument xmlDocument)
        {
            TestDefinition result = new TestDefinition();

            result.CommandText = xmlDocument.SelectSingleNode("/test/sql").InnerText;

            XmlNode expectedRuntimeErrorNode = xmlDocument.SelectSingleNode("/test/expectedRuntimeError");

            if (expectedRuntimeErrorNode != null)
            {
                result.ExpectedRuntimeError = expectedRuntimeErrorNode.InnerText;
            }

            XmlNode expectedErrorsNode = xmlDocument.SelectSingleNode("/test/expectedErrors");

            if (expectedErrorsNode != null)
            {
                List <CompilationError> errorList = new List <CompilationError>();
                foreach (XmlNode expectedErrorNode in expectedErrorsNode.SelectNodes("expectedError"))
                {
                    ErrorId          errorId          = (ErrorId)Enum.Parse(typeof(ErrorId), expectedErrorNode.Attributes["id"].Value);
                    string           errorText        = expectedErrorNode.Attributes["text"].Value;
                    CompilationError compilationError = new CompilationError(SourceRange.Empty, errorId, errorText);
                    errorList.Add(compilationError);
                }

                result.ExpectedCompilationErrors = errorList.ToArray();
            }

            XmlNode expectedResultsNode = xmlDocument.SelectSingleNode("/test/expectedResults");

            if (expectedResultsNode != null)
            {
                using (StringReader stringReader = new StringReader(expectedResultsNode.InnerXml))
                {
                    DataSet dataSet = new DataSet();
                    dataSet.ReadXml(stringReader);
                    result.ExpectedResults = dataSet.Tables[0];
                }
            }

            XmlNode expectedPlanNode = xmlDocument.SelectSingleNode("/test/expectedPlan");

            if (expectedPlanNode != null)
            {
                result.ExpectedPlan = ShowPlan.FromXml(expectedPlanNode);
            }

            return(result);
        }
コード例 #11
0
        public void TestSyntaxErrorUnterminatedString()
        {
            string condition = "\"2 = 24";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(1, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error: unterminated string", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 8)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #12
0
        public void TestSyntaxErrorUnrecognizedSymbol()
        {
            string condition = "3 = @ 3";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error: invalid symbol '@'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 5), new ErrorPosition(1, 6)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #13
0
        public void TestOperandError()
        {
            string condition = "3 + '4' = 7";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Invalid operands to binary operator '+': have 'number' and 'string', expected 'number' and 'number'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 3), new ErrorPosition(1, 4)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #14
0
        public void TestInvalidBuiltinError()
        {
            string condition = "nope(true) = true";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(2, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Invalid built-in function 'nope'", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 5)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #15
0
        public void TestSyntaxErrorMissingParensFunc()
        {
            string condition = "as_number(\"2\" = 24";
            var    route     = new Route("id", condition, "hub", TelemetryMessageSource.Instance, new Mock <Endpoint>("id1").Object, 0, 0);
            var    exception = Assert.Throws <RouteCompilationException>(() => RouteCompiler.Instance.Compile(route));

            Assert.Equal(1, exception.Errors.Count);

            CompilationError error1 = exception.Errors.First();

            Assert.Equal("Syntax error.", error1.Message);
            Assert.Equal(new ErrorRange(new ErrorPosition(1, 19), new ErrorPosition(1, 20)), error1.Location);
            Assert.Equal(ErrorSeverity.Error, error1.Severity);
        }
コード例 #16
0
        public void SmokeTest()
        {
            var start = new ErrorPosition(2, 2);
            var end   = new ErrorPosition(2, 3);
            var range = new ErrorRange(start, end);
            var error = new CompilationError(ErrorSeverity.Warning, "message", range);

            Assert.Equal("message", error.Message);
            Assert.Equal(ErrorSeverity.Warning, error.Severity);
            Assert.Equal(new ErrorPosition(2, 2), error.Location.Start);
            Assert.Equal(new ErrorPosition(2, 3), error.Location.End);

            Assert.Throws <ArgumentException>(() => new CompilationError(ErrorSeverity.Error, "message", new ErrorRange(end, start)));
        }
コード例 #17
0
        private LexicalItem BuildLexicalItem(Token token, CompilationError error)
        {
            if (error == null)
            {
                return(new LexicalItem()
                {
                    Token = token, Error = null
                });
            }

            return(new LexicalItem()
            {
                Error = error
            });
        }
コード例 #18
0
        public ShaderProgram BuildShaderProgram(string[] shaderNames)
        {
            ReloadShaders();
            ShaderProgram output = new ShaderProgram(shaderNames);

            if (output.HasCompilationError)
            {
                infoLog.Clear();
                infoLog.Append(output.InfoLog);
                CompilationError?.Invoke(this, EventArgs.Empty);
                return(null);
            }
            else
            {
                CompilationSuccess?.Invoke(this, EventArgs.Empty);
                return(output);
            }
        }
コード例 #19
0
ファイル: TestDefinition.cs プロジェクト: chenzuo/nquery
		public static TestDefinition FromXml(XmlDocument xmlDocument)
		{
			TestDefinition result = new TestDefinition();
			result.CommandText = xmlDocument.SelectSingleNode("/test/sql").InnerText;

			XmlNode expectedRuntimeErrorNode = xmlDocument.SelectSingleNode("/test/expectedRuntimeError");
			if (expectedRuntimeErrorNode != null)
				result.ExpectedRuntimeError = expectedRuntimeErrorNode.InnerText;

			XmlNode expectedErrorsNode = xmlDocument.SelectSingleNode("/test/expectedErrors");
			if (expectedErrorsNode != null)
			{
				List<CompilationError> errorList = new List<CompilationError>();
				foreach (XmlNode expectedErrorNode in expectedErrorsNode.SelectNodes("expectedError"))
				{
					ErrorId errorId = (ErrorId) Enum.Parse(typeof(ErrorId), expectedErrorNode.Attributes["id"].Value);
					string errorText = expectedErrorNode.Attributes["text"].Value;
					CompilationError compilationError = new CompilationError(SourceRange.Empty, errorId, errorText);
					errorList.Add(compilationError);
				}

				result.ExpectedCompilationErrors = errorList.ToArray();
			}

			XmlNode expectedResultsNode = xmlDocument.SelectSingleNode("/test/expectedResults");

			if (expectedResultsNode != null)
			{
				using (StringReader stringReader = new StringReader(expectedResultsNode.InnerXml))
				{
					DataSet dataSet = new DataSet();
					dataSet.ReadXml(stringReader);
					result.ExpectedResults = dataSet.Tables[0];
				}
			}

			XmlNode expectedPlanNode = xmlDocument.SelectSingleNode("/test/expectedPlan");
			if (expectedPlanNode != null)
			{
				result.ExpectedPlan = ShowPlan.FromXml(expectedPlanNode);
			}

			return result;
		}
コード例 #20
0
        public void TestEquals()
        {
            var error1 = new CompilationError(ErrorSeverity.Error, "message", new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 2)));
            var error2 = new CompilationError(ErrorSeverity.Error, "message", new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 2)));
            var error3 = new CompilationError(ErrorSeverity.Warning, "message", new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 2)));
            var error4 = new CompilationError(ErrorSeverity.Error, "different", new ErrorRange(new ErrorPosition(1, 1), new ErrorPosition(1, 2)));
            var error5 = new CompilationError(ErrorSeverity.Error, "message", new ErrorRange(new ErrorPosition(1, 2), new ErrorPosition(1, 3)));

            Assert.Equal(error1, error2);
            Assert.NotEqual(error1, error3);
            Assert.NotEqual(error1, error4);
            Assert.NotEqual(error1, error5);
            Assert.Equal(error1.GetHashCode(), error2.GetHashCode());
            Assert.NotEqual(error1.GetHashCode(), error3.GetHashCode());

            // ReSharper disable once EqualExpressionComparison
            Assert.True(error1.Equals(error1));
            Assert.False(error1.Equals(null));
            Assert.False(error1.Equals(new object()));
        }
コード例 #21
0
        public override async Task MapReaderData(OracleDataReader reader, CancellationToken cancellationToken)
        {
            while (await reader.ReadAsynchronous(cancellationToken))
            {
                var error =
                    new CompilationError
                {
                    Owner      = _owner,
                    ObjectName = _objectName,
                    ObjectType = (string)reader["TYPE"],
                    Line       = Convert.ToInt32(reader["LINE"]) - 1,
                    Column     = Convert.ToInt32(reader["POSITION"]),
                    Message    = (string)reader["TEXT"],
                    Severity   = (string)reader["ATTRIBUTE"],
                    Code       = Convert.ToInt32(reader["MESSAGE_NUMBER"]),
                    Statement  = _statement
                };

                _errors.Add(error);
            }
        }
コード例 #22
0
        void Error(IToken offendingSymbol, string message)
        {
            // A couple things to note about the start and end column range:
            //     1. line and column numbers are zero based from the lexer but one based for our API
            //     2. error ranges are start inclusive but end exclusive [start, end).
            string input = offendingSymbol.InputStream.ToString();

            string[] lines = input.Split(new[] { "\n", "\r\n" }, StringSplitOptions.None);

            int line        = offendingSymbol.Line;
            int column      = offendingSymbol.Column + 1;
            int tokenLength = offendingSymbol.Text.Length;
            int lineLength  = lines[line - 1].Length;

            var start = new ErrorPosition(line, column);

            // Set the end column to the minimum of column + token length or line length + 2 (one based and exclusive end column, see note above)
            int endColumn = Math.Min(column + tokenLength, lineLength + 2);
            var end       = new ErrorPosition(line, endColumn);
            var error     = new CompilationError(ErrorSeverity.Error, message, new ErrorRange(start, end));

            this.errors.Add(error);
        }
コード例 #23
0
 public virtual Parser HandleParseError(Parser parser, CompilationError<ParseError> error)
 {
     return parser;
 }
コード例 #24
0
ファイル: RootTokenizer.cs プロジェクト: lunchtimemama/Stinky
 public Parser OnError(Parser parser, CompilationError<ParseError> error)
 {
     return compilationContext.HandleParseError(parser, error);
 }
コード例 #25
0
ファイル: RootTokenizer.cs プロジェクト: lunchtimemama/Stinky
 public Tokenizer OnError(Tokenizer tokenizer, CompilationError<TokenizationError> error)
 {
     return compilationContext.HandleTokenError(tokenizer, error);
 }
コード例 #26
0
 public CompilationErrorEventArgs(CompilationError Error)
 {
     this.error = Error;
 }
コード例 #27
0
ファイル: ParseResult.cs プロジェクト: ajayn1986/Basic-Lang
 public ParseResult(Node node, CompilationError error)
 {
     Node  = node;
     Error = error;
 }
コード例 #28
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
        protected Parser ParseInterpolatedStringLiteral(Func<IEnumerable<Source>> interpolatedExpressions,
														Region region,
														CompilationError<ParseError> error)
        {
            return ParseToken(
                nextParser => nextParser.ParseInterpolatedStringLiteral(interpolatedExpressions, region, error),
                error);
        }
コード例 #29
0
 public override Parser HandleParseError(Parser parser, CompilationError<ParseError> error)
 {
     return ParentContext.HandleParseError(parser, error);
 }
コード例 #30
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 protected Parser ParsePlus(Location location, CompilationError<ParseError> error)
 {
     return ParseToken(nextParser => nextParser.ParsePlus(location, error), error);
 }
コード例 #31
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 protected Parser ParseNumberLiteral(Func<double> number, Region region, CompilationError<ParseError> error)
 {
     return ParseToken(nextParser => nextParser.ParseNumberLiteral(number, region, error), error);
 }
コード例 #32
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 protected Parser ParseForwardSlash(Location location, CompilationError<ParseError> error)
 {
     return ParseToken(nextParser => nextParser.ParseForwardSlash(location, error), error);
 }
コード例 #33
0
 public virtual void HandleSyntaxError(CompilationError<SyntaxError> error)
 {
 }
コード例 #34
0
        private void ImportTestDefinition()
        {
            if (openTestDefinitionFileDialog.ShowDialog() == DialogResult.OK)
            {
                Text = String.Format("NQuery - [{0}]", Path.GetFileName(openTestDefinitionFileDialog.FileName));
                saveTestDefinitionFileDialog.FileName = openTestDefinitionFileDialog.FileName;

                string query;
                List <CompilationError> errorList = new List <CompilationError>();
                string   runtimeError             = null;
                DataSet  dataSet  = null;
                ShowPlan showPlan = null;

                #region XML Handling

                XmlDocument xmlDocument = new XmlDocument();
                xmlDocument.Load(openTestDefinitionFileDialog.FileName);

                query = xmlDocument.SelectSingleNode("/test/sql").InnerText;

                XmlNode expectedRuntimeErrorNode = xmlDocument.SelectSingleNode("/test/expectedRuntimeError");
                if (expectedRuntimeErrorNode != null)
                {
                    runtimeError = expectedRuntimeErrorNode.InnerText;
                }

                XmlNode expectedErrorsNode = xmlDocument.SelectSingleNode("/test/expectedErrors");
                if (expectedErrorsNode != null)
                {
                    foreach (XmlNode expectedErrorNode in expectedErrorsNode.SelectNodes("expectedError"))
                    {
                        ErrorId          errorId          = (ErrorId)Enum.Parse(typeof(ErrorId), expectedErrorNode.Attributes["id"].Value);
                        string           errorText        = expectedErrorNode.Attributes["text"].Value;
                        CompilationError compilationError = new CompilationError(SourceRange.Empty, errorId, errorText);
                        errorList.Add(compilationError);
                    }
                }

                XmlNode expectedResultsNode = xmlDocument.SelectSingleNode("/test/expectedResults");
                if (expectedResultsNode != null)
                {
                    dataSet = new DataSet();
                    using (StringReader stringReader = new StringReader(expectedResultsNode.InnerXml))
                    {
                        dataSet.ReadXml(stringReader);
                    }
                }

                XmlNode expectedPlanNode = xmlDocument.SelectSingleNode("/test/expectedPlan");
                if (expectedPlanNode != null)
                {
                    showPlan = ShowPlan.FromXml(expectedPlanNode);
                }

                #endregion

                ClearErrors();
                resultsDataGridView.DataSource = null;
                showPlanControl.ShowPlan       = null;

                syntaxEditor.Text = query;
                if (runtimeError != null)
                {
                    LoadErrors(runtimeError);
                }
                LoadErrors(errorList);
                if (dataSet != null)
                {
                    LoadResults(dataSet.Tables[0]);
                }
                if (showPlan != null)
                {
                    showPlanControl.ShowPlan = showPlan;
                }
            }
        }
コード例 #35
0
 public virtual Tokenizer HandleTokenError(Tokenizer tokenizer, CompilationError<TokenizationError> error)
 {
     return tokenizer;
 }
コード例 #36
0
ファイル: SubTokenizer.cs プロジェクト: lunchtimemama/Stinky
 protected Tokenizer OnError(CompilationError<TokenizationError> error)
 {
     return RootTokenizer.OnError(this, error);
 }
コード例 #37
0
ファイル: MnemonicsProvider.cs プロジェクト: Lopla/Language
 public void AddError(CompilationError e)
 {
     Errors.Add(e);
 }
コード例 #38
0
 public override Tokenizer HandleTokenError(Tokenizer tokenizer, CompilationError<TokenizationError> error)
 {
     if(error.Error == TokenizationError.UnexpectedRightCurlyBracket) {
         interpolationTokenizer.endColumn = error.Location.Column;
         interpolationTokenizer.justUninterpolated = true;
         tokenizer.OnDone();
         return interpolationTokenizer;
     } else {
         return ParentContext.HandleTokenError(tokenizer, error);
     }
 }
コード例 #39
0
 public override void HandleSyntaxError(CompilationError<SyntaxError> error)
 {
     ParentContext.HandleSyntaxError (error);
 }
コード例 #40
0
ファイル: Node.Bound.cs プロジェクト: RYetisir/XSharpPublic
 internal TypeSymbol ThrowError(CompilationError e)
 {
     throw e;
 }
コード例 #41
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 protected Parser ParseStringLiteral(Func<string> @string, Region region, CompilationError<ParseError> error)
 {
     return ParseToken(nextParser => nextParser.ParseStringLiteral(@string, region, error), error);
 }
コード例 #42
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 protected Parser ParseIdentifier(Func<string> identifier, Region region, CompilationError<ParseError> error)
 {
     return ParseToken(nextParser => nextParser.ParseStringLiteral(identifier, region, error), error);
 }
コード例 #43
0
ファイル: BaseParser.cs プロジェクト: lunchtimemama/Stinky
 Parser ParseToken(Func<BaseParser, Parser> nextParser, CompilationError<ParseError> error)
 {
     if(NextParser != null) {
         return nextParser(NextParser);
     } else {
         return ErrorConsumer(this, error);
     }
 }
コード例 #44
0
 public InterpreterResult(dynamic result, CompilationError error)
 {
     Result = result;
     Error  = error;
 }