| OLD | NEW |
| 1 // This code was auto-generated, is not intended to be edited, and is subject to | 1 // This code was auto-generated, is not intended to be edited, and is subject to |
| 2 // significant change. Please see the README file for more information. | 2 // significant change. Please see the README file for more information. |
| 3 | 3 |
| 4 library engine.ast; | 4 library engine.ast; |
| 5 | 5 |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'java_core.dart'; | 7 import 'java_core.dart'; |
| 8 import 'java_engine.dart'; | 8 import 'java_engine.dart'; |
| 9 import 'source.dart' show LineInfo; | 9 import 'source.dart' show LineInfo; |
| 10 import 'scanner.dart'; | 10 import 'scanner.dart'; |
| (...skipping 9966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 9977 /** | 9977 /** |
| 9978 * Instances of the class `SimpleStringLiteral` represent a string literal expre
ssion that | 9978 * Instances of the class `SimpleStringLiteral` represent a string literal expre
ssion that |
| 9979 * does not contain any interpolations. | 9979 * does not contain any interpolations. |
| 9980 * | 9980 * |
| 9981 * <pre> | 9981 * <pre> |
| 9982 * simpleStringLiteral ::= | 9982 * simpleStringLiteral ::= |
| 9983 * rawStringLiteral | 9983 * rawStringLiteral |
| 9984 * | basicStringLiteral | 9984 * | basicStringLiteral |
| 9985 * | 9985 * |
| 9986 * rawStringLiteral ::= | 9986 * rawStringLiteral ::= |
| 9987 * '@' basicStringLiteral | 9987 * 'r' basicStringLiteral |
| 9988 * | 9988 * |
| 9989 * simpleStringLiteral ::= | 9989 * simpleStringLiteral ::= |
| 9990 * multiLineStringLiteral | 9990 * multiLineStringLiteral |
| 9991 * | singleLineStringLiteral | 9991 * | singleLineStringLiteral |
| 9992 * | 9992 * |
| 9993 * multiLineStringLiteral ::= | 9993 * multiLineStringLiteral ::= |
| 9994 * "'''" characters "'''" | 9994 * "'''" characters "'''" |
| 9995 * | '"""' characters '"""' | 9995 * | '"""' characters '"""' |
| 9996 * | 9996 * |
| 9997 * singleLineStringLiteral ::= | 9997 * singleLineStringLiteral ::= |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10029 Token get endToken => literal; | 10029 Token get endToken => literal; |
| 10030 | 10030 |
| 10031 /** | 10031 /** |
| 10032 * Return the value of the literal. | 10032 * Return the value of the literal. |
| 10033 * | 10033 * |
| 10034 * @return the value of the literal | 10034 * @return the value of the literal |
| 10035 */ | 10035 */ |
| 10036 String get value => _value; | 10036 String get value => _value; |
| 10037 | 10037 |
| 10038 /** | 10038 /** |
| 10039 * Return the offset of the first value character. |
| 10040 * |
| 10041 * @return the offset of the first value character |
| 10042 */ |
| 10043 int get valueOffset { |
| 10044 int valueOffset = 0; |
| 10045 if (isRaw) { |
| 10046 valueOffset += 1; |
| 10047 } |
| 10048 if (isMultiline) { |
| 10049 valueOffset += 3; |
| 10050 } else { |
| 10051 valueOffset += 1; |
| 10052 } |
| 10053 return offset + valueOffset; |
| 10054 } |
| 10055 |
| 10056 /** |
| 10039 * Return `true` if this string literal is a multi-line string. | 10057 * Return `true` if this string literal is a multi-line string. |
| 10040 * | 10058 * |
| 10041 * @return `true` if this string literal is a multi-line string | 10059 * @return `true` if this string literal is a multi-line string |
| 10042 */ | 10060 */ |
| 10043 bool get isMultiline { | 10061 bool get isMultiline { |
| 10044 if (_value.length < 6) { | 10062 String lexeme = literal.lexeme; |
| 10063 if (lexeme.length < 6) { |
| 10045 return false; | 10064 return false; |
| 10046 } | 10065 } |
| 10047 return _value.endsWith("\"\"\"") || _value.endsWith("'''"); | 10066 return lexeme.endsWith("\"\"\"") || lexeme.endsWith("'''"); |
| 10048 } | 10067 } |
| 10049 | 10068 |
| 10050 /** | 10069 /** |
| 10051 * Return `true` if this string literal is a raw string. | 10070 * Return `true` if this string literal is a raw string. |
| 10052 * | 10071 * |
| 10053 * @return `true` if this string literal is a raw string | 10072 * @return `true` if this string literal is a raw string |
| 10054 */ | 10073 */ |
| 10055 bool get isRaw => _value.codeUnitAt(0) == 0x40; | 10074 bool get isRaw => literal.lexeme.codeUnitAt(0) == 0x72; |
| 10056 | 10075 |
| 10057 bool get isSynthetic => literal.isSynthetic; | 10076 bool get isSynthetic => literal.isSynthetic; |
| 10058 | 10077 |
| 10059 /** | 10078 /** |
| 10060 * Set the value of the literal to the given string. | 10079 * Set the value of the literal to the given string. |
| 10061 * | 10080 * |
| 10062 * @param string the value of the literal | 10081 * @param string the value of the literal |
| 10063 */ | 10082 */ |
| 10064 void set value(String string) { | 10083 void set value(String string) { |
| 10065 _value = StringUtilities.intern(_value); | 10084 _value = StringUtilities.intern(_value); |
| (...skipping 6222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 16288 } | 16307 } |
| 16289 void operator[]=(int index, E node) { | 16308 void operator[]=(int index, E node) { |
| 16290 if (index < 0 || index >= _elements.length) { | 16309 if (index < 0 || index >= _elements.length) { |
| 16291 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); | 16310 throw new RangeError("Index: ${index}, Size: ${_elements.length}"); |
| 16292 } | 16311 } |
| 16293 owner.becomeParentOf(node); | 16312 owner.becomeParentOf(node); |
| 16294 _elements[index] = node; | 16313 _elements[index] = node; |
| 16295 } | 16314 } |
| 16296 int get length => _elements.length; | 16315 int get length => _elements.length; |
| 16297 } | 16316 } |
| OLD | NEW |