velocity.py :  » Development » Leo » Leo-4.7.1-final » leo » modes » Python Open Source

Home
Python Open Source
1.3.1.2 Python
2.Ajax
3.Aspect Oriented
4.Blog
5.Build
6.Business Application
7.Chart Report
8.Content Management Systems
9.Cryptographic
10.Database
11.Development
12.Editor
13.Email
14.ERP
15.Game 2D 3D
16.GIS
17.GUI
18.IDE
19.Installer
20.IRC
21.Issue Tracker
22.Language Interface
23.Log
24.Math
25.Media Sound Audio
26.Mobile
27.Network
28.Parser
29.PDF
30.Project Management
31.RSS
32.Search
33.Security
34.Template Engines
35.Test
36.UML
37.USB Serial
38.Web Frameworks
39.Web Server
40.Web Services
41.Web Unit
42.Wiki
43.Windows
44.XML
Python Open Source » Development » Leo 
Leo » Leo 4.7.1 final » leo » modes » velocity.py
# Leo colorizer control file for velocity mode.
# This file is in the public domain.

# Properties for velocity mode.
properties = {
  "commentEnd": "*#",
  "commentStart": "#*",
  "lineComment": "##",
}

# Attributes dict for velocity_main ruleset.
velocity_main_attributes_dict = {
  "default": "null",
  "digit_re": "",
  "escape": "",
  "highlight_digits": "true",
  "ignore_case": "true",
  "no_word_sep": "",
}

# Attributes dict for velocity_velocity ruleset.
velocity_velocity_attributes_dict = {
  "default": "null",
  "digit_re": "",
  "escape": "",
  "highlight_digits": "true",
  "ignore_case": "true",
  "no_word_sep": "",
}

# Attributes dict for velocity_javascript ruleset.
velocity_javascript_attributes_dict = {
  "default": "MARKUP",
  "digit_re": "",
  "escape": "",
  "highlight_digits": "true",
  "ignore_case": "true",
  "no_word_sep": "",
}

# Attributes dict for velocity_javascript2 ruleset.
velocity_javascript2_attributes_dict = {
  "default": "MARKUP",
  "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
  "escape": "\\",
  "highlight_digits": "true",
  "ignore_case": "false",
  "no_word_sep": "",
}

# Attributes dict for velocity_back_to_html ruleset.
velocity_back_to_html_attributes_dict = {
  "default": "MARKUP",
  "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
  "escape": "\\",
  "highlight_digits": "true",
  "ignore_case": "false",
  "no_word_sep": "",
}

# Attributes dict for velocity_css ruleset.
velocity_css_attributes_dict = {
  "default": "MARKUP",
  "digit_re": "(0x[[:xdigit:]]+[lL]?|[[:digit:]]+(e[[:digit:]]*)?[lLdDfF]?)",
  "escape": "\\",
  "highlight_digits": "true",
  "ignore_case": "false",
  "no_word_sep": "",
}

# Attributes dict for velocity_css2 ruleset.
velocity_css2_attributes_dict = {
  "default": "MARKUP",
  "digit_re": "[[:digit:]]+(pt|pc|in|mm|cm|em|ex|px|ms|s|%)",
  "escape": "\\",
  "highlight_digits": "true",
  "ignore_case": "true",
  "no_word_sep": "-_",
}

# Dictionary of attributes dictionaries for velocity mode.
attributesDictDict = {
  "velocity_back_to_html": velocity_back_to_html_attributes_dict,
  "velocity_css": velocity_css_attributes_dict,
  "velocity_css2": velocity_css2_attributes_dict,
  "velocity_javascript": velocity_javascript_attributes_dict,
  "velocity_javascript2": velocity_javascript2_attributes_dict,
  "velocity_main": velocity_main_attributes_dict,
  "velocity_velocity": velocity_velocity_attributes_dict,
}

# Keywords dict for velocity_main ruleset.
velocity_main_keywords_dict = {}

