summaryrefslogtreecommitdiff
path: root/tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php
diff options
context:
space:
mode:
authorJesusaves <cpntb1@ymail.com>2021-01-07 17:33:07 -0300
committerJesusaves <cpntb1@ymail.com>2021-01-07 17:33:07 -0300
commit662279e8b2cb79a03864f84fdf799f0489fdfc7b (patch)
treee7104bc31f901d16c8597cae26aa31ccb20364ab /tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php
parent174d11705a13bd780dbb5c908f786fc65a6c2f9c (diff)
downloadhercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.gz
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.bz2
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.tar.xz
hercules-662279e8b2cb79a03864f84fdf799f0489fdfc7b.zip
Partial upgrade to v2020.01.12
Diffstat (limited to 'tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php')
-rw-r--r--tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php70
1 files changed, 70 insertions, 0 deletions
diff --git a/tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php b/tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php
new file mode 100644
index 000000000..3a667c7f6
--- /dev/null
+++ b/tools/php-sqllint/src/phpsqllint/Renderer/Emacs.php
@@ -0,0 +1,70 @@
+<?php
+/**
+ * Part of php-sqllint
+ *
+ * PHP version 5
+ *
+ * @category Tools
+ * @package PHP-SQLlint
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://cweiske.de/php-sqllint.htm
+ */
+namespace phpsqllint;
+
+/**
+ * Output for emacs' compilation mode
+ *
+ * @category Tools
+ * @package PHP-SQLlint
+ * @author Christian Weiske <cweiske@cweiske.de>
+ * @license http://www.gnu.org/licenses/agpl.html GNU AGPL v3
+ * @link http://www.emacswiki.org/emacs/CreatingYourOwnCompileErrorRegexp
+ */
+class Renderer_Emacs implements Renderer
+{
+ protected $filename;
+
+ /**
+ * Begin syntax check output rendering
+ *
+ * @param string $filename Path to the SQL file
+ *
+ * @return void
+ */
+ public function startRendering($filename)
+ {
+ $this->filename = $filename;
+ }
+
+ /**
+ * Output errors in GNU style; see emacs compilation.txt
+ *
+ * @param string $msg Error message
+ * @param string $token Character which caused the error
+ * @param integer $line Line at which the error occured
+ * @param integer $col Column at which the error occured
+ *
+ * @return void
+ */
+ public function displayError($msg, $token, $line, $col)
+ {
+ echo $this->filename
+ . ':' . $line
+ . '.' . $col
+ . ':Error:'
+ . ' '. $msg
+ . "\n";
+ }
+
+ /**
+ * Finish syntax check output rendering; no syntax errors found
+ *
+ * @return void
+ */
+ public function finishOk()
+ {
+ //do nothing
+ }
+}
+?>