Skip to content

Commit

Permalink
Ruby: Made true and false booleans (#2098)
Browse files Browse the repository at this point in the history
This makes `true` and `false` `boolean` tokens. Previously they were tokenized as `keyword`.
  • Loading branch information
RunDevelopment authored Oct 20, 2019
1 parent 99994c5 commit 68d1c47
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion components/prism-ruby.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
greedy: true
}
],
'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|false|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/
'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|extend|for|if|in|include|module|new|next|nil|not|or|prepend|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|undef|unless|until|when|while|yield)\b/
});

var interpolation = {
Expand Down
2 changes: 1 addition & 1 deletion components/prism-ruby.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 13 additions & 0 deletions tests/languages/ruby/boolean_feature.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
true
false

----------------------------------------------------

[
["boolean", "true"],
["boolean", "false"]
]

----------------------------------------------------

Checks for booleans.
4 changes: 0 additions & 4 deletions tests/languages/ruby/keyword_feature.test
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ END
end
ensure
extend
false
for
if
in
Expand All @@ -41,7 +40,6 @@ self
super
then
throw
true
undef
unless
until
Expand Down Expand Up @@ -70,7 +68,6 @@ yield
["keyword", "end"],
["keyword", "ensure"],
["keyword", "extend"],
["keyword", "false"],
["keyword", "for"],
["keyword", "if"],
["keyword", "in"],
Expand All @@ -95,7 +92,6 @@ yield
["keyword", "super"],
["keyword", "then"],
["keyword", "throw"],
["keyword", "true"],
["keyword", "undef"],
["keyword", "unless"],
["keyword", "until"],
Expand Down

0 comments on commit 68d1c47

Please sign in to comment.