This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension IdentableStringSink on StringSink { | |
/// Provides a delegating implementation of [StringSink] on [invoke]. | |
/// | |
/// ``` | |
/// String example(String name, int age) { | |
/// final sink = StringBuffer(); | |
/// sink | |
/// ..writeln('Identification') | |
/// ..indent(2, (sink) { | |
/// sink |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/// A set of type-safe JSON helpers that provide better error message handling. | |
/// | |
/// When used on well-structured JSON, these helpers have minimal overhead over | |
/// using `as` casts (i.e. `json['foo'] as String); however, when the cast fails | |
/// (which, should be rare in well-structured JSON) a format exception that | |
/// tries to highlight the offending source range is shown. | |
/// | |
/// Additionally, the API is a bit less cumbersome than manual casting: | |
/// * [JsonArray] | |
/// * [JsonObject] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct Scanner { | |
input: String, | |
output: Vec<Token> | |
} | |
#[derive(Debug)] | |
enum Token { | |
Integer(i64), | |
Addition, | |
Subtraction, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:binary/binary.dart'; | |
import 'package:meta/meta.dart'; | |
extension on Uint32 { | |
Uint32 operator +(int amount) => Uint32(value + amount); | |
Uint32 operator -(int amount) => Uint32(value - amount); | |
} | |
/// A helper for executing multiple register data transfer/stack operations. | |
/// |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@JS() | |
library canvaskit; | |
import 'package:js/js.dart'; | |
@JS('flutter_canvas_kit.SkPath') | |
@anonymous | |
abstract class SkPath { | |
external factory SkPath([SkPath? other]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:math' as math; | |
void main() { | |
final maxUint = 0xffffffff; | |
final longRes = maxUint + maxUint; | |
print('As Hex : ' + longRes.toRadixString(16)); | |
print('As Binary: ' + longRes.toRadixString(2)); | |
print('Bit 31 : ' + longRes.getBit(31).toString()); | |
print('Bit 32 : ' + longRes.getBit(32).toString()); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'package:armv4t/src/common/binary.dart'; | |
import 'package:binary/binary.dart'; | |
import 'package:meta/meta.dart'; | |
part 'format/block_data_transfer.dart'; | |
part 'format/branch.dart'; | |
part 'format/branch_and_exchange.dart'; | |
part 'format/data_processing_or_psr_transfer.dart'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:binary/binary.dart'; | |
import 'package:meta/meta.dart'; | |
import 'package:test/test.dart'; | |
import '_common.dart'; | |
void main() { | |
// CCCC_110P_UNWL_MMMM_DDDD_KKKK_OOOO_OOOO | |
group('COPROCESSOR_DATA_TRANSFER', () { | |
int build({ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:binary/binary.dart'; | |
import 'package:collection/collection.dart'; | |
import 'package:meta/meta.dart'; | |
/// An **internal** package representing all known `THUMB` instruction sets. | |
/// | |
/// For testing, individual [BitPattern] implementations are accessible as | |
/// static fields (e.g. `[$01$moveShiftedRegister]`), and a sorted | |
/// [BitPatternGrpup] is accessible as [allFormats]. | |
abstract class ThumbInstructionSet { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:binary/binary.dart'; | |
class ThumbInstructionSet { | |
static final $01$moveShiftedRegister = BitPatternBuilder.parse( | |
'000P_POOO_OOSS_SDDD', | |
).build('01:MOVE_SHIFTED_REGISTER'); | |
static final $02$addAndSubtract = BitPatternBuilder.parse( | |
'0001_11PN_NNSS_SDDD', | |
).build('02:ADD_AND_SUBTRACT'); |