editors

changeset 15:55c7d738c5f0

Much better auto-indent support. Added a few missing keywords. Source file exporer now knows about public, global, export and override functions, procedures and types. Auto-indent seems to be indenting everything that I throw at it.
author Jeremy Cowgar <jeremy@cowgar.com>
date Tue Nov 02 05:28:36 2010 +0000 (2010-11-02)
parents b9506af9eed1
children 1fad0698d80e
files microemacs/hkeuphoria.emf
line diff
     1.1 --- a/microemacs/hkeuphoria.emf	Sun Oct 31 02:59:09 2010 +0000
     1.2 +++ b/microemacs/hkeuphoria.emf	Tue Nov 02 05:28:36 2010 +0000
     1.3 @@ -1,7 +1,7 @@
     1.4  ; -!- emf -!-
     1.5  ;
     1.6  ; Created:     2008-06-21
     1.7 -; Modified:    2009-09-06
     1.8 +; Modified:    2010-10-30
     1.9  ; Synopsis:    Euphoria 4.0 mode hook
    1.10  ; Authors:     Jeremy Cowgar
    1.11  ;
    1.12 @@ -9,6 +9,7 @@
    1.13  define-macro fhook-euphoria
    1.14      set-variable $buffer-mask "luh1"
    1.15      @# buffer-init "euphoria"
    1.16 +    buffer-abbrev-file "euphoria"
    1.17      buffer-init-hooks
    1.18  !emacro
    1.19  
    1.20 @@ -20,11 +21,11 @@
    1.21  set-variable .fhook-euphoria.indent-width 4
    1.22  
    1.23  ; Setup collapse
    1.24 -set-variable .fhook-euphoria.collapse-open "^\\s*\\(global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    1.25 +set-variable .fhook-euphoria.collapse-open "^\\s*\\(override\\|global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    1.26  set-variable .fhook-euphoria.collapse-close "^\\s*end\\s+\\(function\\|procedure\\|type\\)"
    1.27  
    1.28  ; Setup item-list
    1.29 -set-variable .fhook-euphoria.item-list-s1 "^\\s*\\(global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    1.30 +set-variable .fhook-euphoria.item-list-s1 "^\\s*\\(override\\|global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    1.31  set-variable .fhook-euphoria.item-list-r1 "\\1 \\2 \ecB\\3\ecA"
    1.32  
    1.33  !if &not &exist .hilight.euphoria
    1.34 @@ -104,7 +105,7 @@
    1.35      hilight .hilight.euphoria 0 "[[]"                    .scheme.operator
    1.36      hilight .hilight.euphoria 0 "[]]"                    .scheme.operator
    1.37      
    1.38 -    hilight .hilight.euphoria 1 "[A-Z][A-Z0-9]+"         .scheme.constant
    1.39 +    hilight .hilight.euphoria 1 "[A-Z_][A-Z0-9]+"        .scheme.constant
    1.40      
    1.41      ; Hilight numbers
    1.42      hilight .hilight.euphoria 1 "[[:digit:]_]+"          .scheme.constant
    1.43 @@ -115,58 +116,68 @@
    1.44      hilight .hilight.euphoria 1 "0x[0-9A-Fa-f_]+"        .scheme.constant
    1.45      hilight .hilight.euphoria 1 "#[0-9A-Fa-f_]+"         .scheme.constant
    1.46      
    1.47 -    hilight .hilight.euphoria 1 "[A-Z_][A-Z0-9_]+"       .scheme.constant
    1.48 -    
    1.49      ; Allow Euphoria to be embedded in other languages
    1.50      set-variable .hilight.euscript .hilight.euphoria
    1.51  !endif
    1.52  
    1.53 -;!if &sin "d" .fhook-euphoria.setup
    1.54 -;	0 indent .hilight.euphoria 0 25
    1.55 -;        
    1.56 -;        indent .hilight.euphoria N "^\\s*global\\s*function" t
    1.57 -;        indent .hilight.euphoria N "^\\s*export\\s*function" t
    1.58 -;        indent .hilight.euphoria N "^\\s*function" t
    1.59 -;        indent .hilight.euphoria N "^\\s*global\\s*procedure" t
    1.60 -;        indent .hilight.euphoria N "^\\s*export\\s*procedure" t
    1.61 -;        indent .hilight.euphoria N "^\\s*procedure" t
    1.62 -;        indent .hilight.euphoria N "^\\s*global\\s*type" t
    1.63 -;        indent .hilight.euphoria N "^\\s*export\\s*type" t
    1.64 -;        
    1.65 -;        ; if statement
    1.66 -;        indent .hilight.euphoria N "^\\s*if" t
    1.67 -;        indent .hilight.euphoria S "^\\s*elsif" -t
    1.68 -;        indent .hilight.euphoria S "^\\s*else" -t
    1.69 -;	indent .hilight.euphoria S "^\\s*then" -t
    1.70 -;        
    1.71 -;        ; ifdef statement
    1.72 -;        indent .hilight.euphoria N "^\\s*ifdef" t
    1.73 -;        indent .hilight.euphoria S "^\\s*elsifdef" -t
    1.74 -;        
    1.75 -;        ; switch statement
    1.76 -;        indent .hilight.euphoria N "^\\s*switch" 2t
    1.77 -;        indent .hilight.euphoria S "^\\s*case" -t
    1.78 -;        
    1.79 -;        ; loops
    1.80 -;	indent .hilight.euphoria N "^\\s*while" t
    1.81 -;        indent .hilight.euphoria N "^\\s*for" t
    1.82 -;        indent .hilight.euphoria N "^\\s*loop" t
    1.83 -;        indent .hilight.euphoria S "^\\s*do" -t
    1.84 -;        indent .hilight.euphoria S "^\\s*entry" -t
    1.85 -;        
    1.86 -;        ; end of most statements
    1.87 -;        indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
    1.88 -;        indent .hilight.euphoria O "^\\s*end"         -t
    1.89 -;	
    1.90 -;	; Expressions at the end of a line - try with these
    1.91 -;	indent .hilight.euphoria c "[-+=*/<>]$" t
    1.92 -;		
    1.93 -;        ;indent .hilight.euphoria b "(" ")"
    1.94 -;	;indent .hilight.euphoria b "\\[" "\\]"
    1.95 -;	
    1.96 -;	; ignores
    1.97 -;        indent .hilight.euphoria i "--"
    1.98 -;	indent .hilight.euphoria e "\"" "\"" "\\"
    1.99 -;!endif
   1.100 +!if &sin "d" .fhook-euphoria.setup
   1.101 +    0 indent .hilight.euphoria 0 25
   1.102 +    
   1.103 +    indent .hilight.euphoria N "^\\s*override\\s*function" t
   1.104 +    indent .hilight.euphoria N "^\\s*global\\s*function" t
   1.105 +    indent .hilight.euphoria N "^\\s*public\\s*function" t
   1.106 +    indent .hilight.euphoria N "^\\s*export\\s*function" t
   1.107 +    indent .hilight.euphoria N "^\\s*function" t
   1.108 +    indent .hilight.euphoria N "^\\s*override\\s*procedure" t
   1.109 +    indent .hilight.euphoria N "^\\s*global\\s*procedure" t
   1.110 +    indent .hilight.euphoria N "^\\s*public\\s*procedure" t
   1.111 +    indent .hilight.euphoria N "^\\s*export\\s*procedure" t
   1.112 +    indent .hilight.euphoria N "^\\s*procedure" t
   1.113 +    indent .hilight.euphoria N "^\\s*global\\s*type" t
   1.114 +    indent .hilight.euphoria N "^\\s*public\\s*type" t
   1.115 +    indent .hilight.euphoria N "^\\s*export\\s*type" t
   1.116 +    
   1.117 +    ; if statement
   1.118 +    indent .hilight.euphoria N "^\\s*if" t
   1.119 +    indent .hilight.euphoria S "^\\s*elsif" -t
   1.120 +    indent .hilight.euphoria S "^\\s*else" -t
   1.121 +    indent .hilight.euphoria S "^\\s*then" -t
   1.122 +    
   1.123 +    ; ifdef statement
   1.124 +    indent .hilight.euphoria N "^\\s*ifdef" t
   1.125 +    indent .hilight.euphoria S "^\\s*elsifdef" -t
   1.126 +    
   1.127 +    ; switch statement
   1.128 +    indent .hilight.euphoria N "^\\s*switch" 2t
   1.129 +    indent .hilight.euphoria S "^\\s*case" -t
   1.130 +    
   1.131 +    ; loops
   1.132 +    indent .hilight.euphoria N "^\\s*while" t
   1.133 +    indent .hilight.euphoria N "^\\s*for" t
   1.134 +    indent .hilight.euphoria N "^\\s*loop" t
   1.135 +    indent .hilight.euphoria S "^\\s*do" -t
   1.136 +    indent .hilight.euphoria S "^\\s*entry" -t
   1.137 +    
   1.138 +    ; label
   1.139 +    indent .hilight.euphoria f "^\\s*label " 0
   1.140 +    
   1.141 +    ; end of most statements
   1.142 +    indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
   1.143 +    indent .hilight.euphoria O "^\\s*end"         -t
   1.144 +    
   1.145 +    ; Expressions at the end of a line - try with these
   1.146 +    indent .hilight.euphoria c "[-+=*/<>&]$" t
   1.147 +    
   1.148 +    ;indent .hilight.euphoria b "{" "}"
   1.149 +    indent .hilight.euphoria n "{" t
   1.150 +    indent .hilight.euphoria o "}" -t
   1.151 +    ;indent .hilight.euphoria b "(" ")"
   1.152 +    indent .hilight.euphoria n "(" t
   1.153 +    indent .hilight.euphoria o ")" -t
   1.154 +    
   1.155 +    ; ignores
   1.156 +    indent .hilight.euphoria i "--"
   1.157 +    indent .hilight.euphoria e "\"" "\"" "\\"
   1.158 +!endif
   1.159  
   1.160  buffer-init-fhook "euphoria"

SCM Home | OpenEuphoria.org Home