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 {
34
34
}
35
35
36
36
dependencies {
37
- compile ' com.github.h0tk3y.betterParse:better-parse:0.3.0 '
37
+ compile ' com.github.h0tk3y.betterParse:better-parse:0.3.1 '
38
38
}
39
39
```
40
40
Original file line number Diff line number Diff line change 1
1
group ' com.github.h0tk3y.betterParse'
2
- version ' 0.3.0 '
2
+ version ' 0.3.1 '
3
3
4
4
buildscript {
5
5
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(
47
47
/* * Converts a [Grammar] so that its [Grammar.rootParser] parses a [SyntaxTree]. See: [liftToSyntaxTreeParser]. */
48
48
fun <T > Grammar<T>.liftToSyntaxTreeGrammar (
49
49
liftOptions : LiftToSyntaxTreeOptions = LiftToSyntaxTreeOptions (),
50
- structureParsers : Set <Parser <* >> = declaredParsers,
50
+ structureParsers : Set <Parser <* >>? = declaredParsers,
51
51
transformer : LiftToSyntaxTreeTransformer ? = null
52
52
) = object : Grammar <SyntaxTree <T >>() {
53
53
override val rootParser: Parser <SyntaxTree <T >> = this @liftToSyntaxTreeGrammar.rootParser
Original file line number Diff line number Diff line change 1
1
package com.github.h0tk3y.betterParse.combinators
2
- import com.github.h0tk3y.betterParse.parser.Parser
3
2
import com.github.h0tk3y.betterParse.utils.*
3
+ import com.github.h0tk3y.betterParse.parser.*
4
4
5
5
@JvmName(" and2" ) inline infix fun <reified T1 , reified T2 , reified T3 >
6
6
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()
66
66
class TestLiftToAst {
67
67
@Test
68
68
fun continuousRange () {
69
- val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = true ), structureParsers = emptySet() )
69
+ val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = true ), structureParsers = null )
70
70
val ast = astParser.parseToEnd(" a&(b1->c1)|a1&!b|!(a1->a2)->a" )
71
71
checkAstContinuousRange(ast)
72
72
}
73
73
74
74
@Test
75
75
fun astStructure () {
76
- val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = true ), structureParsers = emptySet() )
76
+ val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = true ), structureParsers = null )
77
77
val ast = astParser.parseToEnd(" (!(a)->((b)|(!c))->!(!a)&!(d))" )
78
78
val types = ast.toTopDownStrings()
79
79
@@ -86,7 +86,7 @@ class TestLiftToAst {
86
86
87
87
@Test
88
88
fun testDropSkipped () {
89
- val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = false ), structureParsers = emptySet() )
89
+ val astParser = booleanGrammar.liftToSyntaxTreeGrammar(LiftToSyntaxTreeOptions (retainSkipped = false ), structureParsers = null )
90
90
val ast = astParser.parseToEnd(" (!(a)->((b)|(!c))->!(!a)&!(d))" )
91
91
val types = ast.toTopDownStrings()
92
92
You can’t perform that action at this time.
0 commit comments