{ "name": "Mathematica", "scopeName": "source.mathematica", "patterns": [ { "include": "#builtin_symbols" }, { "include": "#builtin_variables" }, { "include": "#builtin_operators" }, { "include": "#pattern" }, { "include": "#array_index" }, { "include": "#constant" }, { "include": "#sqlstring" }, { "include": "#string" }, { "include": "#number" }, { "include": "#list" }, { "include": "#emptyfunction" }, { "include": "#function" }, { "include": "#symbol" }, { "include": "#comment" } ], "repository": { "array_index": { "name": "meta.structure.part.mathematica", "begin": "\\[\\[", "end": "\\]\\]", "patterns": [ { "include": "$self" }, { "name": "punctuation.separator.part.mathematica", "match": "," } ], "beginCaptures": { "0": { "name": "punctuation.definition.part.begin.mathematica" } }, "endCaptures": { "0": { "name": "punctuation.definition.part.end.mathematica" } } }, "builtin_operators": { "patterns": [ { "name": "keyword.operator.assignment.up_set_delayed", "match": "\\^:=" }, { "name": "keyword.operator.logical.same", "match": "===" }, { "name": "keyword.operator.logical.not_same", "match": "=!=" }, { "name": "keyword.operator.mathematica.put_append", "match": "\\\u003e\\\u003e\\\u003e" }, { "name": "keyword.operator.arithmetic.scientific_notation", "match": "\\*\\^" }, { "name": "keyword.operator.assignment.set_delayed", "match": ":=" }, { "name": "keyword.operator.assignment.up_set", "match": "\\^=" }, { "name": "keyword.operator.logical.and", "match": "\u0026\u0026" }, { "name": "keyword.operator.logical.or", "match": "||" }, { "name": "keyword.operator.logical.equal", "match": "==" }, { "name": "keyword.operator.logical.not_equal", "match": "!=" }, { "name": "keyword.operator.logical.greater_than_or_equal", "match": "\\\u003e=" }, { "name": "keyword.operator.logical.less_than_or_equal", "match": "\\\u003c=" }, { "name": "keyword.operator.mathematica.span", "match": ";;" }, { "name": "keyword.operator.mathematica.repeated_null", "match": "\\.\\.\\." }, { "name": "keyword.operator.mathematica.repeated", "match": "\\.\\." }, { "name": "keyword.operator.mathematica.replace_repeated", "match": "//\\." }, { "name": "keyword.operator.mathematica.replace", "match": "/\\." }, { "name": "keyword.operator.mathematica.rule", "match": "-\\\u003e" }, { "name": "keyword.operator.mathematica.rule_delayed", "match": ":\\\u003e" }, { "name": "keyword.operator.mathematica.apply", "match": "@{1,3}" }, { "name": "keyword.operator.mathematica.map_all", "match": "//@" }, { "name": "keyword.operator.mathematica.map", "match": "/@" }, { "name": "keyword.operator.mathematica.string_join", "match": "\\\u003c\\\u003e" }, { "name": "keyword.operator.mathematica.get", "match": "\\\u003c\\\u003c" }, { "name": "keyword.operator.mathematica.put", "match": "\\\u003e\\\u003e" }, { "name": "keyword.operator.mathematica.condition", "match": "/;" }, { "name": "keyword.operator.mathematica.tag", "match": "/:" }, { "name": "keyword.operator.mathematica.postfix", "match": "//" }, { "name": "keyword.operator.mathematica.string_expression", "match": "~~" }, { "name": "keyword.operator.arithmetic.plus", "match": "\\+" }, { "name": "keyword.operator.arithmetic.minus", "match": "-" }, { "name": "keyword.operator.arithmetic.times", "match": "\\*" }, { "name": "keyword.operator.arithmetic.divide", "match": "/" }, { "name": "keyword.operator.arithmetic.power", "match": "\\^" }, { "name": "keyword.operator.logical.not", "match": "!" }, { "name": "keyword.operator.logical.greater_than", "match": "\\\u003e" }, { "name": "keyword.operator.logical.less_than", "match": "\\\u003c" }, { "name": "keyword.operator.mathematica.alternative", "match": "|" }, { "name": "keyword.operator.mathematica.prefix", "match": "@" }, { "name": "keyword.operator.mathematica.compound_expression", "match": ";" }, { "name": "keyword.operator.mathematica.context", "match": "`" }, { "name": "keyword.operator.mathematica.function", "match": "\u0026" }, { "name": "keyword.operator.mathematica.slot", "match": "#\\d*" }, { "name": "keyword.operator.mathematica.pattern_test", "match": "\\?" }, { "name": "keyword.operator.mathematica.unset", "match": "=\\." }, { "name": "keyword.operator.mathematica.set", "match": "=" }, { "name": "keyword.operator.mathematica.derivative", "match": "'" } ] }, "builtin_symbols": { "patterns": [ { "name": "support.function.mathematica.system" } ] }, "builtin_variables": { "patterns": [ { "name": "support.variable.mathematica.system", "match": "(\\$Aborted|$ActivationKey|$AddOnsDirectory|$AssertFunction|$Assumptions|$BaseDirectory|$BatchInput|$BatchOutput|$BoxForms|$ByteOrdering|$Canceled|$CharacterEncoding|$CharacterEncodings|$CommandLine|$CompilationTarget|$ConditionHold|$ConfiguredKernels|$Context|$ContextPath|$ControlActiveSetting|$CreationDate|$CurrentLink|$DateStringFormat|$DefaultFont|$DefaultFrontEnd|$DefaultPath|$Display|$DisplayFunction|$DistributedContexts|$DynamicEvaluation|$Echo|$Epilog|$ExportFormats|$Failed|$FinancialDataSource|$FormatType|$FrontEnd|$FrontEndSession|$GeoLocation|$HistoryLength|$HomeDirectory|$IgnoreEOF|$ImportFormats|$InitialDirectory|$Input|$InputFileName|$Inspector|$InstallationDate|$InstallationDirectory|$InterfaceEnvironment|$IterationLimit|$KernelCount|$KernelID|$Language|$LaunchDirectory|$LibraryPath|$LicenseExpirationDate|$LicenseID|$LicenseProcesses|$LicenseServer|$LicenseSubprocesses|$LicenseType|$Line|$Linked|$LinkSupported|$LoadedFiles|$MachineAddresses|$MachineDomain|$MachineDomains|$MachineEpsilon|$MachineID|$MachineName|$MachinePrecision|$MachineType|$MaxExtraPrecision|$MaxLicenseProcesses|$MaxLicenseSubprocesses|$MaxMachineNumber|$MaxNumber|$MaxPiecewiseCases|$MaxPrecision|$MaxRootDegree|$MessageGroups|$MessageList|$MessagePrePrint|$Messages|$MinMachineNumber|$MinNumber|$MinorReleaseNumber|$MinPrecision|$ModuleNumber|$NetworkLicense|$NewMessage|$NewSymbol|$Notebooks|$NumberMarks|$Off|$OperatingSystem|$Output|$OutputForms|$OutputSizeLimit|$Packages|$ParentLink|$ParentProcessID|$PasswordFile|$Path|$PathnameSeparator|$PerformanceGoal|$PipeSupported|$Post|$Pre|$PreferencesDirectory|$PrePrint|$PreRead|$PrintForms|$PrintLiteral|$ProcessID|$ProcessorCount|$ProcessorType|$ProductInformation|$ProgramName|$RandomState|$RecursionLimit|$ReleaseNumber|$RootDirectory|$ScheduledTask|$SessionID|$SetParentLink|$SharedFunctions|$SharedVariables|$SoundDisplay|$SoundDisplayFunction|$SuppressInputFormHeads|$SynchronousEvaluation|$SyntaxHandler|$System|$SystemCharacterEncoding|$SystemID|$SystemWordLength|$TemporaryDirectory|$TemporaryPrefix|$TextStyle|$TimedOut|$TimeUnit|$TimeZone|$TopDirectory|$TraceOff|$TraceOn|$TracePattern|$TracePostAction|$TracePreAction|$Urgent|$UserAddOnsDirectory|$UserBaseDirectory|$UserDocumentsDirectory|$UserName|$Version|$VersionNumber)\\b" } ] }, "comment": { "name": "comment.block.mathematica", "begin": "\\(\\*", "end": "\\*\\)", "patterns": [ { "include": "#comment" } ] }, "constant": { "name": "constant.language.mathematica", "match": "\\b(True|False|Null|Automatic|All|None|Infinity)\\b" }, "emptyfunction": { "name": "meta.structure.function.empty.mathematica", "match": "([a-zA-Z$][a-zA-Z0-9$]*)(\\[)(\\])", "captures": { "1": { "name": "entity.name.function.empty.mathematica" }, "2": { "name": "punctuation.definition.function.empty.begin.mathematica" }, "3": { "name": "meta.scope.between_empty_brackets" } } }, "function": { "name": "meta.structure.function.mathematica", "begin": "([a-zA-Z$][a-zA-Z0-9$]*)(\\[)(?!\\[)", "end": "\\]", "patterns": [ { "include": "$self" }, {}, { "name": "punctuation.separator.list.mathematica", "match": "," } ], "beginCaptures": { "1": { "name": "entity.name.function.mathematica" }, "2": { "name": "punctuation.definition.function.begin.mathematica" } }, "endCaptures": { "0": { "name": "punctuation.definition.function.end.mathematica" } } }, "list": { "name": "meta.structure.list.mathematica", "begin": "\\{", "end": "\\}", "patterns": [ { "include": "$self" }, { "name": "punctuation.separator.list.mathematica", "match": "," } ], "beginCaptures": { "0": { "name": "punctuation.definition.list.begin.mathematica" } }, "endCaptures": { "0": { "name": "punctuation.definition.list.end.mathematica" } } }, "number": { "name": "constant.numeric.mathematica", "match": "\\b(\\d+(\\.\\d*)?)" }, "pattern": { "patterns": [ { "name": "variable.parameter.mathematica.blank_null_sequence_pattern", "match": "([a-zA-Z$][a-zA-Z0-9$]*)?(___)" }, { "name": "variable.parameter.mathematica.blank_sequence_pattern", "match": "([a-zA-Z$][a-zA-Z0-9$]*)?(__)" }, { "name": "variable.parameter.mathematica.blank_pattern", "match": "([a-zA-Z$][a-zA-Z0-9$]*)?(_)" } ] }, "sqlstring": { "name": "string.quoted.double.sql.mathematica", "begin": "\"(?=\\s*(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER))", "end": "\"", "patterns": [ { "include": "#constant_placeholder" }, { "include": "#escaped_char" }, { "include": "source.sql" } ] }, "string": { "name": "string.quoted.double.mathematica", "begin": "\"", "end": "\"", "patterns": [ { "name": "constant.character.escape.untitled", "match": "\\\\." } ] }, "symbol": { "name": "variable.symbol.mathematica", "match": "[a-zA-Z$][a-zA-Z0-9$]*\\b" } } }