! ---------------------------------------------------------- ! Patterns for Syntax Highlighting and Smart Indenting in Scheme ! - started 3/99 by Clif Kussmaul ! http://www.cs.moravian.edu ! comments specific to this file... ! ---------------------------------------------------------- ! ! - this file contains patterns and other configuration info ! for syntax highlighting and smart indenting in Scheme ! - all entries are added to the .nedit file (see below) ! - written for MIT Scheme, although other dialects are similar. ! - Scheme numbers can take a huge variety of forms; ! and the "Numeric Constant" pattern below only matches ! the common decimal integers and reals. ! ! Please let me know if you have additions, corrections, or suggestions. ! ! ---------------------------------------------------------- ! comments adapted from other nedit patterns (Matlab)... ! ---------------------------------------------------------- ! ! Patterns for Scheme ! ! In NEdit Version 5.0.1 and beyond, load this pattern by running: ! ! nedit -import ! ! Then, check that the patterns were loaded correctly, and choose ! Save Defaults from the Preferences menu. The new patterns will ! now be incorporated into your own .nedit file, so the next time ! you start NEdit, you will no longer need to use -import. ! ! In version 5.0, without -import, you must edit your .nedit file ! by hand and add the contents of each resource below to the ! corresponding list in your .nedit file. Be sure to separate ! new entries with \n, and continue resource strings by escaping ! all newlines within a resource value with \ (backslash), ! leaving only the last line of the resource value not ending in \. ! ! ---------------------------------------------------------- ! ---------------------------------------- ! Scheme language mode nedit.languageModes: \ Scheme:.scheme .scm:::::: ! ---------------------------------------- ! Scheme highlighting patterns nedit.highlightPatterns: \ Scheme:1:0{\n\ Comment:";":"$"::Comment::\n\ Quoted Constant:"'[^()""; \\t]+":::Text Key::\n\ Character Constant:"<(#t|#f|#\\\\space|#\\\\newline|#\\\\.)>":::Text Key::\n\ Numeric Constant:"<(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))>":::Text Key1::\n\ Keyword + Prefix:"[^()""; \\t]<(=>|and|begin|case|cond|define|delay|do|else|if|lambda|let|let\\*|letrec|or|quasiquote|quote|set!|unquote|unquote-splicing)>":::Plain::\n\ Keyword + Suffix:"<(=>|and|begin|case|cond|define|delay|do|else|if|lambda|let|let\\*|letrec|or|quasiquote|quote|set!|unquote|unquote-splicing)>[^()""; \\t]":::Plain::\n\ Keyword:"<(=>|and|begin|case|cond|define|delay|do|else|if|lambda|let|let\\*|letrec|or|quasiquote|quote|set!|unquote|unquote-splicing)>":::Keyword::\n\ String:"""":""""::String1::\n\ String Escape:"\\\\.":::String:String:\n\ } ! ---------------------------------------- ! Scheme smart indenting nedit.smartIndentInit: \ Scheme: # number of characters in normal indent level \n\ $scheme_indent = "default"\n\ \n\ # count occurrences of "(" and ")" in line containing $1\n\ define count_in_line {\n\ # find ends of current line\n\ start = search("\\n", $1, "backward")\n\ stop = search("\\n", $1, "forward")\n\ if (start == -1) start = 0\n\ if (stop == -1) stop = $text_length\n\ # count occurrences\n\ count = 0\n\ for (p=start; p