fileTypes mql4 mq4 mq5 mqh foldingStartMarker (^.)?\{ foldingStopMarker (^\s*)?\} name MQL4 patterns include #comments match \b(const|private|protected|public|virtual|override)\b name storage.modifier.source.mql4 match \b(break|case|continue|default|delete|do|else|for|if|new|operator|return|sizeof|switch|while)\b name keyword.control.mql4 match #\b(property|import|define|include|ifdef|ifndef|else|endif)\b name keyword.control.preprocessor.mql4 match \b(bool|char|class|color|datetime|double|enum|float|int|long|short|string|struct|uchar|uint|ulong|ushort|void)\b name storage.type.mql4 match \b(extern|input|static)\b name storage.modifier.mql4 match \b(true|TRUE)\b name constant.language.boolean.true.mql4 match \b(false|FALSE)\b name constant.language.boolean.false.mql4 match \b(null|NULL)\b name constant.language.null.mql4 match \b(empty|EMPTY)\b name constant.language.empty.mql4 match \b(this|strict|template|typename)\b name constant.language.other.mql4 match \b(([A-Z_]+)(\d*)?)\b name constant.language.mql4 match \b(([a-zA-Z_]+)([a-zA-Z0-9_]*)?)\b name variable.other.mql4 match \b([1-9]+[0-9]*|0[a-z,A-Z,0-9]*)\b name constant.numeric.integer.mql4 match \b(\d*\.\d*)\b name constant.numeric.double.mql4 match <\=|>\=|\=\=|<|>|\!\= name keyword.operator.comparison.mql4 match \+\=|-\=|\*\=|/\=|//\=|%\=|&\=|\|\=|\^\=|>>\=|<<\= name keyword.operator.assignment.augmented.mql4 match %|\*|\-|\+|\/|\+\+|\-\-|\^|>>|<< name keyword.operator.arithmetic.mql4 match = name keyword.operator.assignment.mql4 match \!|&&|\|\| name keyword.operator.logical.mql4 begin " beginCaptures 0 name punctuation.definition.string.begin.mql4 end " endCaptures 0 name punctuation.definition.string.end.mql4 name string.quoted.double.mql4 patterns include #string_escaped_char include #string_placeholder begin ' beginCaptures 0 name punctuation.definition.string.begin.mql4 end ' endCaptures 0 name punctuation.definition.string.end.mql4 name string.quoted.single.mql4 patterns include #string_escaped_char include #block begin (?x) (?: ^ # begin-of-line | (?: (?= \s ) (?<!else|new|return) (?<=\w) # or word + space before name | (?= \s*[A-Za-z_] ) (?<!&&) (?<=[*&>]) # or type modifier before name ) ) (\s*) (?!(while|for|do|if|else|switch|catch|return)\s*\() ( (?: [A-Za-z_][A-Za-z0-9_]*+ | ::~? )++ | # actual name (?: (?<=operator) (?: [-*&<>=+!]+ | \(\) | \[\] ) ) # if it is a C++ operator ) \s*(?=\() beginCaptures 1 name punctuation.whitespace.function.leading.mql4 3 name entity.name.function.mql4 4 name punctuation.definition.parameters.mql4 end (?<=\})|(?=#)|(;) name meta.function.mql4 patterns include #comments include #parens include #block repository block begin \{ end \} name meta.block.mql4 patterns include #block_innards block_innards patterns captures 1 name punctuation.whitespace.support.function.leading.mql4 2 name support.function.C99.mql4 match captures 1 name punctuation.whitespace.function-call.leading.mql4 2 name support.function.any-method.mql4 3 name punctuation.definition.parameters.mql4 match (?x) (?: (?= \s ) (?:(?<=else|new|return) | (?<!\w)) (\s+))? (\b (?!(while|for|do|if|else|switch|catch|return)\s*\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\b | :: )++ ) \s*(\() name meta.function-call.mql4 captures 1 name variable.other.mql4 2 name punctuation.definition.parameters.mql4 match (?x) (?x) (?: (?: (?= \s ) (?<!else|new|return) (?<=\w)\s+ ) ) ( (?: [A-Za-z_][A-Za-z0-9_]*+ | :: )++ | (?: (?<=operator) (?: [-*<>=+!]+ | \(\) | \[\] ) )? ) \s*(\() name meta.initialization.mql4 include #block include $base comments patterns captures 1 name meta.toc-list.banner.block.mql4 match ^/\* =(\s*.*?)\s*= \*/$\n? name comment.block.mql4 begin /\* captures 0 name punctuation.definition.comment.mql4 end \*/ name comment.block.mql4 match \*/.*\n name invalid.illegal.stray-comment-end.mql4 captures 1 name meta.toc-list.banner.line.mql4 match ^// =(\s*.*?)\s*=\s*$\n? name comment.line.banner.mql4 begin // beginCaptures 0 name punctuation.definition.comment.mql4 end $\n? name comment.line.double-slash.mql4 patterns match (?>\\\s*\n) name punctuation.separator.continuation.mql4 parens begin \( end \) name meta.parens.mql4 patterns include $base string_escaped_char patterns match \\(\\|[abefnprtv'"?]|[0-3]\d{,2}|[4-7]\d?|x[a-fA-F0-9]{,2}|u[a-fA-F0-9]{,4}|U[a-fA-F0-9]{,8}) name constant.character.escape.mql4 match \\. name invalid.illegal.unknown-escape.mql4 string_placeholder patterns match (?x)% (?x)% (\d+\$)? [#0\- +']* [,;:_]? ((-?\d+)|\*(-?\d+\$)?)? (\.((-?\d+)|\*(-?\d+\$)?)?)? (hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? [diouxXDOUeEfFgGaACcSspn%] name constant.other.placeholder.mql4 scopeName source.mq4 uuid 192620ec-60be-4dc4-99a8-5c59c6000ced