All Downloads are FREE. Search and download functionalities are using the official Maven repository.

modes.freemarker.xml Maven / Gradle / Ivy

The newest version!
<?xml version="1.0"?>

<!DOCTYPE MODE SYSTEM "xmode.dtd">

<!-- A JEdit mode configuration file for FTL (FreeMarker Template Language) 
     Note that this version will only work with JEdit 4.1pre6 or later. 
     by Jonathan Revusky, [email protected] -->

<MODE>
  <RULES IGNORE_CASE="FALSE">

    <!-- JavaScript -->
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN>&lt;script</BEGIN>
    <END>&lt;/script&gt;</END>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN>&lt;Script</BEGIN>
    <END>&lt;/Script&gt;</END>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::JAVASCRIPT">
    <BEGIN>&lt;SCRIPT</BEGIN>
    <END>&lt;/SCRIPT&gt;</END>
    </SPAN>

    <!-- stylesheet -->
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN>&lt;style</BEGIN>
    <END>&lt;/style&gt;</END>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN>&lt;Style</BEGIN>
    <END>&lt;/Style&gt;</END>
    </SPAN>
    <SPAN TYPE="MARKUP" DELEGATE="html::CSS">
    <BEGIN>&lt;STYLE</BEGIN>
    <END>&lt;/STYLE&gt;</END>
    </SPAN>

    <!-- XML/HTML comment -->
    <SPAN TYPE="COMMENT2" DELEGATE="xml::DTD-TAGS">
    <BEGIN>&lt;!--</BEGIN>
    <END>--&gt;</END>
    </SPAN>

    <!-- DTD instructions -->
    <SPAN TYPE="KEYWORD2" DELEGATE="xml::DTD-TAGS">
    <BEGIN>&lt;!</BEGIN>
    <END>&gt;</END>
    </SPAN>

    <!-- FTL markup starts here. -->

    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
      <BEGIN>${</BEGIN>
      <END>}</END>
    </SPAN>

    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
      <BEGIN>#{</BEGIN>
      <END>}</END>
    </SPAN>

    <SPAN_REGEXP TYPE="KEYWORD1" HASH_CHAR="&lt;" DELEGATE="EXPRESSION">
      <BEGIN>&lt;#ftl\&gt;</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>
    
    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="&lt;">
      <BEGIN>&lt;#?(if|elseif|switch|foreach|list|case|assign|local|global|setting|include|import|stop|escape|macro|function|transform|call|visit|recurse)(\s|/|$)</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="&lt;">
      <BEGIN>&lt;/#?(assign|local|global|if|switch|foreach|list|escape|macro|function|transform|compress|noescape)\&gt;</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="&lt;">
      <BEGIN>&lt;#?(else|compress|noescape|default|break|flush|nested|t|rt|lt|return|recurse)\&gt;</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="INVALID" HASH_CHAR="&lt;">
      <BEGIN>&lt;/@(([_@[:alpha:]][_@[:alnum:]]*)(\.[_@[:alpha:]][_@[:alnum:]]*)*)?</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>

    <SPAN_REGEXP TYPE="KEYWORD1" DELEGATE="EXPRESSION" HASH_CHAR="&lt;">
      <BEGIN>&lt;@([_@[:alpha:]][_@[:alnum:]]*)(\.[_@[:alpha:]][_@[:alnum:]]*)*</BEGIN>
      <END>&gt;</END>
    </SPAN_REGEXP>
    
    <SPAN TYPE="COMMENT1">
      <BEGIN>&lt;#--</BEGIN>
      <END>--&gt;</END>
    </SPAN>

    <SEQ TYPE="KEYWORD1">&lt;stop&gt;</SEQ>
     <SPAN TYPE="COMMENT1">
    <BEGIN>&lt;comment&gt;</BEGIN>
    <END>&lt;/comment&gt;</END>
    </SPAN>
    <SPAN TYPE="INVALID">
      <BEGIN>&lt;#</BEGIN>
      <END>&gt;</END>
    </SPAN>
    <SPAN TYPE="INVALID">
      <BEGIN>&lt;/#</BEGIN>
      <END>&gt;</END>
    </SPAN>

    <!-- non-FTL markup -->
    <SPAN TYPE="MARKUP" DELEGATE="TAGS">
    <BEGIN>&lt;</BEGIN>
    <END>&gt;</END>
    </SPAN>
  </RULES>

  <RULES SET="EXPRESSION"
      DEFAULT="KEYWORD2"
      HIGHLIGHT_DIGITS="TRUE"
      ESCAPE="\"
    >
    <SPAN TYPE="COMMENT1">
      <BEGIN>&lt;#--</BEGIN>
      <END>--&gt;</END>
    </SPAN>
    <SPAN TYPE="COMMENT1">
      <BEGIN>&lt;!--</BEGIN>
      <END>--&gt;</END>
    </SPAN>

    <SPAN TYPE="LITERAL1">
    <BEGIN>"</BEGIN>
    <END>"</END>
    </SPAN>
    <SPAN TYPE="OPERATOR" DELEGATE="EXPRESSION">
      <BEGIN>(</BEGIN><END>)</END>
    </SPAN>
    <SEQ TYPE="OPERATOR">=</SEQ>
    <SEQ TYPE="OPERATOR">!</SEQ>
    <SEQ TYPE="OPERATOR">|</SEQ>
    <SEQ TYPE="OPERATOR">&amp;</SEQ>
    <SEQ TYPE="OPERATOR">&lt;</SEQ>
    <SEQ TYPE="OPERATOR">&gt;</SEQ>
    <SEQ TYPE="OPERATOR">*</SEQ>
    <SEQ TYPE="OPERATOR">/</SEQ>
    <SEQ TYPE="OPERATOR">-</SEQ>
    <SEQ TYPE="OPERATOR">+</SEQ>
    <SEQ TYPE="OPERATOR">%</SEQ>
    <SEQ TYPE="OPERATOR">.</SEQ>
    <SEQ TYPE="OPERATOR">:</SEQ>
    <SEQ TYPE="OPERATOR">.</SEQ>
    <SEQ TYPE="OPERATOR">.</SEQ>
    <SEQ TYPE="OPERATOR">[</SEQ>
    <SEQ TYPE="OPERATOR">]</SEQ>
    <SEQ TYPE="OPERATOR">{</SEQ>
    <SEQ TYPE="OPERATOR">}</SEQ>
    <SEQ TYPE="OPERATOR">;</SEQ>
    <!-- Builtins -->
    <MARK_FOLLOWING TYPE="FUNCTION">?</MARK_FOLLOWING>
    <KEYWORDS IGNORE_CASE="FALSE">
      <KEYWORD1>true</KEYWORD1>
      <KEYWORD1>false</KEYWORD1>
      <KEYWORD1>as</KEYWORD1>
      <KEYWORD1>in</KEYWORD1>
      <KEYWORD1>using</KEYWORD1>
      <OPERATOR>gt</OPERATOR>
      <OPERATOR>gte</OPERATOR>
      <OPERATOR>lt</OPERATOR>
      <OPERATOR>lte</OPERATOR>
    </KEYWORDS>
  </RULES>

  <RULES SET="TAGS" DEFAULT="MARKUP" ESCAPE="\">
    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
    <BEGIN>"</BEGIN>
    <END>"</END>
    </SPAN>

    <SPAN TYPE="LITERAL1" DELEGATE="INQUOTE">
    <BEGIN>'</BEGIN>
    <END>'</END>
    </SPAN>

    <SEQ TYPE="OPERATOR">=</SEQ>
  </RULES>

  
  <!-- a ruleset for when we are within a quoted string within an SGML tag
       It can contain FTL interpolations -->
  <RULES SET="INQUOTE">
    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
    <BEGIN>${</BEGIN>
    <END>}</END>
    </SPAN>
    <SPAN TYPE="KEYWORD1" DELEGATE="EXPRESSION">
    <BEGIN>#{</BEGIN>
    <END>}</END>
    </SPAN>
  </RULES>

  <!-- empty ruleset to delegate to for spots where any non-whitespace is invalid -->
  <RULES SET="INVALID" DEFAULT="INVALID" />
</MODE>




© 2015 - 2024 Weber Informatics LLC | Privacy Policy