Converting LESS to CSS is a three stage process. The incoming file is parsed
Less_parser into a syntax tree, then it is compiled into another tree
representing the CSS structure by
Less. The CSS tree is fed into a
Less_formatter which then outputs CSS as a string.
During the first compile, all values are reduced, which means that their types are brought to the lowest form before being dump as strings. This handles math equations, variable dereferences, and the like.
parse function of
Less is the entry point.
Less class creates an instance of the parser, feeds it LESS code,
then transforms the resulting tree to a CSS tree. This class also holds the
evaluation context, such as all available mixins and variables at any given
Less_parser class is only concerned with parsing its input.
Less_formatter takes a CSS tree, and dumps it to a formatted string,
handling things like indentation.