Index: src/parsing/scanner.h |
diff --git a/src/parsing/scanner.h b/src/parsing/scanner.h |
index abaccf57254cb38bdf963556b63502a52430d2dc..84763f7c23e470ecb8b81e9c554411484523afff 100644 |
--- a/src/parsing/scanner.h |
+++ b/src/parsing/scanner.h |
@@ -46,8 +46,8 @@ inline int HexValue(uc32 c) { |
class Utf16CharacterStream { |
public: |
- Utf16CharacterStream() : pos_(0) { } |
- virtual ~Utf16CharacterStream() { } |
+ Utf16CharacterStream() : pos_(0) {} |
+ virtual ~Utf16CharacterStream() {} |
// Returns and advances past the next UTF-16 code unit in the input |
// stream. If there are no more code units, it returns a negative |
@@ -115,9 +115,7 @@ class Utf16CharacterStream { |
class DuplicateFinder { |
public: |
explicit DuplicateFinder(UnicodeCache* constants) |
- : unicode_constants_(constants), |
- backing_store_(16), |
- map_(&Match) { } |
+ : unicode_constants_(constants), backing_store_(16), map_(&Match) {} |
int AddOneByteSymbol(Vector<const uint8_t> key, int value); |
int AddTwoByteSymbol(Vector<const uint16_t> key, int value); |
@@ -164,7 +162,7 @@ class DuplicateFinder { |
class LiteralBuffer { |
public: |
- LiteralBuffer() : is_one_byte_(true), position_(0), backing_store_() { } |
+ LiteralBuffer() : is_one_byte_(true), position_(0), backing_store_() {} |
~LiteralBuffer() { backing_store_.Dispose(); } |
@@ -196,7 +194,7 @@ class LiteralBuffer { |
bool is_contextual_keyword(Vector<const char> keyword) const { |
return is_one_byte() && keyword.length() == position_ && |
- (memcmp(keyword.start(), backing_store_.start(), position_) == 0); |
+ (memcmp(keyword.start(), backing_store_.start(), position_) == 0); |
} |
Vector<const uint16_t> two_byte_literal() const { |
@@ -210,13 +208,10 @@ class LiteralBuffer { |
Vector<const uint8_t> one_byte_literal() const { |
DCHECK(is_one_byte_); |
return Vector<const uint8_t>( |
- reinterpret_cast<const uint8_t*>(backing_store_.start()), |
- position_); |
+ reinterpret_cast<const uint8_t*>(backing_store_.start()), position_); |
} |
- int length() const { |
- return is_one_byte_ ? position_ : (position_ >> 1); |
- } |
+ int length() const { return is_one_byte_ ? position_ : (position_ >> 1); } |
void ReduceLength(int delta) { |
position_ -= delta * (is_one_byte_ ? kOneByteSize : kUC16Size); |
@@ -302,12 +297,10 @@ class Scanner { |
explicit LiteralScope(Scanner* self) : scanner_(self), complete_(false) { |
scanner_->StartLiteral(); |
} |
- ~LiteralScope() { |
- if (!complete_) scanner_->DropLiteral(); |
- } |
- void Complete() { |
- complete_ = true; |
+ ~LiteralScope() { |
+ if (!complete_) scanner_->DropLiteral(); |
} |
+ void Complete() { complete_ = true; } |
private: |
Scanner* scanner_; |
@@ -335,12 +328,10 @@ class Scanner { |
// Representation of an interval of source positions. |
struct Location { |
- Location(int b, int e) : beg_pos(b), end_pos(e) { } |
- Location() : beg_pos(0), end_pos(0) { } |
+ Location(int b, int e) : beg_pos(b), end_pos(e) {} |
+ Location() : beg_pos(0), end_pos(0) {} |
- bool IsValid() const { |
- return beg_pos >= 0 && end_pos >= beg_pos; |
- } |
+ bool IsValid() const { return beg_pos >= 0 && end_pos >= beg_pos; } |
static Location invalid() { return Location(-1, -1); } |
@@ -394,8 +385,7 @@ class Scanner { |
double DoubleValue(); |
bool ContainsDot(); |
bool LiteralMatches(const char* data, int length, bool allow_escapes = true) { |
- if (is_literal_one_byte() && |
- literal_length() == length && |
+ if (is_literal_one_byte() && literal_length() == length && |
(allow_escapes || !literal_contains_escapes())) { |
const char* token = |
reinterpret_cast<const char*>(literal_one_byte_string().start()); |
@@ -408,8 +398,7 @@ class Scanner { |
} |
void IsGetOrSet(bool* is_get, bool* is_set) { |
- if (is_literal_one_byte() && |
- literal_length() == 3 && |
+ if (is_literal_one_byte() && literal_length() == 3 && |
!literal_contains_escapes()) { |
const char* token = |
reinterpret_cast<const char*>(literal_one_byte_string().start()); |