Crystal::Macros::SymbolLiteral
Inherits Crystal::Macros::ASTNode
A symbol literal.
Instance methods
Similar to String#gsub(pattern, options, &).
NOTE: The special variables $~ and $1, $2, ... are not supported.
Similar to String#gsub.
Matches the given regex against this string and returns a capture hash, or
nil if a match cannot be found.
The capture hash has the same form as Regex::MatchData#to_h.
Returns an array of capture hashes for each match of regex in this string.
Capture hashes have the same form as Regex::MatchData#to_h.
Similar to String#starts_with?.
Returns an expression that evaluates to a slice literal containing the
UTF-16 code units of this string, plus an extra trailing null character.
This null character is not part of the slice, but ensures that calling
#to_unsafe always results in a properly null-terminated C string.
(::Slice(::UInt16).literal(97_u16, 98_u16, 99_u16, 55357_u16, 56834_u16, 0_u16))[0, 5] # => ::Slice(::UInt16).literal(97, 98, 99, 55357, 56834, 0)[0, 5]
WARNING: The return value is not necessarily a literal node.