summaryrefslogtreecommitdiff
path: root/modules/regex
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2021-07-30 15:28:05 +0200
committerRémi Verschelde <rverschelde@gmail.com>2021-07-30 15:29:52 +0200
commit7adf4cc9b5de6701a41e27690a69b9892d5eed85 (patch)
tree0019e6d1b7cd993b81d5bba268074cfc4e10a213 /modules/regex
parenta1c19b9a1e53f78c75c13cb418270db80057b21a (diff)
doc: Use self-closing tags for `return` and `argument`
For the time being we don't support writing a description for those, preferring having all details in the method's description. Using self-closing tags saves half the lines, and prevents contributors from thinking that they should write the argument or return documentation there.
Diffstat (limited to 'modules/regex')
-rw-r--r--modules/regex/doc_classes/RegEx.xml63
-rw-r--r--modules/regex/doc_classes/RegExMatch.xml21
2 files changed, 28 insertions, 56 deletions
diff --git a/modules/regex/doc_classes/RegEx.xml b/modules/regex/doc_classes/RegEx.xml
index 7f5a0dfecb..9c84974ff6 100644
--- a/modules/regex/doc_classes/RegEx.xml
+++ b/modules/regex/doc_classes/RegEx.xml
@@ -50,88 +50,67 @@
</tutorials>
<methods>
<method name="clear">
- <return type="void">
- </return>
+ <return type="void" />
<description>
This method resets the state of the object, as if it was freshly created. Namely, it unassigns the regular expression of this object.
</description>
</method>
<method name="compile">
- <return type="int" enum="Error">
- </return>
- <argument index="0" name="pattern" type="String">
- </argument>
+ <return type="int" enum="Error" />
+ <argument index="0" name="pattern" type="String" />
<description>
Compiles and assign the search pattern to use. Returns [constant OK] if the compilation is successful. If an error is encountered, details are printed to standard output and an error is returned.
</description>
</method>
<method name="get_group_count" qualifiers="const">
- <return type="int">
- </return>
+ <return type="int" />
<description>
Returns the number of capturing groups in compiled pattern.
</description>
</method>
<method name="get_names" qualifiers="const">
- <return type="Array">
- </return>
+ <return type="Array" />
<description>
Returns an array of names of named capturing groups in the compiled pattern. They are ordered by appearance.
</description>
</method>
<method name="get_pattern" qualifiers="const">
- <return type="String">
- </return>
+ <return type="String" />
<description>
Returns the original search pattern that was compiled.
</description>
</method>
<method name="is_valid" qualifiers="const">
- <return type="bool">
- </return>
+ <return type="bool" />
<description>
Returns whether this object has a valid search pattern assigned.
</description>
</method>
<method name="search" qualifiers="const">
- <return type="RegExMatch">
- </return>
- <argument index="0" name="subject" type="String">
- </argument>
- <argument index="1" name="offset" type="int" default="0">
- </argument>
- <argument index="2" name="end" type="int" default="-1">
- </argument>
+ <return type="RegExMatch" />
+ <argument index="0" name="subject" type="String" />
+ <argument index="1" name="offset" type="int" default="0" />
+ <argument index="2" name="end" type="int" default="-1" />
<description>
Searches the text for the compiled pattern. Returns a [RegExMatch] container of the first matching result if found, otherwise [code]null[/code]. The region to search within can be specified without modifying where the start and end anchor would be.
</description>
</method>
<method name="search_all" qualifiers="const">
- <return type="Array">
- </return>
- <argument index="0" name="subject" type="String">
- </argument>
- <argument index="1" name="offset" type="int" default="0">
- </argument>
- <argument index="2" name="end" type="int" default="-1">
- </argument>
+ <return type="Array" />
+ <argument index="0" name="subject" type="String" />
+ <argument index="1" name="offset" type="int" default="0" />
+ <argument index="2" name="end" type="int" default="-1" />
<description>
Searches the text for the compiled pattern. Returns an array of [RegExMatch] containers for each non-overlapping result. If no results were found, an empty array is returned instead. The region to search within can be specified without modifying where the start and end anchor would be.
</description>
</method>
<method name="sub" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="subject" type="String">
- </argument>
- <argument index="1" name="replacement" type="String">
- </argument>
- <argument index="2" name="all" type="bool" default="false">
- </argument>
- <argument index="3" name="offset" type="int" default="0">
- </argument>
- <argument index="4" name="end" type="int" default="-1">
- </argument>
+ <return type="String" />
+ <argument index="0" name="subject" type="String" />
+ <argument index="1" name="replacement" type="String" />
+ <argument index="2" name="all" type="bool" default="false" />
+ <argument index="3" name="offset" type="int" default="0" />
+ <argument index="4" name="end" type="int" default="-1" />
<description>
Searches the text for the compiled pattern and replaces it with the specified string. Escapes and backreferences such as [code]$1[/code] and [code]$name[/code] are expanded and resolved. By default, only the first instance is replaced, but it can be changed for all instances (global replacement). The region to search within can be specified without modifying where the start and end anchor would be.
</description>
diff --git a/modules/regex/doc_classes/RegExMatch.xml b/modules/regex/doc_classes/RegExMatch.xml
index 492519d3d9..3cde2836cc 100644
--- a/modules/regex/doc_classes/RegExMatch.xml
+++ b/modules/regex/doc_classes/RegExMatch.xml
@@ -10,37 +10,30 @@
</tutorials>
<methods>
<method name="get_end" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="name" type="Variant" default="0">
- </argument>
+ <return type="int" />
+ <argument index="0" name="name" type="Variant" default="0" />
<description>
Returns the end position of the match within the source string. The end position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
Returns -1 if the group did not match or doesn't exist.
</description>
</method>
<method name="get_group_count" qualifiers="const">
- <return type="int">
- </return>
+ <return type="int" />
<description>
Returns the number of capturing groups.
</description>
</method>
<method name="get_start" qualifiers="const">
- <return type="int">
- </return>
- <argument index="0" name="name" type="Variant" default="0">
- </argument>
+ <return type="int" />
+ <argument index="0" name="name" type="Variant" default="0" />
<description>
Returns the starting position of the match within the source string. The starting position of capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
Returns -1 if the group did not match or doesn't exist.
</description>
</method>
<method name="get_string" qualifiers="const">
- <return type="String">
- </return>
- <argument index="0" name="name" type="Variant" default="0">
- </argument>
+ <return type="String" />
+ <argument index="0" name="name" type="Variant" default="0" />
<description>
Returns the substring of the match from the source string. Capturing groups can be retrieved by providing its group number as an integer or its string name (if it's a named group). The default value of 0 refers to the whole pattern.
Returns an empty string if the group did not match or doesn't exist.