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

Side by Side Diff: src/preparser.h

Issue 778813003: ES6 template literals: Fix issue with template after rbrace (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add tests without newlines Created 6 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 | « no previous file | src/scanner.h » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 2833 matching lines...) Expand 10 before | Expand all | Expand 10 after
2844 2844
2845 if (peek() != Token::RBRACE) { 2845 if (peek() != Token::RBRACE) {
2846 ReportMessageAt(Scanner::Location(pos, peek_position()), 2846 ReportMessageAt(Scanner::Location(pos, peek_position()),
2847 "unterminated_template_expr"); 2847 "unterminated_template_expr");
2848 *ok = false; 2848 *ok = false;
2849 return Traits::EmptyExpression(); 2849 return Traits::EmptyExpression();
2850 } 2850 }
2851 2851
2852 // If we didn't die parsing that expression, our next token should be a 2852 // If we didn't die parsing that expression, our next token should be a
2853 // TEMPLATE_SPAN or TEMPLATE_TAIL. 2853 // TEMPLATE_SPAN or TEMPLATE_TAIL.
2854 next = scanner()->ScanTemplateSpan(); 2854 next = scanner()->ScanTemplateContinuation();
2855 Next(); 2855 Next();
2856 2856
2857 if (!next) { 2857 if (!next) {
2858 ReportMessageAt(Scanner::Location(start, position()), 2858 ReportMessageAt(Scanner::Location(start, position()),
2859 "unterminated_template"); 2859 "unterminated_template");
2860 *ok = false; 2860 *ok = false;
2861 return Traits::EmptyExpression(); 2861 return Traits::EmptyExpression();
2862 } 2862 }
2863 2863
2864 Traits::AddTemplateSpan(&ts, next == Token::TEMPLATE_TAIL); 2864 Traits::AddTemplateSpan(&ts, next == Token::TEMPLATE_TAIL);
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
2922 DCHECK(IsAccessorAccessorConflict(old_type, type)); 2922 DCHECK(IsAccessorAccessorConflict(old_type, type));
2923 // Both accessors of the same type. 2923 // Both accessors of the same type.
2924 parser()->ReportMessage("accessor_get_set"); 2924 parser()->ReportMessage("accessor_get_set");
2925 } 2925 }
2926 *ok = false; 2926 *ok = false;
2927 } 2927 }
2928 } 2928 }
2929 } } // v8::internal 2929 } } // v8::internal
2930 2930
2931 #endif // V8_PREPARSER_H 2931 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « no previous file | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698