{"name":"ObjectScript Routine","scopeName":"source.objectscript","patterns":[{"include":"#comments"},{"include":"#embedded"},{"include":"#constants"},{"include":"#keywords"},{"include":"#macros"},{"include":"#elements"}],"repository":{"commands":{"patterns":[{"match":"(?i)(?\u003c=\\s)\\b(BREAK|B|SET|S|DO|D|KILL|K|GOTO|G|READ|R|WRITE|W|OPEN|O|USE|U|CLOSE|C|CONTINUE|FOR|F|HALT|H|HANG|JOB|J|MERGE|M|NEW|N|QUIT|Q|RETURN|RET|TSTART|TS|TCOMMIT|TC|TROLLBACK|TRO|THROW|VIEW|V|XECUTE|X|ZKILL|ZL|ZNSPACE|ZN|ZTRAP|ZWRITE|ZW|ZZDUMP|ZZWRITE)\\b(?=( (?![=+-]|\\\u0026|\\|)|:|$))","captures":{"1":{"name":"keyword.control.objectscript"}}},{"match":"(?i)(?\u003c=\\s)\\b(LOCK|L)\\b(?=( (?![=]|\\\u0026|\\|)|:|$))","captures":{"1":{"name":"keyword.control.objectscript"}}}]},"comments":{"patterns":[{"contentName":"comment.multiline.objectscript","begin":"(/\\*)","end":"(.*?\\*/)","beginCaptures":{"1":{"name":"comment.multiline.objectscript"}},"endCaptures":{"1":{"name":"comment.multiline.objectscript"}}},{"name":"comment.line.macro.objectscript","begin":"^\\s*#;","end":"$"},{"name":"comment.endline.objectscript","begin":"//|;","end":"$"},{"name":"comment.endline.macro.objectscript","begin":"##;","end":"$"}]},"constants":{"patterns":[{"name":"string.quoted.double.objectscript","begin":"(\")","end":"(\")","beginCaptures":{"1":{"name":"punctuation.definition.string.begin.objectscript"}},"endCaptures":{"1":{"name":"punctuation.definition.string.end.objectscript"}}},{"name":"constant.numeric.objectscript","match":"\\d+"}]},"control-commands":{"patterns":[{"match":"(?i)(?\u003c=\\s)\\b(IF|I|WHILE|FOR|F|TRY|CATCH|ELSE|E|ELSEIF)\\b(?=( (?![=+-]|\\\u0026|\\|)|:|$))","captures":{"1":{"name":"keyword.control.objectscript"}}}]},"elements":{"patterns":[{"name":"entity.name.function","match":"^[a-zA-Z0-9]+"},{"match":"(?i)(##class)(\\()([^)]+)(\\))","captures":{"1":{"name":"keyword.other"},"2":{"name":"punctuation.objectscript"},"3":{"name":"entity.name.class"},"4":{"name":"punctuation.objectscript"}}},{"name":"entity.other.attribute-name","match":"%[a-zA-Z0-9]+"},{"name":"entity.other.attribute-name","match":"[i|r]%[a-zA-Z0-9]+"},{"name":"entity.other.attribute-name","match":"[i|r]%\"[^\".]\""},{"match":"(\\.{1,2})(%?[a-zA-Z0-9]+)(?=\\()","captures":{"1":{"name":"punctuation.objectscript"},"2":{"name":"entity.other.attribute-name"}}},{"match":"(\\.{1,2})(%?[a-zA-Z0-9]+)(?!\\()","captures":{"1":{"name":"punctuation.objectscript"},"2":{"name":"entity.other.attribute-name"}}},{"match":"(\\.{1,2}#)([a-zA-Z0-9]+)","captures":{"1":{"name":"punctuation.objectscript"},"2":{"name":"meta.parameter.type.variable"}}},{"name":"variable.name.objectscrip","match":"%?[a-zA-Z0-9]+"},{"name":"variable.name.global.objectscrip","match":"\\^%?[a-zA-Z0-9]+"},{"name":"entity.name.function.system.objectscript","match":"\\$[a-zA-Z0-9]+"},{"name":"entity.name.function.local.objectscript","match":"\\${2}[a-zA-Z0-9]+"},{"name":"meta.preprocessor.objectscript","match":"\\${3}[a-zA-Z0-9]+"}]},"embedded":{"patterns":[{"include":"#embeddedSQL"},{"include":"#embeddedJS"}]},"embeddedJS":{"patterns":[{"contentName":"text.js","begin":"(\u0026js)(\\()","end":"\\)","patterns":[{"include":"source.js"}],"beginCaptures":{"1":{"name":"keyword.special.js.objectscript"},"2":{"name":"punctuation.objectscript"}}}]},"embeddedSQL":{"patterns":[{"contentName":"meta.embedded.block.sql","begin":"(\u0026sql)(\\()","end":"\\)","patterns":[{"include":"source.sql"}],"beginCaptures":{"1":{"name":"keyword.special.sql.objectscript"},"2":{"name":"punctuation.objectscript"}}}]},"keywords":{"patterns":[{"include":"#commands"},{"include":"#control-commands"}]},"macros":{"patterns":[{"match":"(?i)(#dim)(\\s)(%?[a-zA-Z0-9]+)(\\s)(?:(As)(\\s)(%?[a-zA-Z0-9.]+))?","captures":{"1":{"name":"meta.preprocessor.dim.objectscript"},"2":{"name":"whitespace.objectscript"},"3":{"name":"variable.name"},"4":{"name":"whitespace.objectscript"},"5":{"name":"keyword.as.objectscript"},"6":{"name":"whitespace.objectscript"},"7":{"name":"entity.name.class"}}},{"include":"source.objectscript_macros"}]},"statements":{"patterns":[{"include":"#variables"}]}}}
