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

Side by Side Diff: src/flags.cc

Issue 221913004: Allow flags strings in quotes. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2006-2008 the V8 project authors. All rights reserved. 1 // Copyright 2006-2008 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after
492 492
493 493
494 static char* SkipBlackSpace(char* p) { 494 static char* SkipBlackSpace(char* p) {
495 while (*p != '\0' && isspace(*p) == 0) p++; 495 while (*p != '\0' && isspace(*p) == 0) p++;
496 return p; 496 return p;
497 } 497 }
498 498
499 499
500 // static 500 // static
501 int FlagList::SetFlagsFromString(const char* str, int len) { 501 int FlagList::SetFlagsFromString(const char* str, int len) {
502 // The string might be in quotes. Skip the quotes.
503 if (len >= 2 && (str[0] == '\'' || str[0] == '"') && str[0] == str[len - 1]) {
504 ++str;
505 len -= 2;
506 }
507
502 // make a 0-terminated copy of str 508 // make a 0-terminated copy of str
503 ScopedVector<char> copy0(len + 1); 509 ScopedVector<char> copy0(len + 1);
504 OS::MemCopy(copy0.start(), str, len); 510 OS::MemCopy(copy0.start(), str, len);
505 copy0[len] = '\0'; 511 copy0[len] = '\0';
506 512
507 // strip leading white space 513 // strip leading white space
508 char* copy = SkipWhiteSpace(copy0.start()); 514 char* copy = SkipWhiteSpace(copy0.start());
509 515
510 // count the number of 'arguments' 516 // count the number of 'arguments'
511 int argc = 1; // be compatible with SetFlagsFromCommandLine() 517 int argc = 1; // be compatible with SetFlagsFromCommandLine()
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
572 578
573 579
574 // static 580 // static
575 void FlagList::EnforceFlagImplications() { 581 void FlagList::EnforceFlagImplications() {
576 #define FLAG_MODE_DEFINE_IMPLICATIONS 582 #define FLAG_MODE_DEFINE_IMPLICATIONS
577 #include "flag-definitions.h" 583 #include "flag-definitions.h"
578 #undef FLAG_MODE_DEFINE_IMPLICATIONS 584 #undef FLAG_MODE_DEFINE_IMPLICATIONS
579 } 585 }
580 586
581 } } // namespace v8::internal 587 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698