Example #1
0
        private LangLimitException BuildLimitExceptionFromToken(TokenData token, string error, int limit = -1)
        {
            if (limit != -1)
                error = "Limit for : " + error + " reached at " + limit;

            string script = "";
            int lineNumber = 0;
            int charPos = 0;
            if (token != null)
            {
                lineNumber = token.Line;
                charPos = token.LineCharPos;
            }
            var ex = new LangLimitException(error, script, lineNumber);
            ex.Error.Column = charPos;
            return ex;
        }
Example #2
0
        private LangLimitException BuildLimitException(AstNode node, string error, int limit = -1)
        {
            if (limit != -1)
                error = "Limit for : " + error + " reached at " + limit;

            string script = "";
            int lineNumber = 0;
            int charPos = 0;
            if (node != null && node.Ref != null)
            {
                script = node.Ref.ScriptName;
                lineNumber = node.Ref.Line;
                charPos = node.Ref.CharPos;
            }
            var ex = new LangLimitException(error, script, lineNumber);
            ex.Error.Column = charPos;
            return ex;
        }