X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;ds=sidebyside;f=runtime%2Fsyntax%2Fjulia.yaml;h=fda0e333dd8b822db09698d9887496f39e546385;hb=HEAD;hp=c92a0ddf00b70837dcf0909a5635e6892d239ff0;hpb=8f0418c9a8c1a6676e21fc76207afec3821cff1c;p=micro.git diff --git a/runtime/syntax/julia.yaml b/runtime/syntax/julia.yaml index c92a0ddf..fda0e333 100644 --- a/runtime/syntax/julia.yaml +++ b/runtime/syntax/julia.yaml @@ -8,22 +8,24 @@ rules: # built-in objects - constant.bool: "\\b(true|false)\\b" + - constant: "\\b(nothing|missing)\\b" # built-in attributes - constant: "__[A-Za-z0-9_]+__" # definitions - identifier: "[A-Za-z_][A-Za-z0-9_]*[[:space:]]*[(]" # keywords - - statement: "\\b(begin|break|catch|continue|function|elseif|struct|else|end|finally|for|global|local|const|if|include|import|using|require|macro|println|return|try|type|while|module)\\b" + - statement: "\\b(baremodule|begin|break|catch|const|continue|do|else|elseif|end|export|finally|for|function|global|if|import|let|local|macro|module|quote|return|struct|try|using|while)\\b" + - statement: "\\b(abstract\\s+type|primitive\\s+type|mutable\\s+struct)\\b" # decorators - identifier.macro: "@[A-Za-z0-9_]+" # operators - - symbol.operator: "[-+*/|=%<>&~^]|\\b(and|not|or|is|in)\\b" + - symbol.operator: "[:+*|=!%~<>/\\-?&\\\\÷∈∉∘]|\\b(in|isa|where)\\b" + # for some reason having ^ in the same regex with the other operators broke things + - symbol.operator: "\\^" # parentheses - symbol.brackets: "([(){}]|\\[|\\])" # numbers - - constant.number: "\\b[0-9]+\\b" - - - constant.string: "\"(\\\\.|[^\"])*\"|'(\\\\.|[^'])*'" + - constant.number: "\\b([0-9]+(_[0-9]+)*|0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0b[01]+(_[01]+)*|0o[0-7]+(_[0-7]+)*|Inf(16|32|64)?|NaN(16|32|64)?)\\b" - constant.string: start: "\"\"\"" @@ -31,8 +33,23 @@ rules: rules: [] - constant.string: - start: "'''" - end: "'''" + start: "\"" + end: "\"" + skip: "\\\\." + rules: + - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})" + + - constant.string: + start: "'" + end: "'" + skip: "\\\\." + rules: + - error: "..+" + - constant.specialChar: "\\\\([\"'abfnrtv\\\\]|[0-3]?[0-7]{1,2}|x[0-9A-Fa-f]{1,2}|u[0-9A-Fa-f]{1,4}|U[0-9A-Fa-f]{1,8})" + + - comment: + start: "#=" + end: "=#" rules: [] - comment: