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

Side by Side Diff: src/parser.cc

Issue 1201783003: Allow numeric literals to be checked for a decimal point. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: fix Created 5 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 unified diff | Download patch
« no previous file with comments | « src/ast-value-factory.cc ('k') | 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #include "src/api.h" 7 #include "src/api.h"
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/ast-literal-reindexer.h" 9 #include "src/ast-literal-reindexer.h"
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 return factory->NewNullLiteral(pos); 808 return factory->NewNullLiteral(pos);
809 case Token::TRUE_LITERAL: 809 case Token::TRUE_LITERAL:
810 return factory->NewBooleanLiteral(true, pos); 810 return factory->NewBooleanLiteral(true, pos);
811 case Token::FALSE_LITERAL: 811 case Token::FALSE_LITERAL:
812 return factory->NewBooleanLiteral(false, pos); 812 return factory->NewBooleanLiteral(false, pos);
813 case Token::SMI: { 813 case Token::SMI: {
814 int value = scanner->smi_value(); 814 int value = scanner->smi_value();
815 return factory->NewSmiLiteral(value, pos); 815 return factory->NewSmiLiteral(value, pos);
816 } 816 }
817 case Token::NUMBER: { 817 case Token::NUMBER: {
818 bool has_dot = scanner->ContainsDot();
818 double value = scanner->DoubleValue(); 819 double value = scanner->DoubleValue();
819 return factory->NewNumberLiteral(value, pos); 820 return factory->NewNumberLiteral(value, pos, has_dot);
820 } 821 }
821 default: 822 default:
822 DCHECK(false); 823 DCHECK(false);
823 } 824 }
824 return NULL; 825 return NULL;
825 } 826 }
826 827
827 828
828 Expression* ParserTraits::ExpressionFromIdentifier(const AstRawString* name, 829 Expression* ParserTraits::ExpressionFromIdentifier(const AstRawString* name,
829 int start_position, 830 int start_position,
(...skipping 5074 matching lines...) Expand 10 before | Expand all | Expand 10 after
5904 Expression* Parser::SpreadCallNew(Expression* function, 5905 Expression* Parser::SpreadCallNew(Expression* function,
5905 ZoneList<v8::internal::Expression*>* args, 5906 ZoneList<v8::internal::Expression*>* args,
5906 int pos) { 5907 int pos) {
5907 args->InsertAt(0, function, zone()); 5908 args->InsertAt(0, function, zone());
5908 5909
5909 return factory()->NewCallRuntime( 5910 return factory()->NewCallRuntime(
5910 ast_value_factory()->reflect_construct_string(), NULL, args, pos); 5911 ast_value_factory()->reflect_construct_string(), NULL, args, pos);
5911 } 5912 }
5912 } // namespace internal 5913 } // namespace internal
5913 } // namespace v8 5914 } // namespace v8
OLDNEW
« no previous file with comments | « src/ast-value-factory.cc ('k') | src/scanner.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698