From owner-octave-sources at bevo dot che dot wisc dot edu Sun Mar 9 16:26:59 1997 Subject: a2ps octave patch From: Craig Earls To: octave-sources at bevo dot che dot wisc dot edu Date: Sun, 09 Mar 1997 17:26:48 -0500 This is a multi-part message in MIME format. --------------65F64BEE70B7B6C56EF97EDD Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit This patch teaches a2ps-4.7.20 to pretty print octave/MATLAB code -- ----------------------------------------------------------------- Craig P Earls cpearls at ziplink dot net LT US Navy, MIT Ocean Engineering cpearls at mit dot edu ----------------------------------------------------------------- --------------65F64BEE70B7B6C56EF97EDD Content-Type: text/plain; charset=us-ascii; name="a2ps.octave.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="a2ps.octave.diff" diff -rc a2ps-4.7.20/AUTHORS a2ps/AUTHORS *** a2ps-4.7.20/AUTHORS Thu Jan 30 06:56:54 1997 --- a2ps/AUTHORS Sun Mar 9 16:30:23 1997 *************** *** 23,28 **** --- 23,29 ---- * Thomas Parmelan (Thomas dot Parmelan at efrei dot fr) * Edward Arthur (eda at ultranet dot com) * Jean-Philippe Cottin (cottin at inf dot enst dot fr) + * Craig P. Earls (cpearls at mit dot edu) Translators * Daniele Ghiotti (Italian) diff -rc a2ps-4.7.20/ChangeLog a2ps/ChangeLog *** a2ps-4.7.20/ChangeLog Thu Feb 13 13:50:36 1997 --- a2ps/ChangeLog Sun Mar 9 16:33:35 1997 *************** *** 1,3 **** --- 1,5 ---- + + Thu Feb 13 19:49:06 1997 Akim Demaille * lib/: better support of non ANSI platforms. *************** *** 398,403 **** - a form feed immediately followed by a new line won't appear as a blank line at the beginning of the next page - every formfeed is correctly handled (even if there two ! adjacent \f). --- 400,407 ---- - a form feed immediately followed by a new line won't appear as a blank line at the beginning of the next page - every formfeed is correctly handled (even if there two ! adjacent \f) + Modified by Craig P. Earls (cpearls at mit dot edu) + 57) Added Octave/MATLAB mode Only in a2ps/check/test-files: mtvplot.m diff -rc a2ps-4.7.20/src/styles.c.in a2ps/src/styles.c.in *** a2ps-4.7.20/src/styles.c.in Tue Feb 18 04:51:51 1997 --- a2ps/src/styles.c.in Sun Mar 9 16:36:12 1997 *************** *** 304,309 **** --- 304,310 ---- * C * c++ * o2c + * Octave/MATLAB */ m4_include(styles05.m4) /************************************************************************/ *************** *** 402,408 **** */ a2_styles(ada, c, cpp, caml, claire, coq, clisp, eiffel, fortran, ! java, lace, m68000, mail, modula3, o2c, oberon, ora, pascal, perl, plsql, postscript, prescript, prolog, promela, python, sather, scheme, sdl, sh, sql, sql92, tcl, tk, verilog, unity, vhdl, zsh) --- 403,409 ---- */ a2_styles(ada, c, cpp, caml, claire, coq, clisp, eiffel, fortran, ! java, lace, m68000, mail, modula3, o2c, oberon, octave, ora, pascal, perl, plsql, postscript, prescript, prolog, promela, python, sather, scheme, sdl, sh, sql, sql92, tcl, tk, verilog, unity, vhdl, zsh) diff -rc a2ps-4.7.20/src/styles.h a2ps/src/styles.h *** a2ps-4.7.20/src/styles.h Tue Feb 18 04:52:11 1997 --- a2ps/src/styles.h Sun Mar 9 16:37:05 1997 *************** *** 31,41 **** plain_style = -1, ada_style, c_style, cpp_style, caml_style, claire_style, coq_style, clisp_style, eiffel_style, fortran_style, java_style, lace_style, ! m68000_style, mail_style, modula3_style, o2c_style, oberon_style, ora_style, ! pascal_style, perl_style, plsql_style, postscript_style, prescript_style, ! prolog_style, promela_style, python_style, sather_style, scheme_style, ! sdl_style, sh_style, sql_style, sql92_style, orq_style, tcl_style, tk_style, unity_style, verilog_style, ! vhdl_style, zsh_style } STYLE; typedef enum { --- 31,42 ---- plain_style = -1, ada_style, c_style, cpp_style, caml_style, claire_style, coq_style, clisp_style, eiffel_style, fortran_style, java_style, lace_style, ! m68000_style, mail_style, modula3_style, o2c_style, oberon_style, ! octave_style, ora_style, pascal_style, perl_style, plsql_style, ! postscript_style, prescript_style, prolog_style, promela_style, ! python_style, sather_style, scheme_style,sdl_style, sh_style, ! sql_style, sql92_style, orq_style, tcl_style, tk_style, unity_style, ! verilog_style, vhdl_style, zsh_style } STYLE; typedef enum { diff -rc a2ps-4.7.20/src/styles05.m4 a2ps/src/styles05.m4 *** a2ps-4.7.20/src/styles05.m4 Thu Feb 13 11:59:27 1997 --- a2ps/src/styles05.m4 Sun Mar 9 16:28:55 1997 *************** *** 138,140 **** --- 138,185 ---- o2c_abbreviations, o2c_description, \ CASE_SENSITIVE, c_characters, c_characters, o2c_keywords, \ NOSYMBOL, c_specials, o2c_sequences, sh_verbatims, EMPTY } + + /* + * Octave/MATLAB added by C.P. Earls March 1997 + */ + const sequence octave_sequences [] = { + a2_line_sequences(comment, #), + a2_sequence(\", COURIER, string, \", COURIER), + ENDSEQUENCE + }; + const uchar octave_characters [] = { + 'A', 'Z', + 'a', 'z', + '_', '_', + '\0' + }; + const symbol octave_regulars [] = { + a2_not(not), + a2_and(and), + a2_or(or), + ENDSYMBOL + }; + const symbol octave_specials [] = { + a2_neq(<>), + a2_neq(!=), + a2_leq(<=), + a2_geq(>=), + a2_equiv(==), + ENDSYMBOL + }; + const keyword octave_keywords [] = { + a2_keyword(KEYWORD_STRONG, all_va_args, endwhile, break, for, case, function, + catch, global, continue, gplot, else, gsplot, elseif, if, end, otherwise, + end_try_catch, return, end_unwind_protect, switch, endfor, try, endfunction, + unwind_protect, endif, unwind_protect_cleanup, endswitch, while) + ENDKEYWORD + }; + + const char * octave_abbreviations []= { + "octavescript", "m", "\0" + }; + const uchar octave_description [] = ""; + #define octave_style_def { octave_style, "octave", \ + octave_abbreviations, octave_description, \ + CASE_SENSITIVE, octave_characters, octave_characters, octave_keywords, \ + octave_regulars, octave_specials, octave_sequences, sh_verbatims, EMPTY } --------------65F64BEE70B7B6C56EF97EDD--