editors

changeset 7:49a966f41395

* Updated for latest 4.0 syntax (0x, 0b, 0t, 0d), `...`, """...""", /* ... */
* Added hketml, which is Euphoria embedded into HTML (eTML).
author Jeremy Cowgar <jeremy@cowgar.com>
date Mon Sep 07 01:15:48 2009 +0000 (2009-09-07)
parents 112d2cc947cf
children 1a74a3ba12ca
files microemacs/hketml.emf microemacs/hkeuphoria.emf
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/microemacs/hketml.emf	Mon Sep 07 01:15:48 2009 +0000
     1.3 @@ -0,0 +1,48 @@
     1.4 +; -!- emf -!-
     1.5 +; This is part of the JASSPA MicroEmacs macro files
     1.6 +; Copyright (C) 2009 JASSPA (www.jasspa.com)
     1.7 +; See the file me.emf for copying and conditions
     1.8 +;
     1.9 +; Created:    Sun Sep 6 2009
    1.10 +; Synopsis:   Euphoria Text Mark Up Language
    1.11 +; Authors:    Jeremy Cowgar
    1.12 +;
    1.13 +define-macro fhook-etml
    1.14 +    set-variable $buffer-mask "luh1"
    1.15 +    @# buffer-init "etml"
    1.16 +    buffer-init-hooks
    1.17 +!emacro
    1.18 +
    1.19 +; buffer-init variables
    1.20 +set-variable .fhook-etml.name "eTML"
    1.21 +set-variable .fhook-etml.setup &reg "/history/fhook/etml" "cdghinopsx"
    1.22 +set-variable .fhook-etml.setup-mask "acdeghikmnopstux"
    1.23 +set-variable .fhook-etml.command-flag  "|"
    1.24 +set-variable .fhook-etml.command-name  "|"
    1.25 +set-variable .fhook-etml.command-nbind "|"
    1.26 +set-variable .fhook-etml.command-kbind "|"
    1.27 +set-variable .fhook-etml.command-desc  "|"
    1.28 +set-variable .fhook-etml.indent-width 2
    1.29 +
    1.30 +; load in euphoria & the html core
    1.31 +!if &not &exist fhook-euphoria
    1.32 +    !force exec-file "hkeuphoria"
    1.33 +!endif
    1.34 +!force execute-file "htmlcore" "etml" 
    1.35 +
    1.36 +; add the <% %> euphoria support
    1.37 +!if &and &sin "h" .fhook-etml.setup &band .hilight.flags 0x02 
    1.38 +    ;hilight .hilight.etmltag 4 "=\\{[^ \t\n<>]*<%" "\\?>[^ \t\n>]*" "%>"  .scheme.string
    1.39 +    ;hilight .hilight.etmltag 4 "=\\{\"[^\"\n<]*<%" "\\?>[^\"]*\"" "%>"  .scheme.string
    1.40 +    !if &exist .hilight.euphoria
    1.41 +        hilight .hilight.etml     0x80 "<%" .hilight.euscript .scheme.prepro
    1.42 +        hilight .hilight.etmltag  0x80 "<%" .hilight.euscript .scheme.prepro
    1.43 +        hilight .hilight.euscript 0x80 "%>" 0 .scheme.prepro
    1.44 +        hilight .hilight.etml     0x80 "<%" .hilight.euscript .scheme.prepro
    1.45 +        hilight .hilight.etmltag  0x80 "<%" .hilight.euscript .scheme.prepro
    1.46 +        hilight .hilight.euscript 0x80 "%>" 0 .scheme.prepro
    1.47 +    !endif
    1.48 +!endif
    1.49 +
    1.50 +buffer-init-fhook "etml"
    1.51 +
     2.1 --- a/microemacs/hkeuphoria.emf	Sat Aug 29 18:41:55 2009 +0000
     2.2 +++ b/microemacs/hkeuphoria.emf	Mon Sep 07 01:15:48 2009 +0000
     2.3 @@ -1,7 +1,8 @@
     2.4  ; -!- emf -!-
     2.5  ;
     2.6  ; Created:     2008-06-21
     2.7 -; Synopsis:    Euphoria mode hook
     2.8 +; Modified:    2009-09-06
     2.9 +; Synopsis:    Euphoria 4.0 mode hook
    2.10  ; Authors:     Jeremy Cowgar
    2.11  ;
    2.12  
    2.13 @@ -14,31 +15,17 @@
    2.14  ; buffer-init variables
    2.15  set-variable .fhook-euphoria.setup &reg "/history/fhook/euphoria" "bdfghnopxlqv"
    2.16  set-variable .fhook-euphoria.setup-mask "abdefghikmnoptuxclqrvy"
    2.17 -set-variable .fhook-euphoria.comment "|--||--|-- | --|r|"
    2.18 +set-variable .fhook-euphoria.comment "|/*| */|*| * | * |fr|"
    2.19 +set-variable .fhook-euphoria.comment-1 "|--||--|-- | --|r|"
    2.20 +set-variable .fhook-euphoria.indent-width 4
    2.21  
    2.22  ; Setup collapse
    2.23 -set-variable .fhook-euphoria.collapse-open "^procedure\\|^global\\s*procedure\\|^export\\s*procedure"
    2.24 -set-variable .fhook-euphoria.collapse-close "^end"
    2.25 +set-variable .fhook-euphoria.collapse-open "^\\s*\\(global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    2.26 +set-variable .fhook-euphoria.collapse-close "^\\s*end\\s+\\(function\\|procedure\\|type\\)"
    2.27  
    2.28  ; Setup item-list
    2.29 -set-variable .fhook-euphoria.item-list-s1 "^\\s*global\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.30 -set-variable .fhook-euphoria.item-list-r1 "GlobProc \ecB\\1\ecA"
    2.31 -set-variable .fhook-euphoria.item-list-s2 "^\\s*global\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.32 -set-variable .fhook-euphoria.item-list-r2 "GlobFunc \ecB\\1\ecA"
    2.33 -set-variable .fhook-euphoria.item-list-s3 "^\\s*global\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.34 -set-variable .fhook-euphoria.item-list-r3 "GlobType \ecB\\1\ecA"
    2.35 -set-variable .fhook-euphoria.item-list-s4 "^\\s*export\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.36 -set-variable .fhook-euphoria.item-list-r4 "ExptProc \ecB\\1\ecA"
    2.37 -set-variable .fhook-euphoria.item-list-s5 "^\\s*export\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.38 -set-variable .fhook-euphoria.item-list-r5 "ExptFunc \ecB\\1\ecA"
    2.39 -set-variable .fhook-euphoria.item-list-s6 "^\\s*export\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.40 -set-variable .fhook-euphoria.item-list-r6 "ExptType \ecB\\1\ecA"
    2.41 -set-variable .fhook-euphoria.item-list-s7 "^\\s*procedure\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.42 -set-variable .fhook-euphoria.item-list-r7 "LoclProc \ecB\\1\ecA"
    2.43 -set-variable .fhook-euphoria.item-list-s8 "^\\s*function\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.44 -set-variable .fhook-euphoria.item-list-r8 "LoclFunc \ecB\\1\ecA"
    2.45 -set-variable .fhook-euphoria.item-list-s9 "^\\s*type\\s+\\(\\w[1-9A-Za-z_]*\\)"
    2.46 -set-variable .fhook-euphoria.item-list-r9 "LoclType \ecB\\1\ecA"
    2.47 +set-variable .fhook-euphoria.item-list-s1 "^\\s*\\(global\\|public\\|export\\)?\\s*\\(function\\|procedure\\|type\\)\\s+\\(\\w+\\)"
    2.48 +set-variable .fhook-euphoria.item-list-r1 "\\1 \\2 \ecB\\3\ecA"
    2.49  
    2.50  !if &not &exist .hilight.euphoria
    2.51      set-variable .hilight.euphoria &pinc .hilight.next 1
    2.52 @@ -46,10 +33,24 @@
    2.53  !if &and &sin "h" .fhook-euphoria.setup &band .hilight.flags 0x02 
    2.54      0 hilight .hilight.euphoria 1 $global-scheme
    2.55      
    2.56 -    hilight .hilight.euphoria 2 "^#!/"                   .scheme.header
    2.57 -    hilight .hilight.euphoria 2 "--"                     .scheme.comment
    2.58 -    hilight .hilight.euphoria 4 "\"" "\"" "\\"           .scheme.string
    2.59 -    hilight .hilight.euphoria 4 "'" "'" "\\"             .scheme.string
    2.60 +    hilight .hilight.euphoria  2 "^#!/"                  .scheme.header
    2.61 +    hilight .hilight.euphoria  2 "--"                    .scheme.comment
    2.62 +    hilight .hilight.euphoria 20 "/\\*" "*/" ""          .scheme.comment
    2.63 +    hilight .hilight.euphoria  4 "\"" "\"" "\\"          .scheme.string
    2.64 +    hilight .hilight.euphoria  4 "'" "'" "\\"            .scheme.string
    2.65 +    hilight .hilight.euphoria  4 "`" "`" ""              .scheme.string
    2.66 +    hilight .hilight.euphoria  4 "\"\"\"" "\"\"\"" ""    .scheme.string   
    2.67 +    
    2.68 +    hilight .hilight.euphoria 1 "export"                 .scheme.keyword
    2.69 +    hilight .hilight.euphoria 1 "public"                 .scheme.keyword
    2.70 +    hilight .hilight.euphoria 1 "global"                 .scheme.keyword
    2.71 +    hilight .hilight.euphoria 1 "override"               .scheme.keyword
    2.72 +    
    2.73 +    hilight .hilight.euphoria 1 "object"                 .scheme.type
    2.74 +    hilight .hilight.euphoria 1 "sequence"               .scheme.type
    2.75 +    hilight .hilight.euphoria 1 "integer"                .scheme.type
    2.76 +    hilight .hilight.euphoria 1 "atom"                   .scheme.type
    2.77 +    hilight .hilight.euphoria 1 "enum"                   .scheme.type
    2.78      
    2.79      hilight .hilight.euphoria 1 "as"                     .scheme.keyword
    2.80      hilight .hilight.euphoria 1 "and"                    .scheme.keyword
    2.81 @@ -64,12 +65,11 @@
    2.82      hilight .hilight.euphoria 1 "elsif"                  .scheme.keyword
    2.83      hilight .hilight.euphoria 1 "exit"                   .scheme.keyword
    2.84      hilight .hilight.euphoria 1 "entry"                  .scheme.keyword
    2.85 -    hilight .hilight.euphoria 1 "enum"                   .scheme.keyword
    2.86      hilight .hilight.euphoria 1 "for"                    .scheme.keyword
    2.87      hilight .hilight.euphoria 1 "function"               .scheme.keyword
    2.88 -    hilight .hilight.euphoria 1 "include"                .scheme.keyword
    2.89      hilight .hilight.euphoria 1 "if"                     .scheme.keyword
    2.90      hilight .hilight.euphoria 1 "label"                  .scheme.keyword
    2.91 +    hilight .hilight.euphoria 1 "loop"                   .scheme.keyword
    2.92      hilight .hilight.euphoria 1 "not"                    .scheme.keyword
    2.93      hilight .hilight.euphoria 1 "or"                     .scheme.keyword
    2.94      hilight .hilight.euphoria 1 "procedure"              .scheme.keyword
    2.95 @@ -80,17 +80,16 @@
    2.96      hilight .hilight.euphoria 1 "type"                   .scheme.keyword
    2.97      hilight .hilight.euphoria 1 "to"                     .scheme.keyword
    2.98      hilight .hilight.euphoria 1 "while"                  .scheme.keyword
    2.99 +    hilight .hilight.euphoria 1 "until"                  .scheme.keyword
   2.100      hilight .hilight.euphoria 1 "xor"                    .scheme.keyword
   2.101      
   2.102 -    hilight .hilight.euphoria 1 "global"                 .scheme.type
   2.103 -    hilight .hilight.euphoria 1 "export"                 .scheme.type
   2.104 -    hilight .hilight.euphoria 1 "atom"                   .scheme.type
   2.105 -    hilight .hilight.euphoria 1 "integer"                .scheme.type
   2.106 -    hilight .hilight.euphoria 1 "sequence"               .scheme.type
   2.107 -    hilight .hilight.euphoria 1 "object"                 .scheme.type
   2.108 -    
   2.109 +    hilight .hilight.euphoria 1 "elsedef"                .scheme.prepro
   2.110 +    hilight .hilight.euphoria 1 "elsifdef"               .scheme.prepro
   2.111 +    hilight .hilight.euphoria 1 "end ifdef"              .scheme.prepro
   2.112      hilight .hilight.euphoria 1 "ifdef"                  .scheme.prepro
   2.113 -    hilight .hilight.euphoria 1 "elsifdef"               .scheme.prepro
   2.114 +    hilight .hilight.euphoria 1 "include"                .scheme.prepro
   2.115 +    hilight .hilight.euphoria 1 "namespace"              .scheme.prepro
   2.116 +    hilight .hilight.euphoria 1 "trace"                  .scheme.prepro
   2.117      hilight .hilight.euphoria 1 "with"                   .scheme.prepro
   2.118      hilight .hilight.euphoria 1 "without"                .scheme.prepro
   2.119      
   2.120 @@ -105,60 +104,69 @@
   2.121      hilight .hilight.euphoria 0 "[[]"                    .scheme.operator
   2.122      hilight .hilight.euphoria 0 "[]]"                    .scheme.operator
   2.123      
   2.124 -    !if &band .hilight.flags 0x08
   2.125 -        ; Hilight numbers
   2.126 -        hilight .hilight.euphoria 1 "[[:digit:]]+"       .scheme.constant
   2.127 -        hilight .hilight.euphoria 1 "-[[:digit:]]+"      .scheme.constant
   2.128 -        hilight .hilight.euphoria 1 "0[xX][[:digit:]]+"  .scheme.constant
   2.129 -    !endif
   2.130 +    hilight .hilight.euphoria 1 "[A-Z][A-Z0-9]+"         .scheme.constant
   2.131 +    
   2.132 +    ; Hilight numbers
   2.133 +    hilight .hilight.euphoria 1 "[[:digit:]_]+"          .scheme.constant
   2.134 +    hilight .hilight.euphoria 1 "-[[:digit:]_]+"         .scheme.constant
   2.135 +    hilight .hilight.euphoria 1 "0b[01_]+"               .scheme.constant
   2.136 +    hilight .hilight.euphoria 1 "0t[0-7_]+"              .scheme.constant
   2.137 +    hilight .hilight.euphoria 1 "0d[0-9_]+"              .scheme.constant
   2.138 +    hilight .hilight.euphoria 1 "0x[0-9A-Fa-f_]+"        .scheme.constant
   2.139 +    hilight .hilight.euphoria 1 "#[0-9A-Fa-f_]+"         .scheme.constant
   2.140 +    
   2.141 +    hilight .hilight.euphoria 1 "[A-Z_][A-Z0-9_]+"       .scheme.constant
   2.142 +    
   2.143 +    ; Allow Euphoria to be embedded in other languages
   2.144 +    set-variable .hilight.euscript .hilight.euphoria
   2.145  !endif
   2.146  
   2.147 -!if &sin "d" .fhook-euphoria.setup
   2.148 -	0 indent .hilight.euphoria 0 25
   2.149 -        
   2.150 -        indent .hilight.euphoria N "^\\s*global\\s*function" t
   2.151 -        indent .hilight.euphoria N "^\\s*export\\s*function" t
   2.152 -        indent .hilight.euphoria N "^\\s*function" t
   2.153 -        indent .hilight.euphoria N "^\\s*global\\s*procedure" t
   2.154 -        indent .hilight.euphoria N "^\\s*export\\s*procedure" t
   2.155 -        indent .hilight.euphoria N "^\\s*procedure" t
   2.156 -        indent .hilight.euphoria N "^\\s*global\\s*type" t
   2.157 -        indent .hilight.euphoria N "^\\s*export\\s*type" t
   2.158 -        
   2.159 -        ; if statement
   2.160 -        indent .hilight.euphoria N "^\\s*if" t
   2.161 -        indent .hilight.euphoria S "^\\s*elsif" -t
   2.162 -        indent .hilight.euphoria S "^\\s*else" -t
   2.163 -	indent .hilight.euphoria S "^\\s*then" -t
   2.164 -        
   2.165 -        ; ifdef statement
   2.166 -        indent .hilight.euphoria N "^\\s*ifdef" t
   2.167 -        indent .hilight.euphoria S "^\\s*elsifdef" -t
   2.168 -        
   2.169 -        ; switch statement
   2.170 -        indent .hilight.euphoria N "^\\s*switch" 2t
   2.171 -        indent .hilight.euphoria S "^\\s*case" -t
   2.172 -        
   2.173 -        ; loops
   2.174 -	indent .hilight.euphoria N "^\\s*while" t
   2.175 -        indent .hilight.euphoria N "^\\s*for" t
   2.176 -        indent .hilight.euphoria N "^\\s*loop" t
   2.177 -        indent .hilight.euphoria S "^\\s*do" -t
   2.178 -        indent .hilight.euphoria S "^\\s*entry" -t
   2.179 -        
   2.180 -        ; end of most statements
   2.181 -        indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
   2.182 -        indent .hilight.euphoria O "^\\s*end"         -t
   2.183 -	
   2.184 -	; Expressions at the end of a line - try with these
   2.185 -	indent .hilight.euphoria c "[-+=*/<>]$" t
   2.186 -		
   2.187 -        ;indent .hilight.euphoria b "(" ")"
   2.188 -	;indent .hilight.euphoria b "\\[" "\\]"
   2.189 -	
   2.190 -	; ignores
   2.191 -        indent .hilight.euphoria i "--"
   2.192 -	indent .hilight.euphoria e "\"" "\"" "\\"
   2.193 -!endif
   2.194 +;!if &sin "d" .fhook-euphoria.setup
   2.195 +;	0 indent .hilight.euphoria 0 25
   2.196 +;        
   2.197 +;        indent .hilight.euphoria N "^\\s*global\\s*function" t
   2.198 +;        indent .hilight.euphoria N "^\\s*export\\s*function" t
   2.199 +;        indent .hilight.euphoria N "^\\s*function" t
   2.200 +;        indent .hilight.euphoria N "^\\s*global\\s*procedure" t
   2.201 +;        indent .hilight.euphoria N "^\\s*export\\s*procedure" t
   2.202 +;        indent .hilight.euphoria N "^\\s*procedure" t
   2.203 +;        indent .hilight.euphoria N "^\\s*global\\s*type" t
   2.204 +;        indent .hilight.euphoria N "^\\s*export\\s*type" t
   2.205 +;        
   2.206 +;        ; if statement
   2.207 +;        indent .hilight.euphoria N "^\\s*if" t
   2.208 +;        indent .hilight.euphoria S "^\\s*elsif" -t
   2.209 +;        indent .hilight.euphoria S "^\\s*else" -t
   2.210 +;	indent .hilight.euphoria S "^\\s*then" -t
   2.211 +;        
   2.212 +;        ; ifdef statement
   2.213 +;        indent .hilight.euphoria N "^\\s*ifdef" t
   2.214 +;        indent .hilight.euphoria S "^\\s*elsifdef" -t
   2.215 +;        
   2.216 +;        ; switch statement
   2.217 +;        indent .hilight.euphoria N "^\\s*switch" 2t
   2.218 +;        indent .hilight.euphoria S "^\\s*case" -t
   2.219 +;        
   2.220 +;        ; loops
   2.221 +;	indent .hilight.euphoria N "^\\s*while" t
   2.222 +;        indent .hilight.euphoria N "^\\s*for" t
   2.223 +;        indent .hilight.euphoria N "^\\s*loop" t
   2.224 +;        indent .hilight.euphoria S "^\\s*do" -t
   2.225 +;        indent .hilight.euphoria S "^\\s*entry" -t
   2.226 +;        
   2.227 +;        ; end of most statements
   2.228 +;        indent .hilight.euphoria O "^\\s*end\\s+switch" -2t
   2.229 +;        indent .hilight.euphoria O "^\\s*end"         -t
   2.230 +;	
   2.231 +;	; Expressions at the end of a line - try with these
   2.232 +;	indent .hilight.euphoria c "[-+=*/<>]$" t
   2.233 +;		
   2.234 +;        ;indent .hilight.euphoria b "(" ")"
   2.235 +;	;indent .hilight.euphoria b "\\[" "\\]"
   2.236 +;	
   2.237 +;	; ignores
   2.238 +;        indent .hilight.euphoria i "--"
   2.239 +;	indent .hilight.euphoria e "\"" "\"" "\\"
   2.240 +;!endif
   2.241  
   2.242  buffer-init-fhook "euphoria"

SCM Home | OpenEuphoria.org Home