32 lines
760 B
Python
Raw Normal View History

2012-03-30 19:32:11 +00:00
# -*- coding: utf8 -*-
2012-01-28 14:52:09 +00:00
"""
2012-03-30 19:32:11 +00:00
.. module:: lesscpy.plib.variable
:synopsis: Variable declaration
Copyright (c)
See LICENSE for details.
.. moduleauthor:: Jóhann T. Maríusson <jtm@robot.is>
2012-01-28 14:52:09 +00:00
"""
2012-02-19 20:38:19 +00:00
from .node import Node
2012-03-30 19:32:11 +00:00
2012-02-19 20:38:19 +00:00
class Variable(Node):
2012-02-25 17:08:08 +00:00
def parse(self, scope):
2012-03-30 19:32:11 +00:00
""" Parse function
args:
scope (Scope): Scope object
returns:
self
2012-02-25 17:08:08 +00:00
"""
2012-04-08 13:17:22 +00:00
self.name, _, self.value = self.tokens
2012-03-23 17:02:39 +00:00
if type(self.name) is tuple:
if len(self.name) > 1:
self.name, pad = self.name
self.value.append(pad)
else:
self.name = self.name[0]
2012-04-08 13:17:22 +00:00
scope.add_variable(self)
def fmt(self, fills):
return ''
2012-02-26 15:50:07 +00:00