Skip to content

Commit

Permalink
fix: render array literals correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
david-christiansen committed Feb 1, 2024
1 parent d9e57fd commit 335c4c3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
3 changes: 3 additions & 0 deletions examples/website/DemoSite/Blog/Conditionals.lean
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,7 @@ example : Int := if True then 1 else 2
def slowId : Nat → Nat
| 0 => 0
| n + 1 => slowId n + 1

/-- An array literal -/
example := #[1, 2, 3]
```
7 changes: 6 additions & 1 deletion src/verso-blog/Verso/Genre/Blog/HighlightCode.lean
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,12 @@ partial def highlight' (ids : HashMap Lsp.RefIdent Lsp.RefIdent) (stx : Syntax)
else
emitToken i <| (⟨ ·, x⟩) <|
match x.get? 0 with
| some '#' => .keyword lookingAt docs
| some '#' =>
match x.get? ((0 : String.Pos) + '#') with
| some c =>
if c.isAlpha then .keyword lookingAt docs
else .unknown
| _ => .unknown
| some c =>
if c.isAlpha then .keyword lookingAt docs
else .unknown
Expand Down

0 comments on commit 335c4c3

Please sign in to comment.