Skip to content

Commit 8635967

Browse files
vkutuevbachish
authored andcommitted
Add Regexp-Regexp Alternative operator for Grammar DSL
1 parent 3b7d8bc commit 8635967

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

solver/src/main/kotlin/org/ucfs/grammar/combinator/extension/StringExtension.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ object StringExtension {
1919
infix fun String.or(other: String): Regexp = Alternative.makeAlternative(left = Term(this), Term(other))
2020
infix fun String.or(other: Regexp): Regexp = Alternative.makeAlternative(left = Term(this), other)
2121
infix fun Regexp.or(other: String): Regexp = Alternative.makeAlternative(left = this, Term(other))
22+
infix fun Regexp.or(other: Regexp): Regexp = Alternative.makeAlternative(left = this, other)
2223

2324

2425
fun many(some: String): Regexp {
2526
return many(Term(some))
2627
}
2728
fun Option(exp: String) = Alternative.makeAlternative(Epsilon, Term(exp))
2829

29-
}
30+
}

0 commit comments

Comments
 (0)