home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / programs / textual / zap / zmods / Modules / !ZapPerl / !Help next >
Encoding:
Text File  |  1997-11-25  |  8.2 KB  |  216 lines

  1.  
  2.                ZapPerl, a Zap syntax colouring mode
  3.                ====================================
  4.  
  5. 1.0 Features
  6. ============
  7.  
  8. This module performs syntax colouring designed for Perl documents.
  9. It contains knowledge about all(!?) the keywords of version 5 of Perl.
  10.  
  11. As a result of the second point, this is my slowest Zap mode to date.
  12.  
  13. The module contains some enhancements to the cursor keys so that
  14. when they are used in combination with the shift key they behave in a
  15. more appropriate manner than when is in text mode.  These routines have
  16. been stolen from Martin Ebourne's C mode and are documented by him in
  17. his own directory.  Basically they make the shift-cursor combinations
  18. pause more frequently and more intelligently step through the code.
  19. Martin has kindly given permission for his code to be used.
  20.  
  21. It also contains old C mode style bracket matching and indentation options.
  22.  
  23. If Ctrl-return is pressed after a "{" (where autoindenting would normally
  24. perform its function), the cursor is placed at the start of the line.
  25. If Shift-return is pressed, then a normal indentation will occur.
  26. These operations operate in a hacky manner, scanning  the keyboard
  27. directly in order to bypass Zap's normal keymap.
  28.  
  29. The settings for the delay (in centiseconds) may range from 0 to 255.
  30.  
  31. The limits on the maximum indentation allowed is 31 characters.
  32.  
  33. Setting either of these to zero turns the option off.
  34. They also now default to off, and so will need to be configured via the
  35. mode menu before they will do anything.
  36.  
  37. Although the author welcomes correspondence concerning this mode, he
  38. makes no cliam that it is bug-free and, it is not guaranteed to perform
  39. any particular function.  It is to be used entirely at one's own risk.
  40.  
  41. This is Freeware, and may be distributed freely provided that all it is
  42. redistributed intact.  If engaging in large-scale distribution, please
  43. contact the author to get the latest version.
  44.  
  45.  
  46. 2.0 Installation
  47. ================
  48.  
  49. Copy the module "ZapPerl" into an appropriately-named subdirectory of
  50. the "3rdParty" directory inside the Zap application.
  51.  
  52. In the file called "External", in the directory "!Zap.Options.Default" or
  53. wherever the variable Zap$External points to, add lines as follows:
  54.  
  55. <Zap$3rdParty>.Tyler.!ZapPerl.ZapPerl Obey <Zap$3rdParty>.Tyler.!ZapPerl.!Setup
  56.     Perl
  57.     -
  58.     PERL_FLAGSTOGGLE        &8017
  59.     PERL_SETDELAY            &2000F
  60.     PERL_SETINDENT            &2000F
  61.     -
  62.  
  63. ...and lines like:
  64.  
  65. &500    &FFD    \#\*.pl.\#\*        +Perl
  66. &500    &FFF    \#\*.pl.\#\*        +Perl
  67. ...
  68.  
  69. Perl        &1102    Perl
  70.  
  71. ...in your keys file.  Zap will then need to be restarted.
  72.  
  73.  
  74. 3.0 Problems
  75. ============
  76.  
  77.                               Mode problems:
  78.                   ~~~~~~~~~~~~~~
  79. * List of functions does not work.
  80. * The mode is over 11K in size, and cannot easily be made smaller.
  81. * The bracket matching gets confused by brackets embedded in strings.
  82. * For people used to using C mode the default colours can be confusing.
  83.  
  84.                        Syntax colouring problems:
  85.                ~~~~~~~~~~~~~~~~~~~~~~~~~~
  86. First, the excuse: Perl is not an easy language to syntax colour well.
  87.  
  88. * The "/" character poses a number of difficult problems for Perl syntax
  89.   colouring modes because it has a number of radically different meanings
  90.   depending on the context in which it is used.  It acts as delimiters
  91.   to regular expressions, and as a division operator.  ZapPerl tries to
  92.   make educated guesses about the context, but it does sometimes get
  93.   things wrong.  If anyone can pin down local criteria for foolproofly
  94.   distinguishing between the various different types od slash, the
  95.   information would be much appreciated.
  96.  
  97. * Similarly to the "/" character, the "'" character is also problematical.
  98.   this may be the beginning of a quotes section, but may also occur
  99.   legitimately in other contexts.  Once again, ZapPerl may not always
  100.   get this right.
  101.  
  102. * No attempts are made to match quotes inside regular expressions.
  103.   Regular expressions inside quotes are allowed and parsed correctly.
  104.   As far as I know, this is the most logical situation.
  105.  
  106. * Regular expressions are now never allowed  in "-strings, '-strings or
  107.   `-strings.  This is because of problems with distinguishing REs
  108.   from the common "/" character in quoted paths.
  109.  
  110. * Strings cannot be nested in side strings of a different type. Colouring
  111.   these differently would rarely be appropriate, so this is probably the
  112.   correct method.
  113.  
  114. * Commands inside regular expressions and quotes are not syntax-coloured,
  115.   and (controversially) nor should they be (at least not like normal).
  116.  
  117. * "@ARGV", "$ARGV" and similar constructs are currently coloured as though
  118.   they are ordinary variables.
  119.  
  120. * Preprocessor directives are currently coloured as comments.
  121.  
  122. * There is currently no support for styles of regular expression
  123.   delimited by arbitrary characters (i.e. only the "/"-style works).
  124.   Adding support for this is proving to be quite complicated. Hopefully
  125.   it will be done someday.
  126.  
  127. * There is no support for the __END__ directive, or its associates.
  128.  
  129. * There are, it seems, a number of places where it seems that it is
  130.   legitimate to have a hash "#" where it does not start a comment.
  131.   This is most common when the "#" is used to delimit a regular
  132.   expression.  Many of these types of case will currently be coloured
  133.   incorrectly.
  134.  
  135. If you know anything about Perl, then you can probably improve this mode
  136. by remote control by emailing tt@cryogen.com with your comments.
  137.  
  138. 4.0 History
  139. ===========
  140.  
  141. v0.15 - (25-Nov-97)
  142.       * A few new keywords added and all reserved words made case-sensitive.
  143.       * Minor changes to remove options duplicated in the latest release of
  144.         Zap.
  145.  
  146. v0.14 - (08-Jul-97)
  147.       * Keywords finally wrap properly around line ends.
  148.       * Large speed up by removing a mistake in the code.  It's still
  149.         very slow though.
  150.  
  151. v0.12 - (01-Mar-97)
  152.       * Buttons support added.
  153.       * New style configuration code added, removing limitations on the
  154.         pause delay.
  155.  
  156. v0.11 - (02-Feb-97)
  157.       * The # command in REs should now not cause confusion.
  158.       * "'" quotation marks are now coloured correctly if preceded by
  159.         a "{" character, and the linewrapping of their associated colour
  160.         has been slightly improved.
  161.       * Colouring of comments which wrap between lines slightly improved.
  162.  
  163. v0.10 - (30-Jan-97)
  164.       * SAVEANDRUN should now work properly.
  165.  
  166. v0.09 - (23-Jan-97)
  167.       * Fixed bug causing all Perl commands to be forced to be displayed
  168.         in lower case.
  169.  
  170. v0.08 - (21-Jan-97)
  171.       * Fixed bug (introduced in v0.07) causing REs to be coloured badly.
  172.       * Hash commands immediately preceded by "$"s or "^"s are not
  173.         treated as comments.
  174.       * Tried to implement code to deal with arbitrary characters being
  175.         used as regular expression delimiters.  No success yet.  The mode
  176.         looks at its worst when the hash character is used in this context
  177.         and this seems to be regrettably common.
  178.       * Colours in REs are now coloured as REs and not as numbers.
  179.  
  180. v0.07 - (20-Jan-97)
  181.       * Fixed bug involving clicking on the items in the mode menu.
  182.       * Regular expressions inside strings are now no longer coloured
  183.         as regular expressions.  Deciding what was a RE in these
  184.         circumstances proved too difficult.
  185.       * Fixed bug involving insertion of multiple characters interacting
  186.         with the bracket matching code.
  187.  
  188. v0.06 - (16-Jan-97)
  189.       * Replace functions such as "tr/ABC/XYZ/" and "tr[ABC][XYZ]" are
  190.         now treated quite sensibly.
  191.       * A number of other minor changes designed to improve the colouring.
  192.  
  193. v0.05 - (12-Jan-97)
  194.       * "@", "$" and "%" are now all treated in essentially the same way.
  195.       * Bugs with commands being followed by quotes or REs not being
  196.         coloured properly cured.
  197.  
  198. v0.04 - (08-Jan-97)
  199.       * It is now possible to save the configuration options to disc.
  200.  
  201. v0.03 - (06-Jan-97)
  202.       * The Zap command "OLEFILECHANGED" was added in error and then
  203.         quickly stripped out again.
  204.  
  205. v0.02 - (04-Jan-96)
  206.       * Syntax colouring much improved; the syntax colouring may now be
  207.         used to avoid function names that duplicate system functions
  208.         in a much more friendly manner.
  209.   
  210. v0.01 - (03-Jan-96)
  211.       * Very early release as a RFC to the population of the net.
  212.  
  213. Enjoy
  214. __________ 
  215.  |im |yler  The Mandala Centre - tt@cryogen.com - http://www.mandala.co.uk
  216.