Changeset 119

Show
Ignore:
Timestamp:
04/12/08 13:17:03 (4 years ago)
Author:
phil
Message:

SPARQL lexer Added Describe and base keywords

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • tools/trunk/pygments/lexers/sw.py

    r118 r119  
    3636        'root': [ 
    3737            include('comments'), 
    38             (r'(\s*@prefix\s)(\s*\w*:\s+)(<[^> ]*>\s*\.\s*)',bygroups(Keyword,Name.Variable,Name.Namespace)), 
     38            (r'(\s*@(?:prefix|base|keywords)\s*)(\w*:\s+)?(<[^> ]*>\s*\.\s*)',bygroups(Keyword,Name.Variable,Name.Namespace)), 
    3939            (r'\s*(<[^>]*\>)', Name.Class, ('triple','predObj')), 
    4040            (r'(\s*[a-zA-Z_:][a-zA-Z0-9\-_:]*\s)', Name.Class, ('triple','predObj')), 
     
    8484        'root': [ 
    8585            include('comments'),         
    86             (r'(\s*PREFIX\s)(\s*\w*:\s+)(<[^> ]*>\s*)',bygroups(Keyword,Name.Variable,Name.Namespace)), 
     86            (r'(\s*(?:PREFIX|BASE)\s+)(\w*:\w*)?(\s*<[^> ]*>\s*)',bygroups(Keyword,Name.Variable,Name.Namespace)), 
    8787            (r'(\s*#.*)', Comment), 
    88             (r'((?:SELECT|ASK|CONSTRUCT)\s*(?:DISTINCT|REDUCED)?\s*)((?:\?[a-zA-Z0-9_-]+\s*)+|\*)(\s*)',bygroups(Keyword,Name.Variable,Text)), 
     88            (r'((?:SELECT|ASK|CONSTRUCT|DESCRIBE)\s*(?:DISTINCT|REDUCED)?\s*)((?:\?[a-zA-Z0-9_-]+\s*)+|\*)(\s*)',bygroups(Keyword,Name.Variable,Text)), 
    8989            (r'(FROM\s*(?:NAMED)?)(\s*.*)', bygroups(Keyword,Text)), 
    9090            (r'(WHERE)?\s*({)',bygroups(Keyword,Text),'graph'),