Reviewers: marja,
Message:
Committed patchset #1 manually as r18686 (presubmit successful).
Description:
Experimental lexer: fix style issues.
[email protected]
Committed: https://code.google.com/p/v8/source/detail?r=18686
Please review this at https://codereview.chromium.org/143223002/
SVN Base: https://v8.googlecode.com/svn/branches/experimental/parser
Affected files (+13, -8 lines):
M src/char-predicates.h
M src/isolate.cc
M src/lexer/experimental-scanner.h
M src/lexer/lexer-shell.cc
M src/preparser.h
Index: src/char-predicates.h
diff --git a/src/char-predicates.h b/src/char-predicates.h
index
6e40e77b3bee601240df835d5c8fb0f942cd14d2..7495a554ba879503c63719d7cc968c1059dda46d
100644
--- a/src/char-predicates.h
+++ b/src/char-predicates.h
@@ -66,6 +66,7 @@ struct IdentifierPart {
}
};
+
struct IdentifierPartNotLetter {
static inline bool Is(uc32 c) {
return unibrow::Number::Is(c)
Index: src/isolate.cc
diff --git a/src/isolate.cc b/src/isolate.cc
index
068944f0833281800c1f38bca54e65e0a6e197e8..eb68ee9e63c5c0250a51948ec6fe48e29ab4dd36
100644
--- a/src/isolate.cc
+++ b/src/isolate.cc
@@ -1093,9 +1093,9 @@ void Isolate::UpdateScannersAfterGC(v8::Isolate*
isolate,
void Isolate::UpdateScannersAfterGC() {
for (std::set<ScannerBase*>::const_iterator it = scanners_.begin();
- it != scanners_.end();
- ++it)
+ it != scanners_.end(); ++it) {
(*it)->UpdateBufferBasedOnHandle();
+ }
}
Index: src/lexer/experimental-scanner.h
diff --git a/src/lexer/experimental-scanner.h
b/src/lexer/experimental-scanner.h
index
2edd7072cb810c2066c3cbd12bb6643c7c5245e5..8bcf61f207c113f201db092c100959e508282396
100644
--- a/src/lexer/experimental-scanner.h
+++ b/src/lexer/experimental-scanner.h
@@ -629,6 +629,7 @@ const Char* ExperimentalScanner<Char>::ScanEscape(
return cursor;
}
+
template<typename Char>
ScannerBase::Location ExperimentalScanner<Char>::octal_position() const {
if (!last_octal_end_)
Index: src/lexer/lexer-shell.cc
diff --git a/src/lexer/lexer-shell.cc b/src/lexer/lexer-shell.cc
index
0c90926f687edfd4c46b4b719f66061fd56f0e6a..bc884598cd10e34ed7d199c29f24b2db4c04f958
100644
--- a/src/lexer/lexer-shell.cc
+++ b/src/lexer/lexer-shell.cc
@@ -72,8 +72,7 @@ byte* ReadFile(const char* name, byte** end, int repeat,
}
*end = &chars[size];
- if (!convert_to_utf16)
- return chars;
+ if (!convert_to_utf16) return chars;
// Length of new_chars is not strictly accurate, but should be enough.
uint16_t* new_chars = new uint16_t[size];
@@ -83,8 +82,9 @@ byte* ReadFile(const char* name, byte** end, int repeat,
uc32 c;
// The 32-bit char type is probably only so that we can have -1 as a
return
// value. If the char is not -1, it should fit into 16 bits.
- while ((c = stream.Advance()) != -1)
+ while ((c = stream.Advance()) != -1) {
*cursor++ = c;
+ }
*end = reinterpret_cast<byte*>(cursor);
}
delete[] chars;
Index: src/preparser.h
diff --git a/src/preparser.h b/src/preparser.h
index
851be8bc87297fab6baaf154a16468fb2ee7b79c..d082763214a4628ef080e0325e9d3156813ac772
100644
--- a/src/preparser.h
+++ b/src/preparser.h
@@ -74,19 +74,22 @@ class ParserBase {
void set_allow_for_of(bool allow) { allow_for_of_ = allow; }
void set_allow_modules(bool allow) {
allow_harmony_modules_ = allow;
- if (scanner())
+ if (scanner()) {
scanner()->SetHarmonyModules(allow);
+ }
}
void set_allow_harmony_scoping(bool allow) {
allow_harmony_scoping_ = allow;
- if (scanner())
+ if (scanner()) {
scanner()->SetHarmonyScoping(allow);
+ }
}
void set_allow_harmony_numeric_literals(bool allow) {
allow_harmony_numeric_literals_ = allow;
- if (scanner())
+ if (scanner()) {
scanner()->SetHarmonyNumericLiterals(allow);
+ }
}
protected:
--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
---
You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.