You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by mi...@apache.org on 2022/10/08 08:03:46 UTC
[incubator-eventmesh] branch master updated: modify jqer default constructor logic
This is an automated email from the ASF dual-hosted git repository.
mikexue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
The following commit(s) were added to refs/heads/master by this push:
new 0cf963a3 modify jqer default constructor logic
new cd8972e4 Merge pull request #1487 from walterlife/modify-eventmesh-workflow-jqer
0cf963a3 is described below
commit 0cf963a30e6123955479992f02273107097c7e58
Author: walterlife <wa...@gmail.com>
AuthorDate: Sun Oct 2 00:05:00 2022 +0800
modify jqer default constructor logic
---
eventmesh-workflow-go/third_party/jqer/jqer.go | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/eventmesh-workflow-go/third_party/jqer/jqer.go b/eventmesh-workflow-go/third_party/jqer/jqer.go
index fdc61fa3..80737091 100644
--- a/eventmesh-workflow-go/third_party/jqer/jqer.go
+++ b/eventmesh-workflow-go/third_party/jqer/jqer.go
@@ -29,8 +29,8 @@ import (
)
const (
- wrapBeginCharacter = "$"
- jqStartToken lexer.TokenType = iota
+ defaultWrapBeginCharacter = "$"
+ jqStartToken lexer.TokenType = iota
stringToken
errorToken
noToken
@@ -71,7 +71,17 @@ type jqer struct {
// NewJQ constructor jq instance
func NewJQ(options ...Option) JQ {
- return &jqer{options: loadOptions(options...)}
+ jq := &jqer{options: loadOptions(options...)}
+ if len(jq.options.WrapLeftSeparator) == 0 {
+ jq.options.WrapBegin = defaultWrapBeginCharacter
+ }
+ if len(jq.options.WrapLeftSeparator) == 0 {
+ jq.options.WrapLeftSeparator = defaultWrapBeginCharacter
+ }
+ if len(jq.options.WrapRightSeparator) == 0 {
+ jq.options.WrapRightSeparator = defaultWrapBeginCharacter
+ }
+ return jq
}
// One single jq
@@ -176,7 +186,7 @@ func (j *jqer) jqState(l *lexer.L) lexer.StateFunc {
}
src[i] = string(r)
- if src[i] == wrapBeginCharacter && i > 0 {
+ if src[i] == defaultWrapBeginCharacter && i > 0 {
jdxJ = i
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org