Commit dd03cb8a by Aaron Leung

Adding another constructor to the Token class. May come in handy.

parent 0cb702ba
#include <string> #include <string>
#include <sstream> #include <sstream>
#include <cstring>
#include "prelexer.hpp" #include "prelexer.hpp"
namespace Sass { namespace Sass {
...@@ -30,21 +31,31 @@ namespace Sass { ...@@ -30,21 +31,31 @@ namespace Sass {
operator bool() operator bool()
{ return begin && end && begin >= end; } { return begin && end && begin >= end; }
// static Token make() static Token make()
// { {
// Token t; Token t;
// t.begin = 0; t.begin = 0;
// t.end = 0; t.end = 0;
// return t; return t;
// } }
//
static Token make(const char* b = 0, const char* e = 0) static Token make(const char* s)
{
Token t;
t.begin = s;
t.end = s + std::strlen(s);
return t;
}
static Token make(const char* b, const char* e)
{ {
Token t; Token t;
t.begin = b; t.begin = b;
t.end = e; t.end = e;
return t; return t;
} }
}; };
struct Dimension { struct Dimension {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment