nitc :: AugmentedStringFormExpr :: _extended
Regex::extended, used for suffixb
on re
nitc :: AugmentedStringFormExpr :: _ignore_case
Regex::ignore_case, used for suffixi
on re
nitc :: AugmentedStringFormExpr :: _newline
Regex::newline, used for suffixm
on re
nitc :: AugmentedStringFormExpr :: _to_bytes_with_copy
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: _to_re
Text::to_re, used for prefixre
nitc :: AugmentedStringFormExpr :: extended
Regex::extended, used for suffixb
on re
nitc :: AugmentedStringFormExpr :: extended=
Regex::extended, used for suffixb
on re
nitc :: AugmentedStringFormExpr :: ignore_case
Regex::ignore_case, used for suffixi
on re
nitc :: AugmentedStringFormExpr :: ignore_case=
Regex::ignore_case, used for suffixi
on re
nitc :: AugmentedStringFormExpr :: make_re
Factorize the making of aRegex
object from a literal prefixed string
nitc :: AugmentedStringFormExpr :: make_re
Factorize the making of aRegex
object from a literal prefixed string
nitc :: AugmentedStringFormExpr :: newline
Regex::newline, used for suffixm
on re
nitc :: AugmentedStringFormExpr :: newline=
Regex::newline, used for suffixm
on re
nitc :: AugmentedStringFormExpr :: to_bytes_with_copy
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: to_bytes_with_copy=
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: to_re
Text::to_re, used for prefixre
nitc :: AugmentedStringFormExpr :: to_re=
Text::to_re, used for prefixre
nitc $ AugmentedStringFormExpr :: SELF
Type of this instance, automatically specialized in every classnitc $ AugmentedStringFormExpr :: is_valid_augmentation
Is the combination of prefixes and suffixes inself
valid ?
nitc :: AExpr :: _after_flow_context
The flow after the full evaluation of the expression/statementnitc :: AExpr :: _comprehension
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AAugmentedLiteral :: _content
Content of the entity, without prefix nor suffixnitc :: AugmentedStringFormExpr :: _extended
Regex::extended, used for suffixb
on re
nitc :: Prod :: _first_location
Location on the first token after the start of a productionnitc :: Prod :: _first_token
The first token of the production in the ASTnitc :: AugmentedStringFormExpr :: _ignore_case
Regex::ignore_case, used for suffixi
on re
nitc :: AExpr :: _implicit_cast_to
If required, the following implicit cast.as(XXX)
nitc :: ANode :: _is_broken
The indication that the node did not pass some semantic verifications.nitc :: Prod :: _last_token
The last token of the production in the ASTnitc :: Prod :: _n_annotations
All the annotations attached directly to the nodenitc :: AugmentedStringFormExpr :: _newline
Regex::newline, used for suffixm
on re
nitc :: AAugmentedLiteral :: _prefix
Prefix for the entity, "" if no prefix is foundnitc :: AAugmentedLiteral :: _suffix
Suffix for the entity, "" if no prefix is foundnitc :: AugmentedStringFormExpr :: _to_bytes_with_copy
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: _to_re
Text::to_re, used for prefixre
nitc :: AExpr :: _vararg_decl
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: _variable_cache
nitc :: ANode :: accept_ast_validation
nitc :: ANode :: accept_auto_super_init
nitc :: AExpr :: accept_explain_assert
Fillv
to explain this node if the parent assert fails
nitc :: ANode :: accept_flow_visitor
nitc :: ANode :: accept_forward_analysis
Apply the forward analysisv
to self
.
nitc :: ANode :: accept_literal
nitc :: ANode :: accept_post_typing
nitc :: ANode :: accept_pretty_printer
Start visit ofself
using a PrettyPrinterVisitor
nitc :: ANode :: accept_reaching_defs
Apply a ReachingDefsAnalysis toself
.
nitc :: ANode :: accept_regex_visitor
nitc :: ANode :: accept_scope_visitor
nitc :: ANode :: accept_simple_misc
nitc :: ANode :: accept_string_finder
nitc :: AExpr :: accept_typing
nitc :: AExpr :: after_flow_context
The flow after the full evaluation of the expression/statementnitc :: AExpr :: after_flow_context=
The flow after the full evaluation of the expression/statementnitc :: ANode :: after_simple_misc
nitc :: AExpr :: allocate_mtype
Make themtype
of the expression live
nitc :: ANode :: bad_expr_message
An additional information message to explain the role of a child expression.nitc :: ANode :: check_callsite
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
nitc :: ANode :: collect_annotations_by_name
Do a deep search and return an array of node that are annotatednitc :: Prod :: collect_comments
Collect allTComment
contained in the production
nitc :: ANode :: collect_length
Collect the length (inChar
) of the node.
nitc :: ANode :: collect_tokens_by_text
Do a deep search and return an array of tokens that match a given textnitc :: ANode :: common_parent
The most specific common parent betweenself
and other
nitc :: AExpr :: comprehension
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AExpr :: comprehension=
Is non-null ifself
is a leaf of a comprehension array construction.
nitc :: AAugmentedLiteral :: content
Content of the entity, without prefix nor suffixnitc :: AAugmentedLiteral :: content=
Content of the entity, without prefix nor suffixnitc :: ANode :: create_contracts
nitc :: ANode :: decorate_tag
Add aditionnal information on a child-token and return an additionnal HInfoBox on itnitc :: AExpr :: defaultinit
core :: Object :: defaultinit
nitc :: ANode :: defaultinit
nitc :: Prod :: defaultinit
nitc :: AAugmentedLiteral :: defaultinit
core :: Cloneable :: defaultinit
nitc :: AExpr :: detach_with_placeholder
Thedetach
method completely remove the node in the parent.
nitc :: ANode :: do_cloneable
nitc :: AugmentedStringFormExpr :: extended
Regex::extended, used for suffixb
on re
nitc :: AugmentedStringFormExpr :: extended=
Regex::extended, used for suffixb
on re
nitc :: Prod :: first_location
Location on the first token after the start of a productionnitc :: Prod :: first_location=
Location on the first token after the start of a productionnitc :: Prod :: first_token
The first token of the production in the ASTnitc :: Prod :: first_token=
The first token of the production in the ASTnitc :: ANode :: force_block=
Forceself
to be rendered as a block.
nitc :: ANode :: force_inline=
Forceself
to be rendered as a line.
nitc :: ANode :: full_transform_visitor
nitc :: AExpr :: generate_basic_blocks
Generate recursively basic block for this expressionnitc :: Prod :: get_annotations
Return all its annotations of a given name in the order of their declarationnitc :: Prod :: get_single_annotation
Try to get its single annotation with a given namenitc :: ANode :: hot_location
The location of the important part of the node (identifier or whatever)nitc :: AugmentedStringFormExpr :: ignore_case
Regex::ignore_case, used for suffixi
on re
nitc :: AugmentedStringFormExpr :: ignore_case=
Regex::ignore_case, used for suffixi
on re
nitc :: AExpr :: implicit_cast_to
If required, the following implicit cast.as(XXX)
nitc :: AExpr :: implicit_cast_to=
If required, the following implicit cast.as(XXX)
nitc :: ANode :: is_broken=
The indication that the node did not pass some semantic verifications.nitc :: ANode :: is_noserialize
Is this node annotated to not be made serializable?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.
nitc :: ANode :: is_serialize
Is this node annotated to be made serializable?nitc :: ANode :: is_structural
Isself
a token or a pure-structural production like AQId
?
nitc :: AAugmentedLiteral :: is_valid_augmentation
Is the combination of prefixes and suffixes inself
valid ?
nitc :: Prod :: last_token
The last token of the production in the ASTnitc :: Prod :: last_token=
The last token of the production in the ASTnitc :: AugmentedStringFormExpr :: make_re
Factorize the making of aRegex
object from a literal prefixed string
nitc :: AugmentedStringFormExpr :: make_re
Factorize the making of aRegex
object from a literal prefixed string
nitc :: AExpr :: make_var_read
Return a new variable read that contains the value of the expressionnitc :: ANode :: must_be_block
Doesself
have to be rendered as a block?
nitc :: ANode :: must_be_inline
Doesself
have be rendered as a line?
nitc :: Prod :: n_annotations
All the annotations attached directly to the nodenitc :: Prod :: n_annotations=
All the annotations attached directly to the nodecore :: Object :: native_class_name
The class name of the object in CString format.nitc :: AugmentedStringFormExpr :: newline
Regex::newline, used for suffixm
on re
nitc :: AugmentedStringFormExpr :: newline=
Regex::newline, used for suffixm
on re
core :: Object :: output_class_name
Display class name on stdout (debug only).nitc :: ANode :: parentize_tokens
Visit the AST and computes advanced AST attributes on Tokens and Prodnitc :: AAugmentedLiteral :: prefix
Prefix for the entity, "" if no prefix is foundnitc :: AAugmentedLiteral :: prefix=
Prefix for the entity, "" if no prefix is foundnitc :: ANode :: replace_child
Replace a child with an other node in the ASTnitc :: ANode :: replace_with
Replace itself with an other node in the ASTnitc :: Prod :: start_token
The token where the production really start (skipping ADoc).nitc :: AAugmentedLiteral :: suffix
Suffix for the entity, "" if no prefix is foundnitc :: AAugmentedLiteral :: suffix=
Suffix for the entity, "" if no prefix is foundnitc :: AugmentedStringFormExpr :: to_bytes_with_copy
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: to_bytes_with_copy=
CString::to_bytes_with_copy, used for prefixb
nitc :: AugmentedStringFormExpr :: to_re
Text::to_re, used for prefixre
nitc :: AugmentedStringFormExpr :: to_re=
Text::to_re, used for prefixre
nitc :: AExpr :: vararg_decl
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: vararg_decl=
It indicates the number of arguments collected as a vararg.nitc :: AExpr :: variable_cache
nitc :: AExpr :: variable_cache=
nitc :: AExpr :: warn_parentheses
Warn in case of superfluous parenthesesnitc :: ANode :: was_inline
Doesself
was written in one line before transformation?
# Any kind of string form with augmentations from prefixes or suffixes
class AugmentedStringFormExpr
super AAugmentedLiteral
redef var delimiter_start = '"'
redef var delimiter_end = '"'
# Is `self` a regular String object ?
fun is_string: Bool do return prefix == "" or prefix == "raw"
# Is `self` a Regular Expression ?
fun is_re: Bool do return prefix == "re"
# Is `self` a Byte String ?
fun is_bytestring: Bool do return prefix == "b"
redef fun is_valid_augmentation do
if is_string and suffix == "" then return true
if is_bytestring and suffix == "" then return true
if is_re then
var suf = suffix
for i in suf.chars do
if i == 'i' then continue
if i == 'm' then continue
if i == 'b' then continue
return false
end
return true
end
if prefix != "" or suffix != "" then return false
return true
end
end
src/literal.nit:159,1--191,3
redef class AugmentedStringFormExpr
super AExpr
# Text::to_re, used for prefix `re`
var to_re: nullable CallSite = null
# Regex::ignore_case, used for suffix `i` on `re`
var ignore_case: nullable CallSite = null
# Regex::newline, used for suffix `m` on `re`
var newline: nullable CallSite = null
# Regex::extended, used for suffix `b` on `re`
var extended: nullable CallSite = null
# CString::to_bytes_with_copy, used for prefix `b`
var to_bytes_with_copy: nullable CallSite = null
redef fun accept_typing(v) do
var mclass = v.get_mclass(self, "String")
if mclass == null then return # Forward error
if is_bytestring then
to_bytes_with_copy = v.build_callsite_by_name(self, v.mmodule.c_string_type, "to_bytes_with_copy", false)
mclass = v.get_mclass(self, "Bytes")
else if is_re then
to_re = v.build_callsite_by_name(self, mclass.mclass_type, "to_re", false)
for i in suffix.chars do
mclass = v.get_mclass(self, "Regex")
if mclass == null then
v.error(self, "Error: `Regex` class unknown")
return
end
var service = ""
if i == 'i' then
service = "ignore_case="
ignore_case = v.build_callsite_by_name(self, mclass.mclass_type, service, false)
else if i == 'm' then
service = "newline="
newline = v.build_callsite_by_name(self, mclass.mclass_type, service, false)
else if i == 'b' then
service = "extended="
extended = v.build_callsite_by_name(self, mclass.mclass_type, service, false)
else
v.error(self, "Type Error: Unrecognized suffix {i} in prefixed Regex")
abort
end
end
end
if mclass == null then return # Forward error
mtype = mclass.mclass_type
end
end
src/semantize/typing.nit:1638,1--1685,3
redef class AugmentedStringFormExpr
# Factorize the making of a `Regex` object from a literal prefixed string
fun make_re(v: NaiveInterpreter, rs: Instance): nullable Instance do
var tore = to_re
assert tore != null
var res = v.callsite(tore, [rs])
if res == null then
print "Cannot call property `to_re` on {self}"
abort
end
for j in suffix.chars do
if j == 'i' then
var prop = ignore_case
assert prop != null
v.callsite(prop, [res, v.bool_instance(true)])
continue
end
if j == 'm' then
var prop = newline
assert prop != null
v.callsite(prop, [res, v.bool_instance(true)])
continue
end
if j == 'b' then
var prop = extended
assert prop != null
v.callsite(prop, [res, v.bool_instance(false)])
continue
end
# Should not happen, this needs to be updated
# along with the addition of new suffixes
abort
end
return res
end
end
src/interpreter/naive_interpreter.nit:2085,1--2120,3
redef class AugmentedStringFormExpr
# Factorize the making of a `Regex` object from a literal prefixed string
protected fun make_re(v: AbstractCompilerVisitor, rs: RuntimeVariable): nullable RuntimeVariable do
var re = to_re
assert re != null
var res = v.compile_callsite(re, [rs])
if res == null then
print "Cannot call property `to_re` on {self}"
abort
end
for i in suffix.chars do
if i == 'i' then
var ign = ignore_case
assert ign != null
v.compile_callsite(ign, [res, v.bool_instance(true)])
continue
end
if i == 'm' then
var nl = newline
assert nl != null
v.compile_callsite(nl, [res, v.bool_instance(true)])
continue
end
if i == 'b' then
var ext = extended
assert ext != null
v.compile_callsite(ext, [res, v.bool_instance(false)])
continue
end
# Should not happen, this needs to be updated
# along with the addition of new suffixes
abort
end
return res
end
end
src/compiler/abstract_compiler.nit:4151,1--4186,3