editors

changeset 4:57c8640e8997

* MicroEmacs syntax file
author Jeremy Cowgar <jeremy@cowgar.com>
date Sat Aug 29 16:16:23 2009 +0000 (2009-08-29)
parents 603a2c2dcf01
children 0043259df2a1
files microemacs/hkeuphoria.emf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/microemacs/hkeuphoria.emf	Sat Aug 29 16:16:23 2009 +0000
     1.3 @@ -0,0 +1,164 @@
     1.4 +; -!- emf -!-
     1.5 +;
     1.6 +; Created:     2008-06-21
     1.7 +; Synopsis:    Euphoria mode hook
     1.8 +; Authors:     Jeremy Cowgar
     1.9 +;
    1.10 +
    1.11 +define-macro fhook-euphoria
    1.12 +    set-variable $buffer-mask "luh1"
    1.13 +    @# buffer-init "euphoria"
    1.14 +    buffer-init-hooks
    1.15 +!emacro
    1.16 +
    1.17 +; buffer-init variables
    1.18 +set-variable .fhook-euphoria.setup &reg "/history/fhook/euphoria" "bdfghnopxlqv"
    1.19 +set-variable .fhook-euphoria.setup-mask "abdefghikmnoptuxclqrvy"
    1.20 +set-variable .fhook-euphoria.comment "|--||--|-- | --|r|"
    1.21 +
    1.22 +; Setup collapse
    1.23 +set-variable .fhook-euphoria.collapse-open "^procedure\\|^global\\s*procedure\\|^export\\s*procedure"
    1.24 +set-variable .fhook-euphoria.collapse-close "^end"
    1.25 +
    1.26 +; Setup item-list
    1.27 +set-variable .fhook-euphoria.item-list-s1 "^\\s*global\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.28 +set-variable .fhook-euphoria.item-list-r1 "GlobProc \ecB\\1\ecA"
    1.29 +set-variable .fhook-euphoria.item-list-s2 "^\\s*global\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.30 +set-variable .fhook-euphoria.item-list-r2 "GlobFunc \ecB\\1\ecA"
    1.31 +set-variable .fhook-euphoria.item-list-s3 "^\\s*global\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.32 +set-variable .fhook-euphoria.item-list-r3 "GlobType \ecB\\1\ecA"
    1.33 +set-variable .fhook-euphoria.item-list-s4 "^\\s*export\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.34 +set-variable .fhook-euphoria.item-list-r4 "ExptProc \ecB\\1\ecA"
    1.35 +set-variable .fhook-euphoria.item-list-s5 "^\\s*export\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.36 +set-variable .fhook-euphoria.item-list-r5 "ExptFunc \ecB\\1\ecA"
    1.37 +set-variable .fhook-euphoria.item-list-s6 "^\\s*export\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.38 +set-variable .fhook-euphoria.item-list-r6 "ExptType \ecB\\1\ecA"
    1.39 +set-variable .fhook-euphoria.item-list-s7 "^\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.40 +set-variable .fhook-euphoria.item-list-r7 "LoclProc \ecB\\1\ecA"
    1.41 +set-variable .fhook-euphoria.item-list-s8 "^\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.42 +set-variable .fhook-euphoria.item-list-r8 "LoclFunc \ecB\\1\ecA"
    1.43 +set-variable .fhook-euphoria.item-list-s9 "^\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    1.44 +set-variable .fhook-euphoria.item-list-r9 "LoclType \ecB\\1\ecA"
    1.45 +
    1.46 +!if &not &exist .hilight.euphoria
    1.47 +    set-variable .hilight.euphoria &pinc .hilight.next 1
    1.48 +!endif
    1.49 +!if &and &sin "h" .fhook-euphoria.setup &band .hilight.flags 0x02 
    1.50 +    0 hilight .hilight.euphoria 1 $global-scheme
    1.51 +    
    1.52 +    hilight .hilight.euphoria 2 "^#!/"                   .scheme.header
    1.53 +    hilight .hilight.euphoria 2 "--"                     .scheme.comment
    1.54 +    hilight .hilight.euphoria 4 "\"" "\"" "\\"           .scheme.string
    1.55 +    hilight .hilight.euphoria 4 "'" "'" "\\"             .scheme.string
    1.56 +    
    1.57 +    hilight .hilight.euphoria 1 "as"                     .scheme.keyword
    1.58 +    hilight .hilight.euphoria 1 "and"                    .scheme.keyword
    1.59 +    hilight .hilight.euphoria 1 "break"                  .scheme.keyword
    1.60 +    hilight .hilight.euphoria 1 "by"                     .scheme.keyword
    1.61 +    hilight .hilight.euphoria 1 "case"                   .scheme.keyword
    1.62 +    hilight .hilight.euphoria 1 "constant"               .scheme.keyword
    1.63 +    hilight .hilight.euphoria 1 "continue"               .scheme.keyword
    1.64 +    hilight .hilight.euphoria 1 "do"                     .scheme.keyword
    1.65 +    hilight .hilight.euphoria 1 "end"                    .scheme.keyword
    1.66 +    hilight .hilight.euphoria 1 "else"                   .scheme.keyword
    1.67 +    hilight .hilight.euphoria 1 "elsif"                  .scheme.keyword
    1.68 +    hilight .hilight.euphoria 1 "exit"                   .scheme.keyword
    1.69 +    hilight .hilight.euphoria 1 "entry"                  .scheme.keyword
    1.70 +    hilight .hilight.euphoria 1 "enum"                   .scheme.keyword
    1.71 +    hilight .hilight.euphoria 1 "for"                    .scheme.keyword
    1.72 +    hilight .hilight.euphoria 1 "function"               .scheme.keyword
    1.73 +    hilight .hilight.euphoria 1 "include"                .scheme.keyword
    1.74 +    hilight .hilight.euphoria 1 "if"                     .scheme.keyword
    1.75 +    hilight .hilight.euphoria 1 "label"                  .scheme.keyword
    1.76 +    hilight .hilight.euphoria 1 "not"                    .scheme.keyword
    1.77 +    hilight .hilight.euphoria 1 "or"                     .scheme.keyword
    1.78 +    hilight .hilight.euphoria 1 "procedure"              .scheme.keyword
    1.79 +    hilight .hilight.euphoria 1 "return"                 .scheme.keyword
    1.80 +    hilight .hilight.euphoria 1 "retry"                  .scheme.keyword
    1.81 +    hilight .hilight.euphoria 1 "switch"                 .scheme.keyword
    1.82 +    hilight .hilight.euphoria 1 "then"                   .scheme.keyword
    1.83 +    hilight .hilight.euphoria 1 "type"                   .scheme.keyword
    1.84 +    hilight .hilight.euphoria 1 "to"                     .scheme.keyword
    1.85 +    hilight .hilight.euphoria 1 "while"                  .scheme.keyword
    1.86 +    hilight .hilight.euphoria 1 "xor"                    .scheme.keyword
    1.87 +    
    1.88 +    hilight .hilight.euphoria 1 "global"                 .scheme.type
    1.89 +    hilight .hilight.euphoria 1 "export"                 .scheme.type
    1.90 +    hilight .hilight.euphoria 1 "atom"                   .scheme.type
    1.91 +    hilight .hilight.euphoria 1 "integer"                .scheme.type
    1.92 +    hilight .hilight.euphoria 1 "sequence"               .scheme.type
    1.93 +    hilight .hilight.euphoria 1 "object"                 .scheme.type
    1.94 +    
    1.95 +    hilight .hilight.euphoria 1 "ifdef"                  .scheme.prepro
    1.96 +    hilight .hilight.euphoria 1 "elsifdef"               .scheme.prepro
    1.97 +    hilight .hilight.euphoria 1 "with"                   .scheme.prepro
    1.98 +    hilight .hilight.euphoria 1 "without"                .scheme.prepro
    1.99 +    
   1.100 +    hilight .hilight.euphoria 0 "\\+"                    .scheme.operator
   1.101 +    hilight .hilight.euphoria 0 "-"                      .scheme.operator
   1.102 +    hilight .hilight.euphoria 0 "\\*"                    .scheme.operator
   1.103 +    hilight .hilight.euphoria 0 "/"                      .scheme.operator
   1.104 +    hilight .hilight.euphoria 0 "="                      .scheme.operator
   1.105 +    hilight .hilight.euphoria 0 ">"                      .scheme.operator
   1.106 +    hilight .hilight.euphoria 0 "<"                      .scheme.operator
   1.107 +    hilight .hilight.euphoria 0 "\\.\\."                 .scheme.operator
   1.108 +    hilight .hilight.euphoria 0 "[[]"                    .scheme.operator
   1.109 +    hilight .hilight.euphoria 0 "[]]"                    .scheme.operator
   1.110 +    
   1.111 +    !if &band .hilight.flags 0x08
   1.112 +        ; Hilight numbers
   1.113 +        hilight .hilight.euphoria 1 "[[:digit:]]+"       .scheme.constant
   1.114 +        hilight .hilight.euphoria 1 "-[[:digit:]]+"      .scheme.constant
   1.115 +        hilight .hilight.euphoria 1 "0[xX][[:digit:]]+"  .scheme.constant
   1.116 +    !endif
   1.117 +!endif
   1.118 +
   1.119 +!if &sin "d" .fhook-euphoria.setup
   1.120 +	0 indent .hilight.euphoria 0 25
   1.121 +        
   1.122 +        indent .hilight.euphoria N "^\\s*global\\s*function" t
   1.123 +        indent .hilight.euphoria N "^\\s*export\\s*function" t
   1.124 +        indent .hilight.euphoria N "^\\s*function" t
   1.125 +        indent .hilight.euphoria N "^\\s*global\\s*procedure" t
   1.126 +        indent .hilight.euphoria N "^\\s*export\\s*procedure" t
   1.127 +        indent .hilight.euphoria N "^\\s*procedure" t
   1.128 +        indent .hilight.euphoria N "^\\s*global\\s*type" t
   1.129 +        indent .hilight.euphoria N "^\\s*export\\s*type" t
   1.130 +        
   1.131 +        ; if statement
   1.132 +        indent .hilight.euphoria N "^\\s*if" t
   1.133 +        indent .hilight.euphoria S "^\\s*elsif" -t
   1.134 +        indent .hilight.euphoria S "^\\s*else" -t
   1.135 +	indent .hilight.euphoria S "^\\s*then" -t
   1.136 +        
   1.137 +        ; ifdef statement
   1.138 +        indent .hilight.euphoria N "^\\s*ifdef" t
   1.139 +        indent .hilight.euphoria S "^\\s*elsifdef" -t
   1.140 +        
   1.141 +        ; switch statement
   1.142 +        indent .hilight.euphoria N "^\\s*switch" 2t
   1.143 +        indent .hilight.euphoria S "^\\s*case" -t
   1.144 +        
   1.145 +        ; loops
   1.146 +	indent .hilight.euphoria N "^\\s*while" t
   1.147 +        indent .hilight.euphoria N "^\\s*for" t
   1.148 +        indent .hilight.euphoria N "^\\s*loop" t
   1.149 +        indent .hilight.euphoria S "^\\s*do" -t
   1.150 +        indent .hilight.euphoria S "^\\s*entry" -t
   1.151 +        
   1.152 +        ; end of most statements
   1.153 +        indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
   1.154 +        indent .hilight.euphoria O "^\\s*end"         -t
   1.155 +	
   1.156 +	; Expressions at the end of a line - try with these
   1.157 +	indent .hilight.euphoria c "[-+=*/<>]$" t
   1.158 +		
   1.159 +        ;indent .hilight.euphoria b "(" ")"
   1.160 +	;indent .hilight.euphoria b "\\[" "\\]"
   1.161 +	
   1.162 +	; ignores
   1.163 +        indent .hilight.euphoria i "--"
   1.164 +	indent .hilight.euphoria e "\"" "\"" "\\"
   1.165 +!endif
   1.166 +
   1.167 +buffer-init-fhook "euphoria"

SCM Home | OpenEuphoria.org Home