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

Side by Side Diff: src/scanner-base.cc

Issue 5295004: Preparser extracted into separate files that can be compiled to a library. (Closed)
Patch Set: Cleanup of preparse class. Created 10 years 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
« no previous file with comments | « src/scanner-base.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 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 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 if (!kIsIdentifierPart.get(buffer->GetNext())) { 85 if (!kIsIdentifierPart.get(buffer->GetNext())) {
86 return false; 86 return false;
87 } 87 }
88 } 88 }
89 return true; 89 return true;
90 } 90 }
91 91
92 // ---------------------------------------------------------------------------- 92 // ----------------------------------------------------------------------------
93 // Scanner 93 // Scanner
94 94
95 Scanner::Scanner() : source_(NULL), stack_overflow_(false) {} 95 Scanner::Scanner() : source_(NULL) {}
96 96
97 97
98 uc32 Scanner::ScanHexEscape(uc32 c, int length) { 98 uc32 Scanner::ScanHexEscape(uc32 c, int length) {
99 ASSERT(length <= 4); // prevent overflow 99 ASSERT(length <= 4); // prevent overflow
100 100
101 uc32 digits[4]; 101 uc32 digits[4];
102 uc32 x = 0; 102 uc32 x = 0;
103 for (int i = 0; i < length; i++) { 103 for (int i = 0; i < length; i++) {
104 digits[i] = c0_; 104 digits[i] = c0_;
105 int d = HexValue(c0_); 105 int d = HexValue(c0_);
(...skipping 808 matching lines...) Expand 10 before | Expand all | Expand 10 after
914 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return; 914 if (MatchKeywordStart(input, "with", 1, Token::WITH)) return;
915 break; 915 break;
916 case UNMATCHABLE: 916 case UNMATCHABLE:
917 break; 917 break;
918 } 918 }
919 // On fallthrough, it's a failure. 919 // On fallthrough, it's a failure.
920 state_ = UNMATCHABLE; 920 state_ = UNMATCHABLE;
921 } 921 }
922 922
923 } } // namespace v8::internal 923 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/scanner-base.h ('k') | test/cctest/test-parsing.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698