Esempio n. 1
0
        public static string GetLineAndCol(YVALUE v)
        {
            if (v == null)
            {
                return("Line:?,Col:?");
            }
            var line = v.get_dbg_line(true);
            var col  = v.get_dbg_col(true);
            var file = v.get_dbg_file();

            return(string.Format("Line:{0},Col:{1} in {2}", line, col, file));
        }
Esempio n. 2
0
        internal static void error(string s, YVALUE v = null)
        {
            int line = -1;

            if (v != null)
            {
                line = v.get_dbg_line(true);
            }

            string es = "ERROR" + (line >= 0 ? "(L:" + line.ToString() + ")" : "") + ":" + s;

            conWriteLine(es);

            throw new SystemException(es);
        }
Esempio n. 3
0
        public static string RuntimeErrorInfo()
        {
            if (current_v == null)
            {
                return(null);
            }

            var    fid  = current_v.dbg_file_id;
            string file = null;

            try {
                file = m_slag.m_filelist.GetFile(fid); //     _slag!=null &&  fid>=0 && m_slag.m_idlist.Length > fid ? m_slag.m_idlist[fid] : "";
            }
            catch { file = null; }

            string s = null;

            s += "Error at line:" + (current_v.get_dbg_line(true)) + " in File:" + file + NL + RuntimeSyncInfo();

            return(s);
        }