"Fossies" - the Fresh Open Source Software Archive

Member "hevea-2.35/lexattr.mll" (16 Jan 2021, 619 Bytes) of package /linux/www/hevea-2.35.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 let blank = [' ' '\t' '\n' '\r']
    2 
    3 rule add_style_acc acc style flag = parse
    4   | ("style"|"STYLE") blank* "=" blank*
    5       (('\'' ([^'\'']* as v) '\''
    6            | '"' ([^'"']* as v) '"'
    7            | ('#'?['a' - 'z' 'A' - 'Z' '0' - '9' '-' '+' '_' ':' '.']+ as v)))
    8 (* '"' *)
    9  {
   10     add_style_acc
   11       (Printf.sprintf "%s style=\"%s;%s\"" acc v style) style true lexbuf
   12  }
   13   | _ as v { add_style_acc (acc ^ (String.make 1 v)) style flag lexbuf }
   14   | eof { if flag then acc else Printf.sprintf "%s style=\"%s\"" acc style}
   15 
   16 {
   17   let add_style style attrs =
   18     add_style_acc "" style false (MyLexing.from_string attrs)
   19 }