syntax:scopes:pair-scope

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
syntax:scopes:pair-scope [2015/11/26 14:56] adminsyntax:scopes:pair-scope [2018/01/10 20:43] (current) – external edit 127.0.0.1
Line 3: Line 3:
 Pair scopes are most common and most standard. To define //pair scope// you need to provide open and close tag. For example **Class** and **End Class**, to start your scope from word **Class** and end it by after **End Class**. Pair scopes are most common and most standard. To define //pair scope// you need to provide open and close tag. For example **Class** and **End Class**, to start your scope from word **Class** and end it by after **End Class**.
  
-<code xml><Scope open="Class" close="End Class" has_name="true" separator="true"/></code>+<code xml><Scope open="Case" middle="When" close="End Case" has_name="true" separator="true"/></code>
  
 ===== Attributes ===== ===== Attributes =====
Line 12: Line 12:
 //Value: any string.// //Value: any string.//
  
 +==== middle ====
 +Middle tag. Can be more than one, but than //extended// syntax shall be used.
 +
 +//Value: any string.//
 ==== close ==== ==== close ====
 Close Tag.  Close Tag. 
Line 47: Line 51:
  
 ==== sent_start ==== ==== sent_start ====
 +Marks that tag can appear only in beginning of the "sentence": so, characters before are white spaces or [[syntax:specification#lineend|LineEnd character]].
 +
 +
 Value: //true|false|0|1//\\ Value: //true|false|0|1//\\
 Default: //false// Default: //false//
  
 ==== header ==== ==== header ====
 +Indicates that scope will start not directly after end of the open tag, but after "header" ends. The header ends with next [[syntax:specification#lineend|line end character]].
 +
 +
 Value: //true|false|0|1//\\ Value: //true|false|0|1//\\
 Default: //false// Default: //false//
  
 +==== open_lead ====
 +[[terms:reverse-regular-expression|Reverse regular expression]], which shall lead text given in open tag.
 +
 +==== open_trail ====
 +Regular expression, which shall trail text given in open tag.
 +
 +==== close_lead ====
 +[[terms:reverse-regular-expression|Reverse regular expression]], which shall lead text given in close tag.
 +
 +==== close_trail ====
 +Regular expression, which shall trail text given in close tag.
 +
 +===== Extended Syntax =====
 +Extended syntax can be used, if you want to define more than one close or middle tag -> in this case you can additional //Middle// or //Close// nodes inside of //Scope// node. You can use in-line and extended modes in same definition.
 +<code xml><Scope open="if" middle="else" close="endif" header="true" sent_start="true">
 +    <Middle text="elseif" sent_start="true"/>
 +</Scope>
 +</code>
 +
 +Middle and Close tags defined in body of "Scope" node may redefine/have following attributes:
 +  * **text** -> actual value of tag
 +  * **strict** -> same as [[#strict|strict]] attribute above
 +  * **sent_start** -> same as [[#sent_start|sent_start]] attribute above
 +  * **lead** -> same as [[#close_lead|close_lead]] attribute above
 +  * **lead** -> same as [[#close_trail|close_trail]] attribute above