]> matita.cs.unibo.it Git - helm.git/blobdiff - helm/software/components/content_pres/cicNotationLexer.ml
support for mathml mpadded tag added (allows to overlap two subsequent symbols);...
[helm.git] / helm / software / components / content_pres / cicNotationLexer.ml
index f80821a5f1b6562cb77f7fe55f0bb7d62ffc0d42..11fcc4106d812e643df6f83151657612e8110fbd 100644 (file)
@@ -31,8 +31,10 @@ exception Error of int * int * string
 
 let regexp number = xml_digit+
 let regexp utf8_blank = " " | "\r\n" | "\n" | "\t" | [160] (* this is a nbsp *)
+let regexp percentage = 
+  ('-' | "") [ '0' - '9' ] + '%'
 let regexp floatwithunit = 
-  [ '0' - '9' ] + ["."] [ '0' - '9' ] + ([ 'a' - 'z' ] + | "" )
+  ('-' | "") [ '0' - '9' ] + ["."] [ '0' - '9' ] + ([ 'a' - 'z' ] + | "" )
 let regexp color = "#" [ '0' - '9' 'a' - 'f' 'A' - 'F' ] [ '0' - '9' 'a' - 'f'
 'A' - 'F' ] [ '0' - '9' 'a' - 'f' 'A' - 'F' ] [ '0' - '9' 'a' - 'f' 'A' - 'F' ]
 [ '0' - '9' 'a' - 'f' 'A' - 'F' ] [ '0' - '9' 'a' - 'f' 'A' - 'F' ]
@@ -103,7 +105,7 @@ let level1_keywords =
     "break";
     "list0"; "list1"; "sep";
     "opt";
-    "term"; "ident"; "number"; "mstyle"
+    "term"; "ident"; "number"; "mstyle" ; "mpadded"
   ] @ level1_layouts
 
 let level2_meta_keywords =
@@ -346,6 +348,8 @@ and level1_pattern_token =
            return lexbuf ("IDENT", s)
        end
   | color -> return lexbuf ("COLOR", Ulexing.utf8_lexeme lexbuf)
+  | percentage -> 
+      return lexbuf ("PERCENTAGE", Ulexing.utf8_lexeme lexbuf)
   | floatwithunit -> 
       return lexbuf ("FLOATWITHUNIT", Ulexing.utf8_lexeme lexbuf)
   | tex_token -> return lexbuf (expand_macro lexbuf)