Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 // This file has been automatically generated. Please do not edit it manually. | 5 // This file has been automatically generated. Please do not edit it manually. |
| 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". | 6 // To regenerate the file, use the script "pkg/analyzer/tool/generate_files". |
| 7 | 7 |
| 8 library analyzer.src.summary.format; | 8 library analyzer.src.summary.format; |
| 9 | 9 |
| 10 import 'flat_buffers.dart' as fb; | 10 import 'flat_buffers.dart' as fb; |
| 11 import 'idl.dart' as idl; | 11 import 'idl.dart' as idl; |
| 12 import 'dart:convert' as convert; | 12 import 'dart:convert' as convert; |
| 13 | 13 |
| 14 class _IndexNameKindReader extends fb.Reader<idl.IndexNameKind> { | |
| 15 const _IndexNameKindReader() : super(); | |
| 16 | |
| 17 @override | |
| 18 int get size => 1; | |
| 19 | |
| 20 @override | |
| 21 idl.IndexNameKind read(fb.BufferPointer bp) { | |
| 22 int index = const fb.Uint8Reader().read(bp); | |
| 23 return idl.IndexNameKind.values[index]; | |
| 24 } | |
| 25 } | |
| 26 | |
| 14 class _IndexRelationKindReader extends fb.Reader<idl.IndexRelationKind> { | 27 class _IndexRelationKindReader extends fb.Reader<idl.IndexRelationKind> { |
| 15 const _IndexRelationKindReader() : super(); | 28 const _IndexRelationKindReader() : super(); |
| 16 | 29 |
| 17 @override | 30 @override |
| 18 int get size => 1; | 31 int get size => 1; |
| 19 | 32 |
| 20 @override | 33 @override |
| 21 idl.IndexRelationKind read(fb.BufferPointer bp) { | 34 idl.IndexRelationKind read(fb.BufferPointer bp) { |
| 22 int index = const fb.Uint8Reader().read(bp); | 35 int index = const fb.Uint8Reader().read(bp); |
| 23 return idl.IndexRelationKind.values[index]; | 36 return idl.IndexRelationKind.values[index]; |
| (...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1429 } | 1442 } |
| 1430 | 1443 |
| 1431 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl. PackageIndex { | 1444 class PackageIndexBuilder extends Object with _PackageIndexMixin implements idl. PackageIndex { |
| 1432 bool _finished = false; | 1445 bool _finished = false; |
| 1433 | 1446 |
| 1434 List<idl.IndexSyntheticElementKind> _elementKinds; | 1447 List<idl.IndexSyntheticElementKind> _elementKinds; |
| 1435 List<int> _elementLibraryUris; | 1448 List<int> _elementLibraryUris; |
| 1436 List<int> _elementOffsets; | 1449 List<int> _elementOffsets; |
| 1437 List<int> _elementUnits; | 1450 List<int> _elementUnits; |
| 1438 List<int> _elementUnitUris; | 1451 List<int> _elementUnitUris; |
| 1452 List<String> _strings; | |
| 1439 List<UnitIndexBuilder> _units; | 1453 List<UnitIndexBuilder> _units; |
| 1440 List<String> _uris; | |
| 1441 | 1454 |
| 1442 @override | 1455 @override |
| 1443 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl .IndexSyntheticElementKind>[]; | 1456 List<idl.IndexSyntheticElementKind> get elementKinds => _elementKinds ??= <idl .IndexSyntheticElementKind>[]; |
| 1444 | 1457 |
| 1445 /** | 1458 /** |
| 1446 * Each item of this list corresponds to a unique referenced element. It is | 1459 * Each item of this list corresponds to a unique referenced element. It is |
| 1447 * the kind of the synthetic element. | 1460 * the kind of the synthetic element. |
| 1448 */ | 1461 */ |
| 1449 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) { | 1462 void set elementKinds(List<idl.IndexSyntheticElementKind> _value) { |
| 1450 assert(!_finished); | 1463 assert(!_finished); |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1500 * Each item of this list corresponds to a unique unit URI with an element | 1513 * Each item of this list corresponds to a unique unit URI with an element |
| 1501 * referenced in the [PackageIndex]. It is an index into [uris] list. | 1514 * referenced in the [PackageIndex]. It is an index into [uris] list. |
| 1502 */ | 1515 */ |
| 1503 void set elementUnitUris(List<int> _value) { | 1516 void set elementUnitUris(List<int> _value) { |
| 1504 assert(!_finished); | 1517 assert(!_finished); |
| 1505 assert(_value == null || _value.every((e) => e >= 0)); | 1518 assert(_value == null || _value.every((e) => e >= 0)); |
| 1506 _elementUnitUris = _value; | 1519 _elementUnitUris = _value; |
| 1507 } | 1520 } |
| 1508 | 1521 |
| 1509 @override | 1522 @override |
| 1523 List<String> get strings => _strings ??= <String>[]; | |
| 1524 | |
| 1525 /** | |
| 1526 * List of unique element strings used in this [PackageIndex]. | |
| 1527 */ | |
| 1528 void set strings(List<String> _value) { | |
| 1529 assert(!_finished); | |
| 1530 _strings = _value; | |
| 1531 } | |
| 1532 | |
| 1533 @override | |
| 1510 List<UnitIndexBuilder> get units => _units ??= <UnitIndexBuilder>[]; | 1534 List<UnitIndexBuilder> get units => _units ??= <UnitIndexBuilder>[]; |
| 1511 | 1535 |
| 1512 /** | 1536 /** |
| 1513 * List of units indexed in this [PackageIndex]. | 1537 * List of units indexed in this [PackageIndex]. |
| 1514 */ | 1538 */ |
| 1515 void set units(List<UnitIndexBuilder> _value) { | 1539 void set units(List<UnitIndexBuilder> _value) { |
| 1516 assert(!_finished); | 1540 assert(!_finished); |
| 1517 _units = _value; | 1541 _units = _value; |
| 1518 } | 1542 } |
| 1519 | 1543 |
| 1520 @override | 1544 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in t> elementLibraryUris, List<int> elementOffsets, List<int> elementUnits, List<in t> elementUnitUris, List<String> strings, List<UnitIndexBuilder> units}) |
| 1521 List<String> get uris => _uris ??= <String>[]; | |
| 1522 | |
| 1523 /** | |
| 1524 * List of unique URIs used in this [PackageIndex]. | |
| 1525 */ | |
| 1526 void set uris(List<String> _value) { | |
| 1527 assert(!_finished); | |
| 1528 _uris = _value; | |
| 1529 } | |
| 1530 | |
| 1531 PackageIndexBuilder({List<idl.IndexSyntheticElementKind> elementKinds, List<in t> elementLibraryUris, List<int> elementOffsets, List<int> elementUnits, List<in t> elementUnitUris, List<UnitIndexBuilder> units, List<String> uris}) | |
| 1532 : _elementKinds = elementKinds, | 1545 : _elementKinds = elementKinds, |
| 1533 _elementLibraryUris = elementLibraryUris, | 1546 _elementLibraryUris = elementLibraryUris, |
| 1534 _elementOffsets = elementOffsets, | 1547 _elementOffsets = elementOffsets, |
| 1535 _elementUnits = elementUnits, | 1548 _elementUnits = elementUnits, |
| 1536 _elementUnitUris = elementUnitUris, | 1549 _elementUnitUris = elementUnitUris, |
| 1537 _units = units, | 1550 _strings = strings, |
| 1538 _uris = uris; | 1551 _units = units; |
| 1539 | 1552 |
| 1540 List<int> toBuffer() { | 1553 List<int> toBuffer() { |
| 1541 fb.Builder fbBuilder = new fb.Builder(); | 1554 fb.Builder fbBuilder = new fb.Builder(); |
| 1542 return fbBuilder.finish(finish(fbBuilder), "Indx"); | 1555 return fbBuilder.finish(finish(fbBuilder), "Indx"); |
| 1543 } | 1556 } |
| 1544 | 1557 |
| 1545 fb.Offset finish(fb.Builder fbBuilder) { | 1558 fb.Offset finish(fb.Builder fbBuilder) { |
| 1546 assert(!_finished); | 1559 assert(!_finished); |
| 1547 _finished = true; | 1560 _finished = true; |
| 1548 fb.Offset offset_elementKinds; | 1561 fb.Offset offset_elementKinds; |
| 1549 fb.Offset offset_elementLibraryUris; | 1562 fb.Offset offset_elementLibraryUris; |
| 1550 fb.Offset offset_elementOffsets; | 1563 fb.Offset offset_elementOffsets; |
| 1551 fb.Offset offset_elementUnits; | 1564 fb.Offset offset_elementUnits; |
| 1552 fb.Offset offset_elementUnitUris; | 1565 fb.Offset offset_elementUnitUris; |
| 1566 fb.Offset offset_strings; | |
| 1553 fb.Offset offset_units; | 1567 fb.Offset offset_units; |
| 1554 fb.Offset offset_uris; | |
| 1555 if (!(_elementKinds == null || _elementKinds.isEmpty)) { | 1568 if (!(_elementKinds == null || _elementKinds.isEmpty)) { |
| 1556 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b. index).toList()); | 1569 offset_elementKinds = fbBuilder.writeListUint8(_elementKinds.map((b) => b. index).toList()); |
| 1557 } | 1570 } |
| 1558 if (!(_elementLibraryUris == null || _elementLibraryUris.isEmpty)) { | 1571 if (!(_elementLibraryUris == null || _elementLibraryUris.isEmpty)) { |
| 1559 offset_elementLibraryUris = fbBuilder.writeListUint32(_elementLibraryUris) ; | 1572 offset_elementLibraryUris = fbBuilder.writeListUint32(_elementLibraryUris) ; |
| 1560 } | 1573 } |
| 1561 if (!(_elementOffsets == null || _elementOffsets.isEmpty)) { | 1574 if (!(_elementOffsets == null || _elementOffsets.isEmpty)) { |
| 1562 offset_elementOffsets = fbBuilder.writeListUint32(_elementOffsets); | 1575 offset_elementOffsets = fbBuilder.writeListUint32(_elementOffsets); |
| 1563 } | 1576 } |
| 1564 if (!(_elementUnits == null || _elementUnits.isEmpty)) { | 1577 if (!(_elementUnits == null || _elementUnits.isEmpty)) { |
| 1565 offset_elementUnits = fbBuilder.writeListUint32(_elementUnits); | 1578 offset_elementUnits = fbBuilder.writeListUint32(_elementUnits); |
| 1566 } | 1579 } |
| 1567 if (!(_elementUnitUris == null || _elementUnitUris.isEmpty)) { | 1580 if (!(_elementUnitUris == null || _elementUnitUris.isEmpty)) { |
| 1568 offset_elementUnitUris = fbBuilder.writeListUint32(_elementUnitUris); | 1581 offset_elementUnitUris = fbBuilder.writeListUint32(_elementUnitUris); |
| 1569 } | 1582 } |
| 1583 if (!(_strings == null || _strings.isEmpty)) { | |
| 1584 offset_strings = fbBuilder.writeList(_strings.map((b) => fbBuilder.writeSt ring(b)).toList()); | |
| 1585 } | |
| 1570 if (!(_units == null || _units.isEmpty)) { | 1586 if (!(_units == null || _units.isEmpty)) { |
| 1571 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)). toList()); | 1587 offset_units = fbBuilder.writeList(_units.map((b) => b.finish(fbBuilder)). toList()); |
| 1572 } | 1588 } |
| 1573 if (!(_uris == null || _uris.isEmpty)) { | |
| 1574 offset_uris = fbBuilder.writeList(_uris.map((b) => fbBuilder.writeString(b )).toList()); | |
| 1575 } | |
| 1576 fbBuilder.startTable(); | 1589 fbBuilder.startTable(); |
| 1577 if (offset_elementKinds != null) { | 1590 if (offset_elementKinds != null) { |
| 1578 fbBuilder.addOffset(6, offset_elementKinds); | 1591 fbBuilder.addOffset(5, offset_elementKinds); |
|
Brian Wilkerson
2016/02/27 18:15:10
It would be good to use constants for these offset
scheglov
2016/02/27 23:00:44
I'm sorry, I should have thought to provide more d
| |
| 1579 } | 1592 } |
| 1580 if (offset_elementLibraryUris != null) { | 1593 if (offset_elementLibraryUris != null) { |
| 1581 fbBuilder.addOffset(2, offset_elementLibraryUris); | 1594 fbBuilder.addOffset(2, offset_elementLibraryUris); |
| 1582 } | 1595 } |
| 1583 if (offset_elementOffsets != null) { | 1596 if (offset_elementOffsets != null) { |
| 1584 fbBuilder.addOffset(1, offset_elementOffsets); | 1597 fbBuilder.addOffset(1, offset_elementOffsets); |
| 1585 } | 1598 } |
| 1586 if (offset_elementUnits != null) { | 1599 if (offset_elementUnits != null) { |
| 1587 fbBuilder.addOffset(0, offset_elementUnits); | 1600 fbBuilder.addOffset(0, offset_elementUnits); |
| 1588 } | 1601 } |
| 1589 if (offset_elementUnitUris != null) { | 1602 if (offset_elementUnitUris != null) { |
| 1590 fbBuilder.addOffset(3, offset_elementUnitUris); | 1603 fbBuilder.addOffset(3, offset_elementUnitUris); |
| 1591 } | 1604 } |
| 1605 if (offset_strings != null) { | |
| 1606 fbBuilder.addOffset(6, offset_strings); | |
| 1607 } | |
| 1592 if (offset_units != null) { | 1608 if (offset_units != null) { |
| 1593 fbBuilder.addOffset(5, offset_units); | 1609 fbBuilder.addOffset(4, offset_units); |
| 1594 } | |
| 1595 if (offset_uris != null) { | |
| 1596 fbBuilder.addOffset(4, offset_uris); | |
| 1597 } | 1610 } |
| 1598 return fbBuilder.endTable(); | 1611 return fbBuilder.endTable(); |
| 1599 } | 1612 } |
| 1600 } | 1613 } |
| 1601 | 1614 |
| 1602 idl.PackageIndex readPackageIndex(List<int> buffer) { | 1615 idl.PackageIndex readPackageIndex(List<int> buffer) { |
| 1603 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); | 1616 fb.BufferPointer rootRef = new fb.BufferPointer.fromBytes(buffer); |
| 1604 return const _PackageIndexReader().read(rootRef); | 1617 return const _PackageIndexReader().read(rootRef); |
| 1605 } | 1618 } |
| 1606 | 1619 |
| 1607 class _PackageIndexReader extends fb.TableReader<_PackageIndexImpl> { | 1620 class _PackageIndexReader extends fb.TableReader<_PackageIndexImpl> { |
| 1608 const _PackageIndexReader(); | 1621 const _PackageIndexReader(); |
| 1609 | 1622 |
| 1610 @override | 1623 @override |
| 1611 _PackageIndexImpl createObject(fb.BufferPointer bp) => new _PackageIndexImpl(b p); | 1624 _PackageIndexImpl createObject(fb.BufferPointer bp) => new _PackageIndexImpl(b p); |
| 1612 } | 1625 } |
| 1613 | 1626 |
| 1614 class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa ckageIndex { | 1627 class _PackageIndexImpl extends Object with _PackageIndexMixin implements idl.Pa ckageIndex { |
| 1615 final fb.BufferPointer _bp; | 1628 final fb.BufferPointer _bp; |
| 1616 | 1629 |
| 1617 _PackageIndexImpl(this._bp); | 1630 _PackageIndexImpl(this._bp); |
| 1618 | 1631 |
| 1619 List<idl.IndexSyntheticElementKind> _elementKinds; | 1632 List<idl.IndexSyntheticElementKind> _elementKinds; |
| 1620 List<int> _elementLibraryUris; | 1633 List<int> _elementLibraryUris; |
| 1621 List<int> _elementOffsets; | 1634 List<int> _elementOffsets; |
| 1622 List<int> _elementUnits; | 1635 List<int> _elementUnits; |
| 1623 List<int> _elementUnitUris; | 1636 List<int> _elementUnitUris; |
| 1637 List<String> _strings; | |
| 1624 List<idl.UnitIndex> _units; | 1638 List<idl.UnitIndex> _units; |
| 1625 List<String> _uris; | |
| 1626 | 1639 |
| 1627 @override | 1640 @override |
| 1628 List<idl.IndexSyntheticElementKind> get elementKinds { | 1641 List<idl.IndexSyntheticElementKind> get elementKinds { |
| 1629 _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _ IndexSyntheticElementKindReader()).vTableGet(_bp, 6, const <idl.IndexSyntheticEl ementKind>[]); | 1642 _elementKinds ??= const fb.ListReader<idl.IndexSyntheticElementKind>(const _ IndexSyntheticElementKindReader()).vTableGet(_bp, 5, const <idl.IndexSyntheticEl ementKind>[]); |
| 1630 return _elementKinds; | 1643 return _elementKinds; |
| 1631 } | 1644 } |
| 1632 | 1645 |
| 1633 @override | 1646 @override |
| 1634 List<int> get elementLibraryUris { | 1647 List<int> get elementLibraryUris { |
| 1635 _elementLibraryUris ??= const fb.Uint32ListReader().vTableGet(_bp, 2, const <int>[]); | 1648 _elementLibraryUris ??= const fb.Uint32ListReader().vTableGet(_bp, 2, const <int>[]); |
| 1636 return _elementLibraryUris; | 1649 return _elementLibraryUris; |
| 1637 } | 1650 } |
| 1638 | 1651 |
| 1639 @override | 1652 @override |
| 1640 List<int> get elementOffsets { | 1653 List<int> get elementOffsets { |
| 1641 _elementOffsets ??= const fb.Uint32ListReader().vTableGet(_bp, 1, const <int >[]); | 1654 _elementOffsets ??= const fb.Uint32ListReader().vTableGet(_bp, 1, const <int >[]); |
| 1642 return _elementOffsets; | 1655 return _elementOffsets; |
| 1643 } | 1656 } |
| 1644 | 1657 |
| 1645 @override | 1658 @override |
| 1646 List<int> get elementUnits { | 1659 List<int> get elementUnits { |
| 1647 _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bp, 0, const <int>[ ]); | 1660 _elementUnits ??= const fb.Uint32ListReader().vTableGet(_bp, 0, const <int>[ ]); |
| 1648 return _elementUnits; | 1661 return _elementUnits; |
| 1649 } | 1662 } |
| 1650 | 1663 |
| 1651 @override | 1664 @override |
| 1652 List<int> get elementUnitUris { | 1665 List<int> get elementUnitUris { |
| 1653 _elementUnitUris ??= const fb.Uint32ListReader().vTableGet(_bp, 3, const <in t>[]); | 1666 _elementUnitUris ??= const fb.Uint32ListReader().vTableGet(_bp, 3, const <in t>[]); |
| 1654 return _elementUnitUris; | 1667 return _elementUnitUris; |
| 1655 } | 1668 } |
| 1656 | 1669 |
| 1657 @override | 1670 @override |
| 1671 List<String> get strings { | |
| 1672 _strings ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet( _bp, 6, const <String>[]); | |
| 1673 return _strings; | |
| 1674 } | |
| 1675 | |
| 1676 @override | |
| 1658 List<idl.UnitIndex> get units { | 1677 List<idl.UnitIndex> get units { |
| 1659 _units ??= const fb.ListReader<idl.UnitIndex>(const _UnitIndexReader()).vTab leGet(_bp, 5, const <idl.UnitIndex>[]); | 1678 _units ??= const fb.ListReader<idl.UnitIndex>(const _UnitIndexReader()).vTab leGet(_bp, 4, const <idl.UnitIndex>[]); |
| 1660 return _units; | 1679 return _units; |
| 1661 } | 1680 } |
| 1662 | |
| 1663 @override | |
| 1664 List<String> get uris { | |
| 1665 _uris ??= const fb.ListReader<String>(const fb.StringReader()).vTableGet(_bp , 4, const <String>[]); | |
| 1666 return _uris; | |
| 1667 } | |
| 1668 } | 1681 } |
| 1669 | 1682 |
| 1670 abstract class _PackageIndexMixin implements idl.PackageIndex { | 1683 abstract class _PackageIndexMixin implements idl.PackageIndex { |
| 1671 @override | 1684 @override |
| 1672 Map<String, Object> toJson() { | 1685 Map<String, Object> toJson() { |
| 1673 Map<String, Object> _result = <String, Object>{}; | 1686 Map<String, Object> _result = <String, Object>{}; |
| 1674 if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_va lue) => _value.toString().split('.')[1]).toList(); | 1687 if (elementKinds.isNotEmpty) _result["elementKinds"] = elementKinds.map((_va lue) => _value.toString().split('.')[1]).toList(); |
| 1675 if (elementLibraryUris.isNotEmpty) _result["elementLibraryUris"] = elementLi braryUris; | 1688 if (elementLibraryUris.isNotEmpty) _result["elementLibraryUris"] = elementLi braryUris; |
| 1676 if (elementOffsets.isNotEmpty) _result["elementOffsets"] = elementOffsets; | 1689 if (elementOffsets.isNotEmpty) _result["elementOffsets"] = elementOffsets; |
| 1677 if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits; | 1690 if (elementUnits.isNotEmpty) _result["elementUnits"] = elementUnits; |
| 1678 if (elementUnitUris.isNotEmpty) _result["elementUnitUris"] = elementUnitUris ; | 1691 if (elementUnitUris.isNotEmpty) _result["elementUnitUris"] = elementUnitUris ; |
| 1692 if (strings.isNotEmpty) _result["strings"] = strings; | |
| 1679 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson ()).toList(); | 1693 if (units.isNotEmpty) _result["units"] = units.map((_value) => _value.toJson ()).toList(); |
| 1680 if (uris.isNotEmpty) _result["uris"] = uris; | |
| 1681 return _result; | 1694 return _result; |
| 1682 } | 1695 } |
| 1683 | 1696 |
| 1684 @override | 1697 @override |
| 1685 Map<String, Object> toMap() => { | 1698 Map<String, Object> toMap() => { |
| 1686 "elementKinds": elementKinds, | 1699 "elementKinds": elementKinds, |
| 1687 "elementLibraryUris": elementLibraryUris, | 1700 "elementLibraryUris": elementLibraryUris, |
| 1688 "elementOffsets": elementOffsets, | 1701 "elementOffsets": elementOffsets, |
| 1689 "elementUnits": elementUnits, | 1702 "elementUnits": elementUnits, |
| 1690 "elementUnitUris": elementUnitUris, | 1703 "elementUnitUris": elementUnitUris, |
| 1704 "strings": strings, | |
| 1691 "units": units, | 1705 "units": units, |
| 1692 "uris": uris, | |
| 1693 }; | 1706 }; |
| 1694 | 1707 |
| 1695 @override | 1708 @override |
| 1696 String toString() => convert.JSON.encode(toJson()); | 1709 String toString() => convert.JSON.encode(toJson()); |
| 1697 } | 1710 } |
| 1698 | 1711 |
| 1699 class UnitIndexBuilder extends Object with _UnitIndexMixin implements idl.UnitIn dex { | 1712 class UnitIndexBuilder extends Object with _UnitIndexMixin implements idl.UnitIn dex { |
| 1700 bool _finished = false; | 1713 bool _finished = false; |
| 1701 | 1714 |
| 1715 List<idl.IndexNameKind> _definedNameKinds; | |
| 1716 List<int> _definedNameOffsets; | |
| 1717 List<int> _definedNames; | |
| 1702 List<int> _elements; | 1718 List<int> _elements; |
| 1703 List<idl.IndexRelationKind> _kinds; | 1719 List<idl.IndexRelationKind> _kinds; |
| 1704 int _libraryUri; | 1720 int _libraryUri; |
| 1705 List<int> _locationLengths; | 1721 List<int> _locationLengths; |
| 1706 List<int> _locationOffsets; | 1722 List<int> _locationOffsets; |
| 1707 int _unitUri; | 1723 int _unitUri; |
| 1708 | 1724 |
| 1709 @override | 1725 @override |
| 1726 List<idl.IndexNameKind> get definedNameKinds => _definedNameKinds ??= <idl.Ind exNameKind>[]; | |
| 1727 | |
| 1728 /** | |
| 1729 * Each item of this list is the kind of an element defined in this unit. | |
| 1730 */ | |
| 1731 void set definedNameKinds(List<idl.IndexNameKind> _value) { | |
| 1732 assert(!_finished); | |
| 1733 _definedNameKinds = _value; | |
| 1734 } | |
| 1735 | |
| 1736 @override | |
| 1737 List<int> get definedNameOffsets => _definedNameOffsets ??= <int>[]; | |
| 1738 | |
| 1739 /** | |
| 1740 * Each item of this list is the name offset of an element defined in this | |
| 1741 * unit relative to the beginning of the file. | |
| 1742 */ | |
| 1743 void set definedNameOffsets(List<int> _value) { | |
| 1744 assert(!_finished); | |
| 1745 assert(_value == null || _value.every((e) => e >= 0)); | |
| 1746 _definedNameOffsets = _value; | |
| 1747 } | |
| 1748 | |
| 1749 @override | |
| 1750 List<int> get definedNames => _definedNames ??= <int>[]; | |
| 1751 | |
| 1752 /** | |
| 1753 * Each item of this list corresponds to an element defined in this unit. It | |
| 1754 * is an index into [PackageIndex.strings] list. The list is sorted in | |
| 1755 * ascending order, so that the client can quickly find name definitions in | |
| 1756 * this [UnitIndex]. | |
| 1757 */ | |
| 1758 void set definedNames(List<int> _value) { | |
| 1759 assert(!_finished); | |
| 1760 assert(_value == null || _value.every((e) => e >= 0)); | |
| 1761 _definedNames = _value; | |
| 1762 } | |
| 1763 | |
| 1764 @override | |
| 1710 List<int> get elements => _elements ??= <int>[]; | 1765 List<int> get elements => _elements ??= <int>[]; |
| 1711 | 1766 |
| 1712 /** | 1767 /** |
| 1713 * Each item of this list is the index into [PackageIndex.elementUnits] and | 1768 * Each item of this list is the index into [PackageIndex.elementUnits] and |
| 1714 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so | 1769 * [PackageIndex.elementOffsets]. The list is sorted in ascending order, so |
| 1715 * that the client can quickly find element references in this [UnitIndex]. | 1770 * that the client can quickly find element references in this [UnitIndex]. |
| 1716 */ | 1771 */ |
| 1717 void set elements(List<int> _value) { | 1772 void set elements(List<int> _value) { |
| 1718 assert(!_finished); | 1773 assert(!_finished); |
| 1719 assert(_value == null || _value.every((e) => e >= 0)); | 1774 assert(_value == null || _value.every((e) => e >= 0)); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1775 /** | 1830 /** |
| 1776 * The unit source URI of this unit, e.g. `dart:core/int.dart` or | 1831 * The unit source URI of this unit, e.g. `dart:core/int.dart` or |
| 1777 * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris]. | 1832 * `package:foo/bar/baz.dart`, as index into [PackageIndex.uris]. |
| 1778 */ | 1833 */ |
| 1779 void set unitUri(int _value) { | 1834 void set unitUri(int _value) { |
| 1780 assert(!_finished); | 1835 assert(!_finished); |
| 1781 assert(_value == null || _value >= 0); | 1836 assert(_value == null || _value >= 0); |
| 1782 _unitUri = _value; | 1837 _unitUri = _value; |
| 1783 } | 1838 } |
| 1784 | 1839 |
| 1785 UnitIndexBuilder({List<int> elements, List<idl.IndexRelationKind> kinds, int l ibraryUri, List<int> locationLengths, List<int> locationOffsets, int unitUri}) | 1840 UnitIndexBuilder({List<idl.IndexNameKind> definedNameKinds, List<int> definedN ameOffsets, List<int> definedNames, List<int> elements, List<idl.IndexRelationKi nd> kinds, int libraryUri, List<int> locationLengths, List<int> locationOffsets, int unitUri}) |
| 1786 : _elements = elements, | 1841 : _definedNameKinds = definedNameKinds, |
| 1842 _definedNameOffsets = definedNameOffsets, | |
| 1843 _definedNames = definedNames, | |
| 1844 _elements = elements, | |
| 1787 _kinds = kinds, | 1845 _kinds = kinds, |
| 1788 _libraryUri = libraryUri, | 1846 _libraryUri = libraryUri, |
| 1789 _locationLengths = locationLengths, | 1847 _locationLengths = locationLengths, |
| 1790 _locationOffsets = locationOffsets, | 1848 _locationOffsets = locationOffsets, |
| 1791 _unitUri = unitUri; | 1849 _unitUri = unitUri; |
| 1792 | 1850 |
| 1793 fb.Offset finish(fb.Builder fbBuilder) { | 1851 fb.Offset finish(fb.Builder fbBuilder) { |
| 1794 assert(!_finished); | 1852 assert(!_finished); |
| 1795 _finished = true; | 1853 _finished = true; |
| 1854 fb.Offset offset_definedNameKinds; | |
| 1855 fb.Offset offset_definedNameOffsets; | |
| 1856 fb.Offset offset_definedNames; | |
| 1796 fb.Offset offset_elements; | 1857 fb.Offset offset_elements; |
| 1797 fb.Offset offset_kinds; | 1858 fb.Offset offset_kinds; |
| 1798 fb.Offset offset_locationLengths; | 1859 fb.Offset offset_locationLengths; |
| 1799 fb.Offset offset_locationOffsets; | 1860 fb.Offset offset_locationOffsets; |
| 1861 if (!(_definedNameKinds == null || _definedNameKinds.isEmpty)) { | |
| 1862 offset_definedNameKinds = fbBuilder.writeListUint8(_definedNameKinds.map(( b) => b.index).toList()); | |
| 1863 } | |
| 1864 if (!(_definedNameOffsets == null || _definedNameOffsets.isEmpty)) { | |
| 1865 offset_definedNameOffsets = fbBuilder.writeListUint32(_definedNameOffsets) ; | |
| 1866 } | |
| 1867 if (!(_definedNames == null || _definedNames.isEmpty)) { | |
| 1868 offset_definedNames = fbBuilder.writeListUint32(_definedNames); | |
| 1869 } | |
| 1800 if (!(_elements == null || _elements.isEmpty)) { | 1870 if (!(_elements == null || _elements.isEmpty)) { |
| 1801 offset_elements = fbBuilder.writeListUint32(_elements); | 1871 offset_elements = fbBuilder.writeListUint32(_elements); |
| 1802 } | 1872 } |
| 1803 if (!(_kinds == null || _kinds.isEmpty)) { | 1873 if (!(_kinds == null || _kinds.isEmpty)) { |
| 1804 offset_kinds = fbBuilder.writeListUint8(_kinds.map((b) => b.index).toList( )); | 1874 offset_kinds = fbBuilder.writeListUint8(_kinds.map((b) => b.index).toList( )); |
| 1805 } | 1875 } |
| 1806 if (!(_locationLengths == null || _locationLengths.isEmpty)) { | 1876 if (!(_locationLengths == null || _locationLengths.isEmpty)) { |
| 1807 offset_locationLengths = fbBuilder.writeListUint32(_locationLengths); | 1877 offset_locationLengths = fbBuilder.writeListUint32(_locationLengths); |
| 1808 } | 1878 } |
| 1809 if (!(_locationOffsets == null || _locationOffsets.isEmpty)) { | 1879 if (!(_locationOffsets == null || _locationOffsets.isEmpty)) { |
| 1810 offset_locationOffsets = fbBuilder.writeListUint32(_locationOffsets); | 1880 offset_locationOffsets = fbBuilder.writeListUint32(_locationOffsets); |
| 1811 } | 1881 } |
| 1812 fbBuilder.startTable(); | 1882 fbBuilder.startTable(); |
| 1883 if (offset_definedNameKinds != null) { | |
| 1884 fbBuilder.addOffset(7, offset_definedNameKinds); | |
| 1885 } | |
| 1886 if (offset_definedNameOffsets != null) { | |
| 1887 fbBuilder.addOffset(8, offset_definedNameOffsets); | |
| 1888 } | |
| 1889 if (offset_definedNames != null) { | |
| 1890 fbBuilder.addOffset(6, offset_definedNames); | |
| 1891 } | |
| 1813 if (offset_elements != null) { | 1892 if (offset_elements != null) { |
| 1814 fbBuilder.addOffset(4, offset_elements); | 1893 fbBuilder.addOffset(4, offset_elements); |
| 1815 } | 1894 } |
| 1816 if (offset_kinds != null) { | 1895 if (offset_kinds != null) { |
| 1817 fbBuilder.addOffset(5, offset_kinds); | 1896 fbBuilder.addOffset(5, offset_kinds); |
| 1818 } | 1897 } |
| 1819 if (_libraryUri != null && _libraryUri != 0) { | 1898 if (_libraryUri != null && _libraryUri != 0) { |
| 1820 fbBuilder.addUint32(0, _libraryUri); | 1899 fbBuilder.addUint32(0, _libraryUri); |
| 1821 } | 1900 } |
| 1822 if (offset_locationLengths != null) { | 1901 if (offset_locationLengths != null) { |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 1837 | 1916 |
| 1838 @override | 1917 @override |
| 1839 _UnitIndexImpl createObject(fb.BufferPointer bp) => new _UnitIndexImpl(bp); | 1918 _UnitIndexImpl createObject(fb.BufferPointer bp) => new _UnitIndexImpl(bp); |
| 1840 } | 1919 } |
| 1841 | 1920 |
| 1842 class _UnitIndexImpl extends Object with _UnitIndexMixin implements idl.UnitInde x { | 1921 class _UnitIndexImpl extends Object with _UnitIndexMixin implements idl.UnitInde x { |
| 1843 final fb.BufferPointer _bp; | 1922 final fb.BufferPointer _bp; |
| 1844 | 1923 |
| 1845 _UnitIndexImpl(this._bp); | 1924 _UnitIndexImpl(this._bp); |
| 1846 | 1925 |
| 1926 List<idl.IndexNameKind> _definedNameKinds; | |
| 1927 List<int> _definedNameOffsets; | |
| 1928 List<int> _definedNames; | |
| 1847 List<int> _elements; | 1929 List<int> _elements; |
| 1848 List<idl.IndexRelationKind> _kinds; | 1930 List<idl.IndexRelationKind> _kinds; |
| 1849 int _libraryUri; | 1931 int _libraryUri; |
| 1850 List<int> _locationLengths; | 1932 List<int> _locationLengths; |
| 1851 List<int> _locationOffsets; | 1933 List<int> _locationOffsets; |
| 1852 int _unitUri; | 1934 int _unitUri; |
| 1853 | 1935 |
| 1854 @override | 1936 @override |
| 1937 List<idl.IndexNameKind> get definedNameKinds { | |
| 1938 _definedNameKinds ??= const fb.ListReader<idl.IndexNameKind>(const _IndexNam eKindReader()).vTableGet(_bp, 7, const <idl.IndexNameKind>[]); | |
| 1939 return _definedNameKinds; | |
| 1940 } | |
| 1941 | |
| 1942 @override | |
| 1943 List<int> get definedNameOffsets { | |
| 1944 _definedNameOffsets ??= const fb.Uint32ListReader().vTableGet(_bp, 8, const <int>[]); | |
| 1945 return _definedNameOffsets; | |
| 1946 } | |
| 1947 | |
| 1948 @override | |
| 1949 List<int> get definedNames { | |
| 1950 _definedNames ??= const fb.Uint32ListReader().vTableGet(_bp, 6, const <int>[ ]); | |
| 1951 return _definedNames; | |
| 1952 } | |
| 1953 | |
| 1954 @override | |
| 1855 List<int> get elements { | 1955 List<int> get elements { |
| 1856 _elements ??= const fb.Uint32ListReader().vTableGet(_bp, 4, const <int>[]); | 1956 _elements ??= const fb.Uint32ListReader().vTableGet(_bp, 4, const <int>[]); |
| 1857 return _elements; | 1957 return _elements; |
| 1858 } | 1958 } |
| 1859 | 1959 |
| 1860 @override | 1960 @override |
| 1861 List<idl.IndexRelationKind> get kinds { | 1961 List<idl.IndexRelationKind> get kinds { |
| 1862 _kinds ??= const fb.ListReader<idl.IndexRelationKind>(const _IndexRelationKi ndReader()).vTableGet(_bp, 5, const <idl.IndexRelationKind>[]); | 1962 _kinds ??= const fb.ListReader<idl.IndexRelationKind>(const _IndexRelationKi ndReader()).vTableGet(_bp, 5, const <idl.IndexRelationKind>[]); |
| 1863 return _kinds; | 1963 return _kinds; |
| 1864 } | 1964 } |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 1885 int get unitUri { | 1985 int get unitUri { |
| 1886 _unitUri ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); | 1986 _unitUri ??= const fb.Uint32Reader().vTableGet(_bp, 1, 0); |
| 1887 return _unitUri; | 1987 return _unitUri; |
| 1888 } | 1988 } |
| 1889 } | 1989 } |
| 1890 | 1990 |
| 1891 abstract class _UnitIndexMixin implements idl.UnitIndex { | 1991 abstract class _UnitIndexMixin implements idl.UnitIndex { |
| 1892 @override | 1992 @override |
| 1893 Map<String, Object> toJson() { | 1993 Map<String, Object> toJson() { |
| 1894 Map<String, Object> _result = <String, Object>{}; | 1994 Map<String, Object> _result = <String, Object>{}; |
| 1995 if (definedNameKinds.isNotEmpty) _result["definedNameKinds"] = definedNameKi nds.map((_value) => _value.toString().split('.')[1]).toList(); | |
| 1996 if (definedNameOffsets.isNotEmpty) _result["definedNameOffsets"] = definedNa meOffsets; | |
| 1997 if (definedNames.isNotEmpty) _result["definedNames"] = definedNames; | |
| 1895 if (elements.isNotEmpty) _result["elements"] = elements; | 1998 if (elements.isNotEmpty) _result["elements"] = elements; |
| 1896 if (kinds.isNotEmpty) _result["kinds"] = kinds.map((_value) => _value.toStri ng().split('.')[1]).toList(); | 1999 if (kinds.isNotEmpty) _result["kinds"] = kinds.map((_value) => _value.toStri ng().split('.')[1]).toList(); |
| 1897 if (libraryUri != 0) _result["libraryUri"] = libraryUri; | 2000 if (libraryUri != 0) _result["libraryUri"] = libraryUri; |
| 1898 if (locationLengths.isNotEmpty) _result["locationLengths"] = locationLengths ; | 2001 if (locationLengths.isNotEmpty) _result["locationLengths"] = locationLengths ; |
| 1899 if (locationOffsets.isNotEmpty) _result["locationOffsets"] = locationOffsets ; | 2002 if (locationOffsets.isNotEmpty) _result["locationOffsets"] = locationOffsets ; |
| 1900 if (unitUri != 0) _result["unitUri"] = unitUri; | 2003 if (unitUri != 0) _result["unitUri"] = unitUri; |
| 1901 return _result; | 2004 return _result; |
| 1902 } | 2005 } |
| 1903 | 2006 |
| 1904 @override | 2007 @override |
| 1905 Map<String, Object> toMap() => { | 2008 Map<String, Object> toMap() => { |
| 2009 "definedNameKinds": definedNameKinds, | |
| 2010 "definedNameOffsets": definedNameOffsets, | |
| 2011 "definedNames": definedNames, | |
| 1906 "elements": elements, | 2012 "elements": elements, |
| 1907 "kinds": kinds, | 2013 "kinds": kinds, |
| 1908 "libraryUri": libraryUri, | 2014 "libraryUri": libraryUri, |
| 1909 "locationLengths": locationLengths, | 2015 "locationLengths": locationLengths, |
| 1910 "locationOffsets": locationOffsets, | 2016 "locationOffsets": locationOffsets, |
| 1911 "unitUri": unitUri, | 2017 "unitUri": unitUri, |
| 1912 }; | 2018 }; |
| 1913 | 2019 |
| 1914 @override | 2020 @override |
| 1915 String toString() => convert.JSON.encode(toJson()); | 2021 String toString() => convert.JSON.encode(toJson()); |
| (...skipping 5151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 7067 "propagatedTypeSlot": propagatedTypeSlot, | 7173 "propagatedTypeSlot": propagatedTypeSlot, |
| 7068 "type": type, | 7174 "type": type, |
| 7069 "visibleLength": visibleLength, | 7175 "visibleLength": visibleLength, |
| 7070 "visibleOffset": visibleOffset, | 7176 "visibleOffset": visibleOffset, |
| 7071 }; | 7177 }; |
| 7072 | 7178 |
| 7073 @override | 7179 @override |
| 7074 String toString() => convert.JSON.encode(toJson()); | 7180 String toString() => convert.JSON.encode(toJson()); |
| 7075 } | 7181 } |
| 7076 | 7182 |
| OLD | NEW |