summaryrefslogtreecommitdiff
path: root/pygments/lexers/css.py
diff options
context:
space:
mode:
authorTim Hatch <tim@timhatch.com>2015-10-13 11:02:55 -0700
committerTim Hatch <tim@timhatch.com>2015-10-13 11:02:55 -0700
commitfa973263efa00282bf309656a508b41fc4b7ffce (patch)
tree3473b209a6796d640c75dedea47c7966c4c0cdfd /pygments/lexers/css.py
parentee3d1f6a66f2d54d2d4360993d275241e2072043 (diff)
downloadpygments-fa973263efa00282bf309656a508b41fc4b7ffce.tar.gz
Fixup SuperCollider, split out LessCss.
Diffstat (limited to 'pygments/lexers/css.py')
-rw-r--r--pygments/lexers/css.py32
1 files changed, 28 insertions, 4 deletions
diff --git a/pygments/lexers/css.py b/pygments/lexers/css.py
index 616667a3..4165bcc1 100644
--- a/pygments/lexers/css.py
+++ b/pygments/lexers/css.py
@@ -13,12 +13,12 @@ import re
import copy
from pygments.lexer import ExtendedRegexLexer, RegexLexer, include, bygroups, \
- default, words
+ default, words, inherit
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Number, Punctuation
from pygments.util import iteritems
-__all__ = ['CssLexer', 'SassLexer', 'ScssLexer']
+__all__ = ['CssLexer', 'SassLexer', 'ScssLexer', 'LessCssLexer']
class CssLexer(RegexLexer):
@@ -27,8 +27,8 @@ class CssLexer(RegexLexer):
"""
name = 'CSS'
- aliases = ['css', 'less']
- filenames = ['*.css', '*.less']
+ aliases = ['css']
+ filenames = ['*.css']
mimetypes = ['text/css']
tokens = {
@@ -497,3 +497,27 @@ class ScssLexer(RegexLexer):
tokens[group] = copy.copy(common)
tokens['value'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')])
tokens['selector'].extend([(r'\n', Text), (r'[;{}]', Punctuation, '#pop')])
+
+
+class LessCssLexer(CssLexer):
+ """
+ For `LESS <http://lesscss.org/>`_ styleshets.
+
+ .. versionadded:: 2.1
+ """
+
+ name = 'LessCss'
+ aliases = ['less']
+ filenames = ['*.less']
+ mimetypes = ['text/x-less-css']
+
+ tokens = {
+ 'root': [
+ (r'@\w+', Name.Variable),
+ inherit,
+ ],
+ 'content': [
+ (r'{', Punctuation, '#push'),
+ inherit,
+ ],
+ }