Skip to content

Commit

Permalink
Add new keywords support to Doc::Highlighter (#7054)
Browse files Browse the repository at this point in the history
  • Loading branch information
makenowjust authored and sdogruyol committed Nov 9, 2018
1 parent 2c98f7c commit 3025fef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions spec/compiler/crystal/tools/doc/highlighter_spec.cr
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ describe "Crystal::Doc::Highlighter#highlight" do
as as? typeof for in with self super private asm
nil? abstract pointerof
protected uninitialized instance_sizeof
annotation verbatim
).each do |kw|
it_highlights kw, %(<span class="k">#{kw}</span>)
end
Expand Down
3 changes: 2 additions & 1 deletion src/compiler/crystal/tools/doc/highlighter.cr
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ module Crystal::Doc::Highlighter
:lib, :fun, :type, :struct, :union, :enum, :macro, :out, :require,
:case, :when, :select, :then, :of, :abstract, :rescue, :ensure, :is_a?,
:alias, :pointerof, :sizeof, :instance_sizeof, :as, :as?, :typeof, :for, :in,
:undef, :with, :self, :super, :private, :asm, :nil?, :protected, :uninitialized, "new"
:undef, :with, :self, :super, :private, :asm, :nil?, :protected, :uninitialized, "new",
:annotation, :verbatim
highlight token, "k", io
when :true, :false, :nil
highlight token, "n", io
Expand Down

0 comments on commit 3025fef

Please sign in to comment.