added eugtk examples
This commit is contained in:
41
eugtk/examples/resources/geany_syntax/README.html
Normal file
41
eugtk/examples/resources/geany_syntax/README.html
Normal file
@@ -0,0 +1,41 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<title>Eu Syntax files</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
|
||||
<hr />
|
||||
<h3>Euphoria Syntax for Geany</h3>
|
||||
<hr />
|
||||
|
||||
<img src="compileflag.jpg" alt="Geany" />
|
||||
|
||||
<p>
|
||||
These files allow you to do syntax highlighting for the Euphoria programming language.
|
||||
</p>
|
||||
|
||||
<h5>To Install:</h5>
|
||||
<p>
|
||||
For Geany I have included Kenneth Rhodes' gneui.ex program which allows Geany to jump to the
|
||||
location of an error. To use it, just set your Geany Build Command in the Execute box to: <br />
|
||||
<i>eui gneui.ex ./%f</i> <br />
|
||||
and move gneui.ex to your working directory.
|
||||
</p>
|
||||
|
||||
In the ~/demos/resources folder you will find two config files to trick Geany, Pluma, etc.
|
||||
into thinking your Euphoria files are Lua source code, thus giving you syntax highlighting:
|
||||
<pre>
|
||||
Copy filetype_extensions.conf into ~/.config/geany/
|
||||
Copy filetypes.lua into ~/.config/geany/filedefs
|
||||
</pre>
|
||||
|
||||
</p>
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
|
||||
|
||||
|
||||
BIN
eugtk/examples/resources/geany_syntax/compileflag.jpg
Normal file
BIN
eugtk/examples/resources/geany_syntax/compileflag.jpg
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
@@ -0,0 +1,69 @@
|
||||
# Filetype extension configuration file for Geany
|
||||
# Insert as many items as you want, seperate them with a ";".
|
||||
# See Geany's main documentation for details.
|
||||
|
||||
## Copy this file into ~/.config/geany/
|
||||
|
||||
[Extensions]
|
||||
Abc=*.abc;*.abp;
|
||||
ActionScript=*.as;
|
||||
Ada=*.adb;*.ads;
|
||||
ASM=*.asm;
|
||||
CAML=*.ml;*.mli;
|
||||
C=*.c;*.h;
|
||||
C++=*.cpp;*.cxx;*.c++;*.cc;*.h;*.hpp;*.hxx;*.h++;*.hh;*.C;*.H;
|
||||
C#=*.cs;
|
||||
CMake=CMakeLists.txt;*.cmake;*.ctest;
|
||||
COBOL=*.cob;*.cpy;*.cbl;*.cobol;
|
||||
Conf=*.conf;*.ini;config;*rc;*.cfg;*.desktop;control;
|
||||
CSS=*.css;
|
||||
Cython=*.pyx;*.pxd;*.pxi;
|
||||
D=*.d;*.di;
|
||||
Diff=*.diff;*.patch;*.rej;*.debdiff;*.dpatch;
|
||||
Docbook=*.docbook;
|
||||
Erlang=*.erl;
|
||||
F77=*.f;*.for;*.ftn;*.f77;
|
||||
Ferite=*.fe;
|
||||
Forth=*.fs;*.fth;
|
||||
Fortran=*.f90;*.f95;*.f03;
|
||||
FreeBasic=*.bas;*.bi;
|
||||
Genie=*.gs;
|
||||
GLSL=*.glsl;*.frag;*.vert;
|
||||
Haskell=*.hs;*.lhs;
|
||||
Haxe=*.hx;
|
||||
HTML=*.htm;*.html;*.shtml;*.hta;*.htd;*.htt;*.cfm;
|
||||
Java=*.java;*.jsp;
|
||||
Javascript=*.js;
|
||||
LaTeX=*.tex;*.sty;*.idx;*.ltx;*.latex;
|
||||
Lisp=*.lisp;
|
||||
Lua=*.e;*.eu;*.exu;*.exw;*.ex;
|
||||
Make=*.mak;*.mk;GNUmakefile;makefile;Makefile;makefile.*;Makefile.*;
|
||||
Markdown=*.mdml;*.markdown;*.md;*.mkd;
|
||||
Matlab/Octave=*.m;
|
||||
NSIS=*.nsi;*.nsh;
|
||||
Pascal=*.pas;*.pp;*.inc;*.dpr;*.dpk;
|
||||
Perl=*.pl;*.perl;*.pm;*.agi;*.pod;
|
||||
PHP=*.php;*.php3;*.php4;*.php5;*.phtml;
|
||||
Po=*.po;*.pot;
|
||||
Python=*.py;*.pyw;
|
||||
reStructuredText=*.rest;*.reST;*.rst;
|
||||
R=*.R;*.r;
|
||||
Ruby=*.rb;*.rhtml;*.ruby;
|
||||
Scala=*.scl;
|
||||
Sh=*.sh;configure;configure.in;configure.in.in;configure.ac;*.ksh;*.zsh;*.ash;*.bash;*.m4;
|
||||
SQL=*.sql;
|
||||
Tcl=*.tcl;*.tk;*.wish;
|
||||
Txt2tags=*.t2t;
|
||||
Vala=*.vala;*.vapi;
|
||||
Verilog=*.v;
|
||||
VHDL=*.vhd;*.vhdl;
|
||||
XML=*.xml;*.sgml;*.xsl;*.xslt;*.xsd;*.xhtml;
|
||||
YAML=*.yaml;*.yml;
|
||||
None=*;
|
||||
|
||||
# Note: restarting is required after editing groups
|
||||
[Groups]
|
||||
Programming=
|
||||
Markup=
|
||||
Misc=
|
||||
None=
|
||||
97
eugtk/examples/resources/geany_syntax/filetypes.lua
Normal file
97
eugtk/examples/resources/geany_syntax/filetypes.lua
Normal file
File diff suppressed because one or more lines are too long
116
eugtk/examples/resources/geany_syntax/gneui.ex
Normal file
116
eugtk/examples/resources/geany_syntax/gneui.ex
Normal file
@@ -0,0 +1,116 @@
|
||||
-- gneui.ex 1.0
|
||||
--
|
||||
-- 2013 2013-03-21
|
||||
-- Kenneth Rhodes <wolfmanjacques@gmail.com>
|
||||
--
|
||||
-- This file wraps the Euphoria interpreter
|
||||
-- together with a routine which extracts
|
||||
-- ex.err file data and passes the name,
|
||||
-- path, line and column to the Geany editor
|
||||
--
|
||||
-- usage: Geany run_cmd = eui gneui.ex ./%f
|
||||
-- Set run source code command to this as well,
|
||||
-- Execute your code from Geany; upon error,
|
||||
-- Geany will position the cursor at the line
|
||||
-- and column of the error.
|
||||
|
||||
--* Heavily modified by Irv Mullins
|
||||
--* to try to handle signal 11 errors from GTK
|
||||
|
||||
include std/io.e
|
||||
include std/convert.e
|
||||
include std/error.e
|
||||
include std/filesys.e
|
||||
include std/console.e
|
||||
include std/sequence.e
|
||||
|
||||
object file_name, command, err
|
||||
integer exit_code = 0
|
||||
|
||||
sequence cl = command_line()
|
||||
system("clear",0)
|
||||
|
||||
if length(cl) >= 3 then
|
||||
|
||||
file_name = cl[3]
|
||||
command = sprintf( "eui -D DEBUG \"%s\"", {file_name} )
|
||||
printf(1,
|
||||
`-----------------------------------------------------------------------
|
||||
/// Running %s with gneui
|
||||
------------------------------------------------------------------------
|
||||
`,{file_name})
|
||||
|
||||
-- look for old ex.err in current directory;
|
||||
err = canonical_path(file_name)
|
||||
err = pathname(err) & "/" & "ex.err"
|
||||
|
||||
if file_exists(err) then
|
||||
delete_file(err) -- remove old ex.err if it exists;
|
||||
end if
|
||||
|
||||
exit_code = system_exec ( command, 0 ) -- call eui with debugging;
|
||||
if exit_code != 0 then -- on error
|
||||
ParseErrorFile()
|
||||
end if
|
||||
|
||||
end if
|
||||
|
||||
--------------------------
|
||||
procedure ParseErrorFile()
|
||||
--------------------------
|
||||
object file_lines
|
||||
object temp_line
|
||||
object err_line
|
||||
integer err_col = 0, i = 0
|
||||
|
||||
if not file_exists("ex.err") then
|
||||
abort(exit_code) -- can't fine ex.err!
|
||||
end if
|
||||
|
||||
file_lines = read_lines(err)
|
||||
if atom(file_lines) then -- ex.err was empty
|
||||
crash("Cannot find ex.err!\n")
|
||||
end if
|
||||
|
||||
object x = split(file_lines[1])
|
||||
|
||||
for n = 1 to length(file_lines) do
|
||||
if match("^^^ call-back from external source",file_lines[n]) = 1 then
|
||||
file_lines = file_lines[1..n-1] -- get rid of non-useful part of ex.err listing;
|
||||
exit
|
||||
end if
|
||||
end for
|
||||
|
||||
-- trap & process GTK signal 11 errors;
|
||||
for n = length(file_lines) to 2 by -1 do
|
||||
-- start at end of ex.err, to find last (topmost) error line #;
|
||||
if match("... called from /", file_lines[n]) then
|
||||
i = find(':', file_lines[n])
|
||||
file_name = file_lines[n][17..i-1]
|
||||
err_line = file_lines[n][i+1..$]
|
||||
i = find(' ',err_line)
|
||||
err_line = err_line[1..i-1]
|
||||
err_line = to_number(err_line)
|
||||
-- display the file and line #, then call geany to edit it;
|
||||
printf(1,"\nFile:%s - LINE:%d \n",{file_name,err_line})
|
||||
system( sprintf("geany \"%s:%d\"", {file_name,err_line} ))
|
||||
abort(exit_code)
|
||||
end if
|
||||
end for
|
||||
|
||||
-- trap & process euphoria error report;
|
||||
for n = 1 to length(file_lines) do
|
||||
-- start at top of ex.err, to find first syntax error;
|
||||
if find('^', file_lines[n]) then
|
||||
i = find(':',file_lines[1])
|
||||
err_col = match("^",file_lines[n])-1
|
||||
file_name = file_lines[1][1..i-1]
|
||||
err_line = to_number(file_lines[1][i+1..$])
|
||||
-- display the file and line #, then call geany to edit it;
|
||||
printf(1,"\nFILE:%s - LINE:%d COL:%d\n",{file_name,err_line,err_col})
|
||||
system( sprintf("geany \"%s:%d:%d\" & ", {file_name, err_line, err_col} ))
|
||||
abort(exit_code)
|
||||
end if
|
||||
end for
|
||||
|
||||
end procedure
|
||||
Reference in New Issue
Block a user