File tree Expand file tree Collapse file tree 5 files changed +7
-7
lines changed
com/github/h0tk3y/betterParse/st Expand file tree Collapse file tree 5 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ repositories {
3434}
3535
3636dependencies {
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
Original file line number Diff line number Diff line change 11group ' com.github.h0tk3y.betterParse'
2- version ' 0.3.0 '
2+ version ' 0.3.1 '
33
44buildscript {
55 ext. kotlin_version = ' 1.1.51'
Original file line number Diff line number Diff 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]. */
4848fun <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
Original file line number Diff line number Diff line change 11package com.github.h0tk3y.betterParse.combinators
2- import com.github.h0tk3y.betterParse.parser.Parser
32import 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 >) =
Original file line number Diff line number Diff line change @@ -66,14 +66,14 @@ private fun SyntaxTree<*>.toTopDownStrings() = topDownNodesSequence()
6666class 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
You can’t perform that action at this time.
0 commit comments