[SDK Library] Consider supporting parsing binary integers #45063
Labels
area-core-library
SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries.
library-core
type-enhancement
A request for a change that isn't a bug
For some content I'm working on it would be nice if
int.parse
andint.tryParse
natively supported parsing binary integers prefixed with0b
similar to how it handles hexadecimal0x
ones currently.Implementing this work now would also simplify the implementation of binary integer literals in the future as included in the considered small and useful features list documented in the language repo. The CFE/analyzer currently use the method for their conversion of the literals to consistent decimal values.
Analyzer:
https://cs.opensource.google/dart/sdk/+/master:pkg/analyzer/tool/summary/mini_ast.dart;l=478
https://cs.opensource.google/dart/sdk/+/master:pkg/analyzer/lib/src/fasta/ast_builder.dart;l=2972
CFE:
https://cs.opensource.google/dart/sdk/+/master:pkg/front_end/lib/src/fasta/kernel/body_builder.dart;l=2444
The text was updated successfully, but these errors were encountered: