This repo contains code to mirror other repos. It also contains the code that is getting mirrored.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
684 B

  1. //
  2. // Numbers
  3. //
  4. DIGIT: "0".."9"
  5. HEXDIGIT: "a".."f"|"A".."F"|DIGIT
  6. INT: DIGIT+
  7. SIGNED_INT: ["+"|"-"] INT
  8. DECIMAL: INT "." INT? | "." INT
  9. // float = /-?\d+(\.\d+)?([eE][+-]?\d+)?/
  10. _EXP: ("e"|"E") SIGNED_INT
  11. FLOAT: INT _EXP | DECIMAL _EXP?
  12. SIGNED_FLOAT: ["+"|"-"] FLOAT
  13. NUMBER: FLOAT | INT
  14. SIGNED_NUMBER: ["+"|"-"] NUMBER
  15. //
  16. // Strings
  17. //
  18. STRING_INNER: ("\\\""|/[^"]/)
  19. ESCAPED_STRING: "\"" STRING_INNER* "\""
  20. //
  21. // Names (Variables)
  22. //
  23. LCASE_LETTER: "a".."z"
  24. UCASE_LETTER: "A".."Z"
  25. LETTER: UCASE_LETTER | LCASE_LETTER
  26. WORD: LETTER+
  27. CNAME: ("_"|LETTER) ("_"|LETTER|DIGIT)*
  28. //
  29. // Whitespace
  30. //
  31. WS_INLINE: (" "|/\t/)+
  32. WS: /[ \t\f\r\n]/+
  33. CR : /\r/
  34. LF : /\n/
  35. NEWLINE: (CR? LF)+