Skip to content

Commit

Permalink
fixed wrong escaped characters
Browse files Browse the repository at this point in the history
  • Loading branch information
moatazhm committed Apr 9, 2021
1 parent 0d55567 commit 99e543d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions codegen/src/main/java/dev/moataz/klquery/codegen/QueryBuilder.kt
Original file line number Diff line number Diff line change
Expand Up @@ -142,18 +142,18 @@ class QueryBuilder(
|argsBuilder.append(name)
|argsBuilder.append(" : ")
|when(matcher){
|Matchers.TO-> {argsBuilder.append(""+ if(value::class.simpleName == "String") "\\\"${'$'}value\\\"" else ""+ value)
|Matchers.TO-> {argsBuilder.append(""+ if(value::class.simpleName == "String") "\\\\"${'$'}value\\\\"" else ""+ value)
|argsBuilder.append(if (args.size -1 != index) "," else "" )}
|Matchers.MATCH-> {argsBuilder.append( "{match: " + if(value::class.simpleName == "String") "\"${'$'}value\"" else ""+ value + "}")
|Matchers.MATCH-> {argsBuilder.append( "{match: " + if(value::class.simpleName == "String") "\\\\"${'$'}value\\\\"" else ""+ value + "}")
|argsBuilder.append(if (args.size -1 != index) "," else "" )}
|Matchers.EQ-> {argsBuilder.append( "{eq: " + if(value::class.simpleName == "String") "\"${'$'}value\"" else ""+ value + "}")
|Matchers.EQ-> {argsBuilder.append( "{eq: " + if(value::class.simpleName == "String") "\\\\"${'$'}value\\\\"" else ""+ value + "}")
|argsBuilder.append(if (args.size -1 != index) "," else "" )}
|Matchers.FROMTO-> {
|val fromTypeString= (value as dev.moataz.klquery.util.KQLRange).from.second::class.simpleName == "String"
|val toTypeString= (value as dev.moataz.klquery.util.KQLRange).to.second::class.simpleName == "String"
|argsBuilder.append( "{from: " + if (fromTypeString) "\"${'$'}value.from.second\"" else ""+ value.from.second )
|argsBuilder.append( "{from: " + if (fromTypeString) "\\\\"${'$'}value.from.second\\\\"" else ""+ value.from.second )
|argsBuilder.append(", ")
|argsBuilder.append("{from: " + if (toTypeString) "\"${'$'}value.to.second\"" else ""+ value.to.second )
|argsBuilder.append("{from: " + if (toTypeString) "\\\\"${'$'}value.to.second\\\\"" else ""+ value.to.second )
|argsBuilder.append("}")
|argsBuilder.append(if (args.size -1 != index) "," else "" )
|}
Expand Down

0 comments on commit 99e543d

Please sign in to comment.