types.ml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. type value =
  2. | Ident of string
  3. | Strlit of string
  4. | Uri of string
  5. | Concat of value list
  6. | Number of float
  7. | Unit of float * string
  8. | Function of string * value list
  9. | Hexcolor of string
  10. | Unop of string * value
  11. | Binop of value * string * value
  12. | Prio of value
  13. type declaration = string * value
  14. type selector = string list
  15. type statement =
  16. | Ruleset of selector list * declaration list
  17. (* <selectors> { <declarations> } *)
  18. | Media of string list * statement list
  19. (* @media <queries> { <rulesets> } *)
  20. | Import of string * string list
  21. (* @import "<file>" [<media>]; *)
  22. | Charset of string
  23. (* @charset "<charset>"; *)
  24. | Page of string option * declaration list
  25. (* @page [<pseudo_page>] { <declarations> } *)
  26. | Fontface of declaration list
  27. (* @font-face { <declarations> } *)
  28. | Namespace of string option * string
  29. (* @namespace [<prefix>] "<uri>"; *)
  30. (* TODO: @document, @keyframes, @supports *)
  31. type stylesheet = statement list
  32. type args = {
  33. mutable infiles : string list;
  34. mutable outfile : string option;
  35. mutable verbose : int;
  36. }
  37. type loc = string * int * int * int * int
  38. exception SyntaxError of string
  39. exception LocError of loc * string