{"record":{"id":"7953cd11943d8da4","repo":"LykosAI/StabilityMatrix","slug":"expected-colon","errorCode":null,"errorMessage":"Expected colon.","messagePattern":"Expected colon\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"StabilityMatrix.Core/Models/PromptSyntax/PromptSyntaxBuilder.cs","lineNumber":252,"sourceCode":"    private NetworkNode ParseNetwork()\n    {\n        var beginNetworkToken = ConsumeToken();\n        if (\n            beginNetworkToken is null\n            || !beginNetworkToken.Scopes.Contains(\"punctuation.definition.network.begin.prompt\")\n        )\n            throw new InvalidOperationException(\"Expected opening bracket.\");\n\n        // type\n        var typeToken = PeekToken();\n        if (typeToken is null || !typeToken.Scopes.Contains(\"meta.embedded.network.type.prompt\"))\n            throw new InvalidOperationException(\"Expected network type.\");\n        var type = ParseIdentifier();\n\n        // colon\n        var colonToken = ConsumeToken();\n        if (colonToken is null || !colonToken.Scopes.Contains(\"punctuation.separator.variable.prompt\"))\n            throw new InvalidOperationException(\"Expected colon.\");\n\n        // name\n        var nameToken = PeekToken();\n        if (nameToken is null || !nameToken.Scopes.Contains(\"meta.embedded.network.model.prompt\"))\n            throw new InvalidOperationException(\"Expected network name.\");\n        var name = ParseText();\n\n        // model weight, clip weight\n        NumberNode? modelWeight = null;\n        NumberNode? clipWeight = null;\n\n        // colon\n        var nextToken = PeekToken();\n        if (nextToken is not null && nextToken.Scopes.Contains(\"punctuation.separator.variable.prompt\"))\n        {\n            ConsumeToken(); // consume colon\n\n            // Parse the model weight.","sourceCodeStart":234,"sourceCodeEnd":270,"githubUrl":"https://github.com/LykosAI/StabilityMatrix/blob/af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002/StabilityMatrix.Core/Models/PromptSyntax/PromptSyntaxBuilder.cs#L234-L270","documentation":"Thrown by ParseNetwork when the token after the network type should be a ':' separator scoped as 'punctuation.separator.variable.prompt' but is missing or scoped differently. The parser requires the strict '<type:name...>' structure.","triggerScenarios":"Input like '<lora name:0.8>' (space instead of colon), '<lora-name:0.8>' if '-' tokenizes as something else, or '<lora>' with nothing following the type.","commonSituations":"Users rewriting LoRA tags by hand and omitting the colon; prompts converted between syntaxes that use spaces or '=' instead of ':'; autocomplete tools inserting the tag name without the separator.","solutions":["Add the ':' separator between type and name: '<lora:name:0.8>'","Do not put spaces or other characters between the type and ':'","Verify the tokenizer scopes the ':' as punctuation.separator.variable.prompt","Catch InvalidOperationException and highlight the malformed tag for the user"],"exampleFix":"// before\nvar prompt = \"<lora myModel:0.8>\";\n// after\nvar prompt = \"<lora:myModel:0.8>\";","handlingStrategy":"validation","validationCode":"bool HasColonSeparator(string tag) => System.Text.RegularExpressions.Regex.IsMatch(tag, \"^<[a-zA-Z]+:\");","typeGuard":"null","tryCatchPattern":"try { var node = builder.Parse(prompt); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"Expected colon\")) { // highlight the tag missing ':' after the type }","preventionTips":["Use ':' between type and name, never spaces or dashes","Normalize tags from other tools before parsing (replace separators with ':')","Avoid hand-editing tag internals; regenerate via UI","Lint prompt tags for the strict '<type:name>' shape"],"tags":["parser","prompt-syntax","lora","separator"],"backgroundTag":"invalid-argument-format","analyzedSha":"af93d6ef57c01cd890d7e0ad0a9ea8c9fcda3002","analyzedAt":"2026-09-12T19:02:43.389Z","contentChangedAt":"2026-09-12T19:02:43.389Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}