public bool HasError() { try { Tech.QScript.Lexer.QLexer lex = new QScript.Lexer.QLexer(); var tokens = lex.LexFile(sourceCode).ToList(); Tech.QScript.Parser.QScriptParser parser = new QScript.Parser.QScriptParser(); Content = parser.ParseFile(sourceCode, tokens); if (parser.ErrorSink.ToList().Count > 0) { var sk = parser.ErrorSink.ToList(); for (int i = 0; i < parser.ErrorSink.ToList().Count; i++) { Error = Error + "\n" + sk[i].Message + "\n"; } return(true); } else { return(false); } } catch (Exception e) { Error = e.Message; return(true); } }
public bool HasError() { try { Tech.QScript.Lexer.QLexer lex = new QScript.Lexer.QLexer(); var tokens = lex.LexFile(sourceCode).ToList(); tokens = tokens.Where(x => x != null).ToList(); foreach (Token t in tokens) { if (t.Catagory != TokenCatagory.Declaration) { foreach (string key in _evp.getProperties()) { t.Value = t.Value.Replace(key, _evp.GetValue(key)); } } } Tech.QScript.Parser.QScriptParser parser = new QScript.Parser.QScriptParser(); Content = parser.ParseFile(sourceCode, tokens); if (parser.ErrorSink.ToList().Count > 0) { var sk = parser.ErrorSink.ToList(); for (int i = 0; i < parser.ErrorSink.ToList().Count; i++) { Error = Error + "\n" + sk[i].Message + "\n"; } return(true); } else { return(false); } } catch (Exception e) { Error = e.Message; return(true); } }