| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of scanner; | 5 part of scanner; |
| 6 | 6 |
| 7 class FormalParameterType { | 7 class FormalParameterType { |
| 8 final String type; | 8 final String type; |
| 9 const FormalParameterType(this.type); | 9 const FormalParameterType(this.type); |
| 10 bool get isRequired => this == REQUIRED; | 10 bool get isRequired => this == REQUIRED; |
| (...skipping 1923 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1934 listener.handleLiteralInt(token); | 1934 listener.handleLiteralInt(token); |
| 1935 return token.next; | 1935 return token.next; |
| 1936 } | 1936 } |
| 1937 | 1937 |
| 1938 Token parseLiteralDouble(Token token) { | 1938 Token parseLiteralDouble(Token token) { |
| 1939 listener.handleLiteralDouble(token); | 1939 listener.handleLiteralDouble(token); |
| 1940 return token.next; | 1940 return token.next; |
| 1941 } | 1941 } |
| 1942 | 1942 |
| 1943 Token parseLiteralString(Token token) { | 1943 Token parseLiteralString(Token token) { |
| 1944 bool old = mayParseFunctionExpressions; |
| 1945 mayParseFunctionExpressions = true; |
| 1944 token = parseSingleLiteralString(token); | 1946 token = parseSingleLiteralString(token); |
| 1945 int count = 1; | 1947 int count = 1; |
| 1946 while (identical(token.kind, STRING_TOKEN)) { | 1948 while (identical(token.kind, STRING_TOKEN)) { |
| 1947 token = parseSingleLiteralString(token); | 1949 token = parseSingleLiteralString(token); |
| 1948 count++; | 1950 count++; |
| 1949 } | 1951 } |
| 1950 if (count > 1) { | 1952 if (count > 1) { |
| 1951 listener.handleStringJuxtaposition(count); | 1953 listener.handleStringJuxtaposition(count); |
| 1952 } | 1954 } |
| 1955 mayParseFunctionExpressions = old; |
| 1953 return token; | 1956 return token; |
| 1954 } | 1957 } |
| 1955 | 1958 |
| 1956 Token parseLiteralSymbol(Token token) { | 1959 Token parseLiteralSymbol(Token token) { |
| 1957 Token hashToken = token; | 1960 Token hashToken = token; |
| 1958 listener.beginLiteralSymbol(hashToken); | 1961 listener.beginLiteralSymbol(hashToken); |
| 1959 token = token.next; | 1962 token = token.next; |
| 1960 if (isUserDefinableOperator(token.stringValue)) { | 1963 if (isUserDefinableOperator(token.stringValue)) { |
| 1961 listener.handleOperator(token); | 1964 listener.handleOperator(token); |
| 1962 listener.endLiteralSymbol(hashToken, 1); | 1965 listener.endLiteralSymbol(hashToken, 1); |
| (...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2438 } | 2441 } |
| 2439 listener.handleContinueStatement(hasTarget, continueKeyword, token); | 2442 listener.handleContinueStatement(hasTarget, continueKeyword, token); |
| 2440 return expectSemicolon(token); | 2443 return expectSemicolon(token); |
| 2441 } | 2444 } |
| 2442 | 2445 |
| 2443 Token parseEmptyStatement(Token token) { | 2446 Token parseEmptyStatement(Token token) { |
| 2444 listener.handleEmptyStatement(token); | 2447 listener.handleEmptyStatement(token); |
| 2445 return expectSemicolon(token); | 2448 return expectSemicolon(token); |
| 2446 } | 2449 } |
| 2447 } | 2450 } |
| OLD | NEW |