# Keywords dict for velocity_velocity ruleset.
velocity_velocity_keywords_dict = {
  "#else": "keyword1",
  "#elseif": "keyword1",
  "#end": "keyword1",
  "#foreach": "keyword1",
  "#if": "keyword1",
  "#include": "keyword1",
  "#macro": "keyword1",
  "#parse": "keyword1",
  "#set": "keyword1",
  "#stop": "keyword1",
}

# Keywords dict for velocity_javascript ruleset.
velocity_javascript_keywords_dict = {}

# Keywords dict for velocity_javascript2 ruleset.
velocity_javascript2_keywords_dict = {}

# Keywords dict for velocity_back_to_html ruleset.
velocity_back_to_html_keywords_dict = {}

# Keywords dict for velocity_css ruleset.
velocity_css_keywords_dict = {}

# Keywords dict for velocity_css2 ruleset.
velocity_css2_keywords_dict = {}

# Dictionary of keywords dictionaries for velocity mode.
keywordsDictDict = {
  "velocity_back_to_html": velocity_back_to_html_keywords_dict,
  "velocity_css": velocity_css_keywords_dict,
  "velocity_css2": velocity_css2_keywords_dict,
  "velocity_javascript": velocity_javascript_keywords_dict,
  "velocity_javascript2": velocity_javascript2_keywords_dict,
  "velocity_main": velocity_main_keywords_dict,
  "velocity_velocity": velocity_velocity_keywords_dict,
}

# Rules for velocity_main ruleset.

