Skip to content

Commit 48c2edb

Browse files
committed
Advance version to 0.3.1, fix non-nullable structureParsers and tests.
1 parent 813d1cb commit 48c2edb

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ repositories {
3434
}
3535

3636
dependencies {
37-
compile 'com.github.h0tk3y.betterParse:better-parse:0.3.0'
37+
compile 'com.github.h0tk3y.betterParse:better-parse:0.3.1'
3838
}
3939
```
4040

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
group 'com.github.h0tk3y.betterParse'
2-
version '0.3.0'
2+
version '0.3.1'
33

44
buildscript {
55
ext.kotlin_version = '1.1.51'

src/main/kotlin/com/github/h0tk3y/betterParse/st/LiftToSyntaxTree.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ fun <T> Parser<T>.liftToSyntaxTreeParser(
4747
/** Converts a [Grammar] so that its [Grammar.rootParser] parses a [SyntaxTree]. See: [liftToSyntaxTreeParser]. */
4848
fun <T> Grammar<T>.liftToSyntaxTreeGrammar(
4949
liftOptions: LiftToSyntaxTreeOptions = LiftToSyntaxTreeOptions(),
50-
structureParsers: Set<Parser<*>> = declaredParsers,
50+
structureParsers: Set<Parser<*>>? = declaredParsers,
5151
transformer: LiftToSyntaxTreeTransformer? = null
5252
) = object : Grammar<SyntaxTree<T>>() {
5353
override val rootParser: Parser<SyntaxTree<T>> = this@liftToSyntaxTreeGrammar.rootParser

src/main/kotlin/generated/andFunctions.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package com.github.h0tk3y.betterParse.combinators
2-
import com.github.h0tk3y.betterParse.parser.Parser
32
import com.github.h0tk3y.betterParse.utils.*
3+
import com.github.h0tk3y.betterParse.parser.*
44

55
@JvmName("and2") inline infix fun <reified T1, reified T2, reified T3>
66
AndCombinator<Tuple2<T1, T2>>.and(p3: Parser<T3>) =

src/test/kotlin/TestLiftToAst.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ private fun SyntaxTree<*>.toTopDownStrings() = topDownNodesSequence()
6666
class TestLiftToAst {
6767
@Test
6868
fun continuousRange() {
69-
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = true), structureParsers = emptySet())
69+
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = true), structureParsers = null)
7070
val ast = astParser.parseToEnd("a&(b1->c1)|a1&!b|!(a1->a2)->a")
7171
checkAstContinuousRange(ast)
7272
}
7373

7474
@Test
7575
fun astStructure() {
76-
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = true), structureParsers = emptySet())
76+
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = true), structureParsers = null)
7777
val ast = astParser.parseToEnd("(!(a)->((b)|(!c))->!(!a)&!(d))")
7878
val types = ast.toTopDownStrings()
7979

@@ -86,7 +86,7 @@ class TestLiftToAst {
8686

8787
@Test
8888
fun testDropSkipped() {
89-
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = false), structureParsers = emptySet())
89+
val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions(retainSkipped = false), structureParsers = null)
9090
val ast = astParser.parseToEnd("(!(a)->((b)|(!c))->!(!a)&!(d))")
9191
val types = ast.toTopDownStrings()
9292

0 commit comments

Comments
 (0)