less-rs 0.0.0

A Rust implementation of the Less CSS preprocessor.
Documentation
// use cssparser::{Parser, ParserInput};
// use less_allocator::{Allocator, Vec};
// use parser::TopLevelRuleParser;
// use rules::CssRuleList;
// use traits::ToCss;
//
// mod error;
// mod parser;
// mod printer;
// mod properties;
// mod rules;
// mod selector;
// mod traits;
// mod values;
//
// /// In less specifications, syntax are defined as follows.
// ///
// /// The `primary` rule is the *entry* and *exit* point of the parser.
// /// The rules here can appear at any level of the parse tree.
// ///
// /// The recursive nature of the grammar is an interplay between the `block`
// /// rule, which represents `{ .. }`, the `ruleset` rule, and this `primary` rule,
// /// as represented by this simplified grammar:
// ///
// ///     primary  →  (ruleset | declaration)+
// ///     ruleset  →  selector+ block
// ///     block    →  '{' primary '}'
// ///
// /// Only at one point is the primary rule not called from the
// /// block rule: at the root level.
//
// pub fn parse(code: &str) {
//   let allocator = Allocator::default();
//   let mut input = ParserInput::new(code);
//   let mut parser = Parser::new(&mut input);
//
//   let rules = allocator.alloc(CssRuleList(Vec::new_in(&allocator)));
//   let mut at_rule_parser = TopLevelRuleParser::new(&allocator, rules);
//   let rule_set_parser = cssparser::StyleSheetParser::new(&mut parser, &mut at_rule_parser);
//
//   for rule in rule_set_parser {
//     dbg!(rule);
//   }
//
//   dbg!(&rules);
//   dbg!(allocator.allocated_bytes());
//
//   dbg!(rules.to_css_string(&allocator).unwrap());
// }
//
// #[cfg(test)]
// mod test {
//
//   use super::*;
//
//   // fn foo() {
//   //   let alloc = Allocator::default();
//   //
//   //   let mut v = Vec::new_in(&alloc);
//   //   v.push(1);
//   //   v.push(2)
//   // }
//
//   #[test]
//   fn test() {
//     // foo();
//     //
//     // println!("called");
//     let code = r#"
//     @foo: 16px;
//     .class {
//       @bar: 15px + @foo;
//       @r: 255
//       font-size: @bar + 17px;
//       background-color:rgb(0,0,1);
//     }
//     "#;
//     let code = r#"
//     @code: 255;
//     .class {
//       font-size: 16px + 12px;
//       background-color: rgb(0, 0, @code);
//       color: rgb(@code, 0, 1);
//     }
//     "#;
//     parse(code)
//   }
// }