editors

changeset 16:1fad0698d80e

* String without a terminator appears in an error font.
* Added eudoc highlighting in eudoc comments. Highlights
category titles, bold and italic fonts.
author Jeremy Cowgar <jeremy@cowgar.com>
date Tue Nov 02 06:42:09 2010 +0000 (2010-11-02)
parents 55c7d738c5f0
children 566f40279eb8
files microemacs/hkeuphoria.emf
line diff
     1.1 --- a/microemacs/hkeuphoria.emf	Tue Nov 02 05:28:36 2010 +0000
     1.2 +++ b/microemacs/hkeuphoria.emf	Tue Nov 02 06:42:09 2010 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  ; -!- emf -!-
     1.5  ;
     1.6  ; Created:     2008-06-21
     1.7 -; Modified:    2010-10-30
     1.8 +; Modified:    2010-11-02
     1.9  ; Synopsis:    Euphoria 4.0 mode hook
    1.10  ; Authors:     Jeremy Cowgar
    1.11  ;
    1.12 @@ -16,8 +16,8 @@
    1.13  ; buffer-init variables
    1.14  set-variable .fhook-euphoria.setup &reg "/history/fhook/euphoria" "bdfghnopxlqv"
    1.15  set-variable .fhook-euphoria.setup-mask "abdefghikmnoptuxclqrvy"
    1.16 -set-variable .fhook-euphoria.comment "|/*| */|*| * | * |fr|"
    1.17 -set-variable .fhook-euphoria.comment-1 "|--||--|-- | --|r|"
    1.18 +set-variable .fhook-euphoria.comment "|--||--|-- | --|r|"
    1.19 +set-variable .fhook-euphoria.comment-1 "|/*| */|*| * | * |fr|"
    1.20  set-variable .fhook-euphoria.indent-width 4
    1.21  
    1.22  ; Setup collapse
    1.23 @@ -31,28 +31,32 @@
    1.24  !if &not &exist .hilight.euphoria
    1.25      set-variable .hilight.euphoria &pinc .hilight.next 1
    1.26  !endif
    1.27 -!if &and &sin "h" .fhook-euphoria.setup &band .hilight.flags 0x02 
    1.28 -    0 hilight .hilight.euphoria 1 $global-scheme
    1.29 -    
    1.30 +!if &and &sin "h" .fhook-euphoria.setup &band .hilight.flags 0x02
    1.31 +    0 hilight .hilight.euphoria 2 75 ;$global-scheme
    1.32 +
    1.33      hilight .hilight.euphoria  2 "^#!/"                  .scheme.header
    1.34      hilight .hilight.euphoria  2 "--"                    .scheme.comment
    1.35      hilight .hilight.euphoria 20 "/\\*" "*/" ""          .scheme.comment
    1.36 +    hilight .hilight.euphoria  2 "\"[^\"]*$"             .scheme.error
    1.37      hilight .hilight.euphoria  4 "\"" "\"" "\\"          .scheme.string
    1.38      hilight .hilight.euphoria  4 "'" "'" "\\"            .scheme.string
    1.39      hilight .hilight.euphoria  4 "`" "`" ""              .scheme.string
    1.40 -    hilight .hilight.euphoria  4 "\"\"\"" "\"\"\"" ""    .scheme.string   
    1.41 -    
    1.42 +    hilight .hilight.euphoria  4 "\"\"\"" "\"\"\"" ""    .scheme.string
    1.43 +    hilight .hilight.euphoria  4 "u\"" "\"" ""           .scheme.string
    1.44 +    hilight .hilight.euphoria  4 "U\"" "\"" ""           .scheme.string
    1.45 +    hilight .hilight.euphoria  4 "x\"" "\"" ""           .scheme.string
    1.46 +
    1.47      hilight .hilight.euphoria 1 "export"                 .scheme.keyword
    1.48      hilight .hilight.euphoria 1 "public"                 .scheme.keyword
    1.49      hilight .hilight.euphoria 1 "global"                 .scheme.keyword
    1.50      hilight .hilight.euphoria 1 "override"               .scheme.keyword
    1.51 -    
    1.52 +
    1.53      hilight .hilight.euphoria 1 "object"                 .scheme.type
    1.54      hilight .hilight.euphoria 1 "sequence"               .scheme.type
    1.55      hilight .hilight.euphoria 1 "integer"                .scheme.type
    1.56      hilight .hilight.euphoria 1 "atom"                   .scheme.type
    1.57      hilight .hilight.euphoria 1 "enum"                   .scheme.type
    1.58 -    
    1.59 +
    1.60      hilight .hilight.euphoria 1 "as"                     .scheme.keyword
    1.61      hilight .hilight.euphoria 1 "and"                    .scheme.keyword
    1.62      hilight .hilight.euphoria 1 "break"                  .scheme.keyword
    1.63 @@ -83,7 +87,7 @@
    1.64      hilight .hilight.euphoria 1 "while"                  .scheme.keyword
    1.65      hilight .hilight.euphoria 1 "until"                  .scheme.keyword
    1.66      hilight .hilight.euphoria 1 "xor"                    .scheme.keyword
    1.67 -    
    1.68 +
    1.69      hilight .hilight.euphoria 1 "elsedef"                .scheme.prepro
    1.70      hilight .hilight.euphoria 1 "elsifdef"               .scheme.prepro
    1.71      hilight .hilight.euphoria 1 "end ifdef"              .scheme.prepro
    1.72 @@ -93,7 +97,7 @@
    1.73      hilight .hilight.euphoria 1 "trace"                  .scheme.prepro
    1.74      hilight .hilight.euphoria 1 "with"                   .scheme.prepro
    1.75      hilight .hilight.euphoria 1 "without"                .scheme.prepro
    1.76 -    
    1.77 +
    1.78      hilight .hilight.euphoria 0 "\\+"                    .scheme.operator
    1.79      hilight .hilight.euphoria 0 "-"                      .scheme.operator
    1.80      hilight .hilight.euphoria 0 "\\*"                    .scheme.operator
    1.81 @@ -104,9 +108,9 @@
    1.82      hilight .hilight.euphoria 0 "\\.\\."                 .scheme.operator
    1.83      hilight .hilight.euphoria 0 "[[]"                    .scheme.operator
    1.84      hilight .hilight.euphoria 0 "[]]"                    .scheme.operator
    1.85 -    
    1.86 +
    1.87      hilight .hilight.euphoria 1 "[A-Z_][A-Z0-9]+"        .scheme.constant
    1.88 -    
    1.89 +
    1.90      ; Hilight numbers
    1.91      hilight .hilight.euphoria 1 "[[:digit:]_]+"          .scheme.constant
    1.92      hilight .hilight.euphoria 1 "-[[:digit:]_]+"         .scheme.constant
    1.93 @@ -115,14 +119,31 @@
    1.94      hilight .hilight.euphoria 1 "0d[0-9_]+"              .scheme.constant
    1.95      hilight .hilight.euphoria 1 "0x[0-9A-Fa-f_]+"        .scheme.constant
    1.96      hilight .hilight.euphoria 1 "#[0-9A-Fa-f_]+"         .scheme.constant
    1.97 -    
    1.98 +
    1.99      ; Allow Euphoria to be embedded in other languages
   1.100      set-variable .hilight.euscript .hilight.euphoria
   1.101 +    
   1.102 +    ; Highlight comments for eudoc
   1.103 +    !if &not .hilight.eudoc
   1.104 +        set-variable .hilight.eudoc &pinc .hilight.next 1
   1.105 +    !endif
   1.106 +    
   1.107 +    ; Add a hook into the normal Euphoria highlighting. We jump
   1.108 +    ; into eudoc when we see an opening "--**".
   1.109 +    hilight .hilight.euphoria 0x80 "--\\*\\*" .hilight.eudoc   .scheme.comment
   1.110 +    
   1.111 +    ; eudoc hilighting starts here
   1.112 +    0 hilight .hilight.eudoc 2 50                              .scheme.comment
   1.113 +    hilight .hilight.eudoc 2 "[A-Za-z0-9 ]+:$"                 .scheme.keyword
   1.114 +    hilight .hilight.eudoc 1 "\\[\\[:[^]]+\\]\\]"              .scheme.link
   1.115 +    hilight .hilight.eudoc 0x44 "\\*\\*" "**" "\\*\\*" "**" "" .scheme.string
   1.116 +    hilight .hilight.eudoc 0x44 "//" "//" "//" "//" ""         .scheme.string
   1.117 +    hilight .hilight.eudoc 0x80 "^$" .hilight.euphoria         .scheme.comment
   1.118  !endif
   1.119  
   1.120  !if &sin "d" .fhook-euphoria.setup
   1.121      0 indent .hilight.euphoria 0 25
   1.122 -    
   1.123 +
   1.124      indent .hilight.euphoria N "^\\s*override\\s*function" t
   1.125      indent .hilight.euphoria N "^\\s*global\\s*function" t
   1.126      indent .hilight.euphoria N "^\\s*public\\s*function" t
   1.127 @@ -136,47 +157,48 @@
   1.128      indent .hilight.euphoria N "^\\s*global\\s*type" t
   1.129      indent .hilight.euphoria N "^\\s*public\\s*type" t
   1.130      indent .hilight.euphoria N "^\\s*export\\s*type" t
   1.131 -    
   1.132 +
   1.133      ; if statement
   1.134      indent .hilight.euphoria N "^\\s*if" t
   1.135      indent .hilight.euphoria S "^\\s*elsif" -t
   1.136      indent .hilight.euphoria S "^\\s*else" -t
   1.137      indent .hilight.euphoria S "^\\s*then" -t
   1.138 -    
   1.139 +
   1.140      ; ifdef statement
   1.141      indent .hilight.euphoria N "^\\s*ifdef" t
   1.142      indent .hilight.euphoria S "^\\s*elsifdef" -t
   1.143 -    
   1.144 +
   1.145      ; switch statement
   1.146      indent .hilight.euphoria N "^\\s*switch" 2t
   1.147      indent .hilight.euphoria S "^\\s*case" -t
   1.148 -    
   1.149 +
   1.150      ; loops
   1.151      indent .hilight.euphoria N "^\\s*while" t
   1.152      indent .hilight.euphoria N "^\\s*for" t
   1.153      indent .hilight.euphoria N "^\\s*loop" t
   1.154      indent .hilight.euphoria S "^\\s*do" -t
   1.155      indent .hilight.euphoria S "^\\s*entry" -t
   1.156 -    
   1.157 +
   1.158      ; label
   1.159      indent .hilight.euphoria f "^\\s*label " 0
   1.160 -    
   1.161 +
   1.162      ; end of most statements
   1.163      indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
   1.164      indent .hilight.euphoria O "^\\s*end"         -t
   1.165 -    
   1.166 +
   1.167      ; Expressions at the end of a line - try with these
   1.168      indent .hilight.euphoria c "[-+=*/<>&]$" t
   1.169 -    
   1.170 +
   1.171      ;indent .hilight.euphoria b "{" "}"
   1.172      indent .hilight.euphoria n "{" t
   1.173      indent .hilight.euphoria o "}" -t
   1.174      ;indent .hilight.euphoria b "(" ")"
   1.175      indent .hilight.euphoria n "(" t
   1.176      indent .hilight.euphoria o ")" -t
   1.177 -    
   1.178 +
   1.179      ; ignores
   1.180      indent .hilight.euphoria i "--"
   1.181 +    indent .hilight.euphoria e "/*" "*/" ""
   1.182      indent .hilight.euphoria e "\"" "\"" "\\"
   1.183  !endif
   1.184  

SCM Home | OpenEuphoria.org Home