コード例 #1
0
ファイル: Limits.cs プロジェクト: vokenet/CommonLibrary.NET
        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);
        }
コード例 #2
0
ファイル: Limits.cs プロジェクト: vokenet/CommonLibrary.NET
        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);
        }