def velocity_rule0(colorer, s, i):
    return colorer.match_span(s, i, kind="comment1", begin="<!--", end="-->",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule1(colorer, s, i):
    return colorer.match_span(s, i, kind="markup", begin="<SCRIPT", end="</SCRIPT>",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="velocity::javascript",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule2(colorer, s, i):
    return colorer.match_span(s, i, kind="markup", begin="<STYLE", end="</STYLE>",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="velocity::css",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule3(colorer, s, i):
    return colorer.match_span(s, i, kind="keyword2", begin="<!", end=">",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="xml::dtd-tags",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule4(colorer, s, i):
    return colorer.match_span(s, i, kind="markup", begin="<", end=">",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="html::tags",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule5(colorer, s, i):
    return colorer.match_span(s, i, kind="literal2", begin="&", end=";",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=True)


# Rules dict for velocity_main ruleset.
rulesDict1 = {
  "&": [velocity_rule5,],
  "<": [velocity_rule0,velocity_rule1,velocity_rule2,velocity_rule3,velocity_rule4,],
}

# Rules for velocity_velocity ruleset.

def velocity_rule6(colorer, s, i):
    return colorer.match_span(s, i, kind="comment2", begin="#*", end="*#",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="",exclude_match=False,
        no_escape=False, no_line_break=False, no_word_break=False)

def velocity_rule7(colorer, s, i):
    return colorer.match_eol_span(s, i, kind="comment3", seq="##",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="", exclude_match=False)

def velocity_rule8(colorer, s, i):
    return colorer.match_span(s, i, kind="keyword3", begin="${", end="}",
        at_line_start=False, at_whitespace_end=False, at_word_start=False,
        delegate="",exclude_match=False,
        no_escape=False, no_line_break=True, no_word_break=False)

def velocity_rule9(colorer, s, i):
    return colorer.match_mark_following(s, i, kind="keyword3", pattern="$!",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=False)

def velocity_rule10(colorer, s, i):
    return colorer.match_mark_following(s, i, kind="keyword3", pattern="$",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, exclude_match=False)

def velocity_rule11(colorer, s, i):
    return colorer.match_keywords(s, i)

# Rules dict for velocity_velocity ruleset.
rulesDict2 = {
  "#": [velocity_rule6,velocity_rule7,velocity_rule11,],
  "$": [velocity_rule8,velocity_rule9,velocity_rule10,],
  "0": [velocity_rule11,],
  "1": [velocity_rule11,],
  "2": [velocity_rule11,],
  "3": [velocity_rule11,],
  "4": [velocity_rule11,],
  "5": [velocity_rule11,],
  "6": [velocity_rule11,],
  "7": [velocity_rule11,],
  "8": [velocity_rule11,],
  "9": [velocity_rule11,],
  "@": [velocity_rule11,],
  "A": [velocity_rule11,],
  "B": [velocity_rule11,],
  "C": [velocity_rule11,],
  "D": [velocity_rule11,],
  "E": [velocity_rule11,],
  "F": [velocity_rule11,],
  "G": [velocity_rule11,],
  "H": [velocity_rule11,],
  "I": [velocity_rule11,],
  "J": [velocity_rule11,],
  "K": [velocity_rule11,],
  "L": [velocity_rule11,],
  "M": [velocity_rule11,],
  "N": [velocity_rule11,],
  "O": [velocity_rule11,],
  "P": [velocity_rule11,],
  "Q": [velocity_rule11,],
  "R": [velocity_rule11,],
  "S": [velocity_rule11,],
  "T": [velocity_rule11,],
  "U": [velocity_rule11,],
  "V": [velocity_rule11,],
  "W": [velocity_rule11,],
  "X": [velocity_rule11,],
  "Y": [velocity_rule11,],
  "Z": [velocity_rule11,],
  "a": [velocity_rule11,],
  "b": [velocity_rule11,],
  "c": [velocity_rule11,],
  "d": [velocity_rule11,],
  "e": [velocity_rule11,],
  "f": [velocity_rule11,],
  "g": [velocity_rule11,],
  "h": [velocity_rule11,],
  "i": [velocity_rule11,],
  "j": [velocity_rule11,],
  "k": [velocity_rule11,],
  "l": [velocity_rule11,],
  "m": [velocity_rule11,],
  "n": [velocity_rule11,],
  "o": [velocity_rule11,],
  "p": [velocity_rule11,],
  "q": [velocity_rule11,],
  "r": [velocity_rule11,],
  "s": [velocity_rule11,],
  "t": [velocity_rule11,],
  "u": [velocity_rule11,],
  "v": [velocity_rule11,],
  "w": [velocity_rule11,],
  "x": [velocity_rule11,],
  "y": [velocity_rule11,],
  "z": [velocity_rule11,],
}

# Rules for velocity_javascript ruleset.

def velocity_rule12(colorer, s, i):
    return colorer.match_seq(s, i, kind="markup", seq=">",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::javascript2")

def velocity_rule13(colorer, s, i):
    return colorer.match_seq(s, i, kind="markup", seq="SRC=",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::back_to_html")

# Rules dict for velocity_javascript ruleset.
rulesDict3 = {
  ">": [velocity_rule12,],
  "S": [velocity_rule13,],
}

# Rules for velocity_javascript2 ruleset.



# Rules dict for velocity_javascript2 ruleset.
rulesDict4 = {}

# Rules for velocity_back_to_html ruleset.

def velocity_rule14(colorer, s, i):
    return colorer.match_seq(s, i, kind="markup", seq=">",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::main")

# Rules dict for velocity_back_to_html ruleset.
rulesDict5 = {
  ">": [velocity_rule14,],
}

# Rules for velocity_css ruleset.

def velocity_rule15(colorer, s, i):
    return colorer.match_seq(s, i, kind="markup", seq=">",
        at_line_start=False, at_whitespace_end=False, at_word_start=False, delegate="velocity::css2")

# Rules dict for velocity_css ruleset.
rulesDict6 = {
  ">": [velocity_rule15,],
}

# Rules for velocity_css2 ruleset.



# Rules dict for velocity_css2 ruleset.
rulesDict7 = {}

# x.rulesDictDict for velocity mode.
rulesDictDict = {
  "velocity_back_to_html": rulesDict5,
  "velocity_css": rulesDict6,
  "velocity_css2": rulesDict7,
  "velocity_javascript": rulesDict3,
  "velocity_javascript2": rulesDict4,
  "velocity_main": rulesDict1,
  "velocity_velocity": rulesDict2,
}

# Import dict for velocity mode.
importDict = {
  "velocity_css2": ["velocity_css2::velocity","css::main",],
  "velocity_javascript2": ["velocity_javascript2::velocity","javascript::main",],
  "velocity_main": ["velocity_main::velocity",],
}

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.