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

Side by Side Diff: src/parser.cc

Issue 133343003: Experimental parser: add braces. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 11 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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 550 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 if (FLAG_trace_parse) { 561 if (FLAG_trace_parse) {
562 timer.Start(); 562 timer.Start();
563 } 563 }
564 fni_ = new(zone()) FuncNameInferrer(isolate(), zone()); 564 fni_ = new(zone()) FuncNameInferrer(isolate(), zone());
565 565
566 // Initialize parser state. 566 // Initialize parser state.
567 source = FlattenGetString(source); 567 source = FlattenGetString(source);
568 FunctionLiteral* result; 568 FunctionLiteral* result;
569 delete reusable_preparser_; 569 delete reusable_preparser_;
570 delete scanner_; 570 delete scanner_;
571 if (source->IsTwoByteRepresentation()) 571 if (source->IsTwoByteRepresentation()) {
572 scanner_ = new ExperimentalScanner<uint16_t>(source, isolate()); 572 scanner_ = new ExperimentalScanner<uint16_t>(source, isolate());
573 else 573 } else {
574 scanner_ = new ExperimentalScanner<uint8_t>(source, isolate()); 574 scanner_ = new ExperimentalScanner<uint8_t>(source, isolate());
575 }
575 SetScannerFlags(); 576 SetScannerFlags();
576 scanner_->Init(); 577 scanner_->Init();
577 result = DoParseProgram(info(), source); 578 result = DoParseProgram(info(), source);
578 579
579 if (FLAG_trace_parse && result != NULL) { 580 if (FLAG_trace_parse && result != NULL) {
580 double ms = timer.Elapsed().InMillisecondsF(); 581 double ms = timer.Elapsed().InMillisecondsF();
581 if (info()->is_eval()) { 582 if (info()->is_eval()) {
582 PrintF("[parsing eval"); 583 PrintF("[parsing eval");
583 } else if (info()->script()->name()->IsString()) { 584 } else if (info()->script()->name()->IsString()) {
584 String* name = String::cast(info()->script()->name()); 585 String* name = String::cast(info()->script()->name());
(...skipping 5100 matching lines...) Expand 10 before | Expand all | Expand 10 after
5685 } 5686 }
5686 5687
5687 5688
5688 void Parser::SetScannerFlags() { 5689 void Parser::SetScannerFlags() {
5689 scanner_->SetHarmonyScoping(allow_harmony_scoping_); 5690 scanner_->SetHarmonyScoping(allow_harmony_scoping_);
5690 scanner_->SetHarmonyModules(allow_harmony_modules_); 5691 scanner_->SetHarmonyModules(allow_harmony_modules_);
5691 scanner_->SetHarmonyNumericLiterals(allow_harmony_numeric_literals_); 5692 scanner_->SetHarmonyNumericLiterals(allow_harmony_numeric_literals_);
5692 } 5693 }
5693 5694
5694 } } // namespace v8::internal 5695 } } // 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