Sign in
fuchsia
/
third_party
/
dart-pkg
/
refs/heads/main
/
.
/
petitparser
/
lib
/
src
/
expression
/
utils.dart
blob: 9068db90149bfd9bc96de69d47ad8645d01a9fec [
file
] [
log
] [
blame
]
import
'../core/parser.dart'
;
import
'../parser/combinator/choice.dart'
;
// Internal helper to build an optimal choice parser.
Parser
<
R
>
buildChoice
<
R
>(
List
<
Parser
<
R
>>
parsers
)
=>
parsers
.
length
==
1
?
parsers
.
first
:
parsers
.
toChoiceParser
();