| Index: pkg/analyzer/lib/src/generated/utilities_collection.dart
|
| diff --git a/pkg/analyzer/lib/src/generated/utilities_collection.dart b/pkg/analyzer/lib/src/generated/utilities_collection.dart
|
| index 1e4961585c13203409fa76d7ef799aedc407ab2c..85d6a76354b0c71e484dfe79127ce98c6662d537 100644
|
| --- a/pkg/analyzer/lib/src/generated/utilities_collection.dart
|
| +++ b/pkg/analyzer/lib/src/generated/utilities_collection.dart
|
| @@ -11,6 +11,76 @@ import 'java_core.dart';
|
| import 'scanner.dart' show Token;
|
|
|
| /**
|
| + * The class `BooleanArray` defines methods for operating on integers as if they were arrays
|
| + * of booleans. These arrays can be indexed by either integers or by enumeration constants.
|
| + */
|
| +class BooleanArray {
|
| + /**
|
| + * Return the value of the element at the given index.
|
| + *
|
| + * @param array the array being accessed
|
| + * @param index the index of the element being accessed
|
| + * @return the value of the element at the given index
|
| + * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + */
|
| + static bool get(int array, int index) {
|
| + _checkIndex(index);
|
| + return (array & (1 << index)) > 0;
|
| + }
|
| +
|
| + /**
|
| + * Return the value of the element at the given index.
|
| + *
|
| + * @param array the array being accessed
|
| + * @param index the index of the element being accessed
|
| + * @return the value of the element at the given index
|
| + * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + */
|
| + static bool getEnum(int array, Enum index) => get(array, index.ordinal);
|
| +
|
| + /**
|
| + * Set the value of the element at the given index to the given value.
|
| + *
|
| + * @param array the array being modified
|
| + * @param index the index of the element being set
|
| + * @param value the value to be assigned to the element
|
| + * @return the updated value of the array
|
| + * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + */
|
| + static int set(int array, int index, bool value) {
|
| + _checkIndex(index);
|
| + if (value) {
|
| + return array | (1 << index);
|
| + } else {
|
| + return array & ~(1 << index);
|
| + }
|
| + }
|
| +
|
| + /**
|
| + * Set the value of the element at the given index to the given value.
|
| + *
|
| + * @param array the array being modified
|
| + * @param index the index of the element being set
|
| + * @param value the value to be assigned to the element
|
| + * @return the updated value of the array
|
| + * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + */
|
| + static int setEnum(int array, Enum index, bool value) => set(array, index.ordinal, value);
|
| +
|
| + /**
|
| + * Throw an exception if the index is not within the bounds allowed for an integer-encoded array
|
| + * of boolean values.
|
| + *
|
| + * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + */
|
| + static void _checkIndex(int index) {
|
| + if (index < 0 || index > 30) {
|
| + throw new RangeError("Index not between 0 and 30: ${index}");
|
| + }
|
| + }
|
| +}
|
| +
|
| +/**
|
| * Instances of the class `DirectedGraph` implement a directed graph in which the nodes are
|
| * arbitrary (client provided) objects and edges are represented implicitly. The graph will allow an
|
| * edge from any node to any other node, including itself, but will not represent multiple edges
|
| @@ -336,33 +406,21 @@ class DirectedGraph_SccFinder<N> {
|
| }
|
|
|
| /**
|
| - * Instances of the class `TokenMap` map one set of tokens to another set of tokens.
|
| + * The class `ListUtilities` defines utility methods useful for working with [List
|
| + ].
|
| */
|
| -class TokenMap {
|
| - /**
|
| - * A table mapping tokens to tokens. This should be replaced by a more performant implementation.
|
| - * One possibility is a pair of parallel arrays, with keys being sorted by their offset and a
|
| - * cursor indicating where to start searching.
|
| - */
|
| - Map<Token, Token> _map = new Map<Token, Token>();
|
| -
|
| - /**
|
| - * Return the token that is mapped to the given token, or `null` if there is no token
|
| - * corresponding to the given token.
|
| - *
|
| - * @param key the token being mapped to another token
|
| - * @return the token that is mapped to the given token
|
| - */
|
| - Token get(Token key) => _map[key];
|
| -
|
| +class ListUtilities {
|
| /**
|
| - * Map the key to the value.
|
| + * Add all of the elements in the given array to the given list.
|
| *
|
| - * @param key the token being mapped to the value
|
| - * @param value the token to which the key will be mapped
|
| + * @param list the list to which the elements are to be added
|
| + * @param elements the elements to be added to the list
|
| */
|
| - void put(Token key, Token value) {
|
| - _map[key] = value;
|
| + static void addAll(List list, List<Object> elements) {
|
| + int count = elements.length;
|
| + for (int i = 0; i < count; i++) {
|
| + list.add(elements[i]);
|
| + }
|
| }
|
| }
|
|
|
| @@ -413,25 +471,6 @@ abstract class MapIterator<K, V> {
|
| }
|
|
|
| /**
|
| - * The class `ListUtilities` defines utility methods useful for working with [List
|
| - ].
|
| - */
|
| -class ListUtilities {
|
| - /**
|
| - * Add all of the elements in the given array to the given list.
|
| - *
|
| - * @param list the list to which the elements are to be added
|
| - * @param elements the elements to be added to the list
|
| - */
|
| - static void addAll(List list, List<Object> elements) {
|
| - int count = elements.length;
|
| - for (int i = 0; i < count; i++) {
|
| - list.add(elements[i]);
|
| - }
|
| - }
|
| -}
|
| -
|
| -/**
|
| * Instances of the class `MultipleMapIterator` implement an iterator that can be used to
|
| * sequentially access the entries in multiple maps.
|
| */
|
| @@ -533,72 +572,33 @@ class MultipleMapIterator<K, V> implements MapIterator<K, V> {
|
| }
|
|
|
| /**
|
| - * The class `BooleanArray` defines methods for operating on integers as if they were arrays
|
| - * of booleans. These arrays can be indexed by either integers or by enumeration constants.
|
| + * Instances of the class `TokenMap` map one set of tokens to another set of tokens.
|
| */
|
| -class BooleanArray {
|
| - /**
|
| - * Return the value of the element at the given index.
|
| - *
|
| - * @param array the array being accessed
|
| - * @param index the index of the element being accessed
|
| - * @return the value of the element at the given index
|
| - * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| - */
|
| - static bool get(int array, int index) {
|
| - _checkIndex(index);
|
| - return (array & (1 << index)) > 0;
|
| - }
|
| -
|
| - /**
|
| - * Return the value of the element at the given index.
|
| - *
|
| - * @param array the array being accessed
|
| - * @param index the index of the element being accessed
|
| - * @return the value of the element at the given index
|
| - * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| - */
|
| - static bool getEnum(int array, Enum index) => get(array, index.ordinal);
|
| -
|
| +class TokenMap {
|
| /**
|
| - * Set the value of the element at the given index to the given value.
|
| - *
|
| - * @param array the array being modified
|
| - * @param index the index of the element being set
|
| - * @param value the value to be assigned to the element
|
| - * @return the updated value of the array
|
| - * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + * A table mapping tokens to tokens. This should be replaced by a more performant implementation.
|
| + * One possibility is a pair of parallel arrays, with keys being sorted by their offset and a
|
| + * cursor indicating where to start searching.
|
| */
|
| - static int set(int array, int index, bool value) {
|
| - _checkIndex(index);
|
| - if (value) {
|
| - return array | (1 << index);
|
| - } else {
|
| - return array & ~(1 << index);
|
| - }
|
| - }
|
| + Map<Token, Token> _map = new Map<Token, Token>();
|
|
|
| /**
|
| - * Set the value of the element at the given index to the given value.
|
| + * Return the token that is mapped to the given token, or `null` if there is no token
|
| + * corresponding to the given token.
|
| *
|
| - * @param array the array being modified
|
| - * @param index the index of the element being set
|
| - * @param value the value to be assigned to the element
|
| - * @return the updated value of the array
|
| - * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + * @param key the token being mapped to another token
|
| + * @return the token that is mapped to the given token
|
| */
|
| - static int setEnum(int array, Enum index, bool value) => set(array, index.ordinal, value);
|
| + Token get(Token key) => _map[key];
|
|
|
| /**
|
| - * Throw an exception if the index is not within the bounds allowed for an integer-encoded array
|
| - * of boolean values.
|
| + * Map the key to the value.
|
| *
|
| - * @throws IndexOutOfBoundsException if the index is not between zero (0) and 31, inclusive
|
| + * @param key the token being mapped to the value
|
| + * @param value the token to which the key will be mapped
|
| */
|
| - static void _checkIndex(int index) {
|
| - if (index < 0 || index > 30) {
|
| - throw new RangeError("Index not between 0 and 30: ${index}");
|
| - }
|
| + void put(Token key, Token value) {
|
| + _map[key] = value;
|
| }
|
| }
|
|
|
|
|