This class is mainly used to factorize work between single and double quoted span codes.
markdown :: TokenCode :: defaultinit
markdown :: Token :: _location
Location ofself
in the original input.
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
core :: Object :: defaultinit
markdown :: Token :: defaultinit
markdown :: TokenCode :: defaultinit
MarkdownEmitter::decorator
.
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
self
in the original input.
markdown :: Token :: location=
Location ofself
in the original input.
core :: Object :: native_class_name
The class name of the object in CString format.core :: Object :: output_class_name
Display class name on stdout (debug only).
# A code token.
# This class is mainly used to factorize work between single and double quoted span codes.
abstract class TokenCode
super Token
redef fun emit(v) do
var current_text = v.current_text.as(not null)
var a = pos + next_pos + 1
var b = v.find_token(current_text, a, self)
if b > 0 then
v.current_pos = b + next_pos
while a < b and current_text[a] == ' ' do a += 1
if a < b then
while current_text[b - 1] == ' ' do b -= 1
v.decorator.add_span_code(v, current_text, a, b)
end
else
v.addc char
end
end
private fun next_pos: Int is abstract
end
lib/markdown/markdown.nit:2031,1--2053,3