X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=runtime%2Fsyntax%2Focaml.yaml;h=006fbedf1d6c0f01072b95d9256415c3998fc18b;hb=54c23cae72d7237bc898a59f79aad0acffdf0ffe;hp=9fc0418df05cf878c1cae76412b19d0a6ec0510b;hpb=12d74b99e8f044aa3c336700a84470c1e0987478;p=micro.git diff --git a/runtime/syntax/ocaml.yaml b/runtime/syntax/ocaml.yaml index 9fc0418d..006fbedf 100644 --- a/runtime/syntax/ocaml.yaml +++ b/runtime/syntax/ocaml.yaml @@ -4,23 +4,42 @@ detect: filename: "\\.mli?$" rules: - # Numbers - ## Integers - ### Binary - - constant.number: "-?0[bB][01][01_]*" - ### Octal - - constant.number: "-?0[oO][0-7][0-7_]*" - ### Decimal - - constant.number: "-?\\d[\\d_]*" - ### Hexadecimal - - constant.number: "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*" - ## Real - ### Decimal - - constant.number: "-?\\d[\\d_]*.\\d[\\d_]*([eE][+-]\\d[\\d_]*.\\d[\\d_]*)?" - ### Hexadecimal - - constant.number: "-?0[xX][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*([pP][+-][0-9a-fA-F][0-9a-fA-F_]*.[0-9a-fA-F][0-9a-fA-F_]*)?" - # Comments + - identifier: "\\b[A-Z][0-9a-z_]{2,}\\b" + #declarations + - statement: "\\b(let|val|method|in|and|rec|private|virtual|constraint)\\b" + #structure items + - type: "\\b(type|open|class|module|exception|external)\\b" + #patterns + - statement: "\\b(fun|function|functor|match|try|with)\\b" + #patterns-modifiers + - statement: "\\b(as|when|of)\\b" + #conditions + - statement: "\\b(if|then|else)\\b" + #blocs + - type: "\\b(begin|end|object|struct|sig|for|while|do|done|to|downto)\\b" + #constantes + - constant.bool: "\\b(true|false)\\b" + #modules/classes + - special: "\\b(include|inherit|initializer)\\b" + #expr modifiers + - special: "\\b(new|ref|mutable|lazy|assert|raise)\\b" + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - constant.specialChar: "%." + - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" + - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" + - constant.string: + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "%." + - constant.specialChar: "\\\\[abfnrtv'\\\"\\\\]" + - constant.specialChar: "\\\\([0-7]{3}|x[A-Fa-f0-9]{2}|u[A-Fa-f0-9]{4}|U[A-Fa-f0-9]{8})" - comment: start: "\\(\\*" end: "\\*\\)" - rules: [] \ No newline at end of file + rules: []