syntax:scopes

This is an old revision of the document!


SCOPES

Scopes entities in the syntax schema define rules for calculating of the outlining (folding) structure, that actually allows you to fold code blocks, see nesting hierarchy, optimize smart highlight searches etc.

Node SCOPES contains a collection of scope definitions that can be used in the syntax.

<SCOPES>
    <Scope open="begin" close="end"/>
    <DynamicScope lead="&lt;" strict="false"/>  
    <IndentScope/>  
</SCOPES>

They can be:

  • Pair Scopes, based on open/close pair tags like {} or beginend in languages like C++ or Pascal ( defined with <Scope/> ).
  • Dynamic Scopes, which does not have predefined open/close tags, but tags which are determined in runtime, like used in XML/HTML for formatting tags ( defined with <DynamicScope/> ).
  • Indent Scopes, which do not dependent on tags at all, but controlled by indent level, as in Python, for example ( defined with <IndentScope/> ).

Every scope definition has his own set of properties, that can control outlining processing.

Scopes are inheritable: child syntax gets scopes defined in parent syntax.

If programming language does not support user defined regions (user defined collapsible regions) you can still do this, while editing in HippoEDIT.