typst: highlight function name after #set / #show keywords
Build and Deploy Verso / deploy (push) Has been cancelled
Build and Deploy Verso / deploy (push) Has been cancelled
KeywordExpr now optionally includes a CallExpr, so '#set text(size: 12pt)' parses 'text' as a CallExpr/CodeIdent and gets the function-name highlight colour. The optional CallExpr only shifts when the lookahead is CodeIdent, so there is no shift/reduce conflict with other items. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -67,7 +67,10 @@ codeExprBody {
|
||||
ContentBlock
|
||||
}
|
||||
|
||||
KeywordExpr { CodeKeyword }
|
||||
// CallExpr? covers '#set text(size: 12pt)', '#show heading: ...', etc.
|
||||
// The optional CallExpr is only shifted when the next token is CodeIdent,
|
||||
// so there is no shift/reduce conflict with other items that follow keywords.
|
||||
KeywordExpr { CodeKeyword CallExpr? }
|
||||
AtomExpr { CodeBool }
|
||||
|
||||
CallExpr { CodeIdent callSuffix* }
|
||||
|
||||
Reference in New Issue
Block a user