Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: runtime/vm/scanner.cc

Issue 2035453002: Pixels class prototype and test (not to be committed). Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: work in progress Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index f7ae4ac59525fca9ca450cce9d6fa356af548dbb..7bbf8e7c3316dac24ae8b1fd4ae5693c2c29fccd 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -344,9 +344,10 @@ void Scanner::ScanIdentChars(bool allow_dollar) {
}
-// Parse integer or double number literal of format:
-// NUMBER = INTEGER | DOUBLE
+// Parse integer, rational, or double number literal of format:
+// NUMBER = INTEGER | PIXELS | DOUBLE
// INTEGER = D+ | (("0x" | "0X") H+)
+// PIXELS = ((D+ ["." D*]) | ("." D+)) ("px" | "PX")
// DOUBLE = ((D+ ["." D*]) | ("." D+)) [ EXPONENT ]
// EXPONENT = ("e" | "E") ["+" | "-"] D+
void Scanner::ScanNumber(bool dec_point_seen) {
@@ -388,6 +389,12 @@ void Scanner::ScanNumber(bool dec_point_seen) {
while (IsDecimalDigit(c0_)) {
ReadChar();
}
+ } else if ((c0_ == 'p') && (LookaheadChar(1) == 'x')) {
+ ReadChar();
+ Recognize(Token::kPIXELS);
+ } else if ((c0_ == 'P') && (LookaheadChar(1) == 'X')) {
+ ReadChar();
+ Recognize(Token::kPIXELS);
}
}
if (current_token_.kind != Token::kILLEGAL) {
« no previous file with comments | « runtime/vm/raw_object_snapshot.cc ('k') | runtime/vm/snapshot.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698