summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/go-ini/ini/parser.go
diff options
context:
space:
mode:
authorChristopher Speller <crspeller@gmail.com>2018-06-21 13:10:40 -0700
committerHarrison Healey <harrisonmhealey@gmail.com>2018-06-21 16:10:40 -0400
commit8526739066ccb00ccd24b74650a7d7b284442985 (patch)
tree282512ae2ad95c98a9ca82de304a410b6b56685c /vendor/github.com/go-ini/ini/parser.go
parenta59ccaa8b3844895dde3980e6224fef46ff4a1c8 (diff)
downloadchat-8526739066ccb00ccd24b74650a7d7b284442985.tar.gz
chat-8526739066ccb00ccd24b74650a7d7b284442985.tar.bz2
chat-8526739066ccb00ccd24b74650a7d7b284442985.zip
MM-10934 Update server dependencies. (#8981)
* Changing throttled import path. * Upgrading dependencies.
Diffstat (limited to 'vendor/github.com/go-ini/ini/parser.go')
-rw-r--r--vendor/github.com/go-ini/ini/parser.go21
1 files changed, 17 insertions, 4 deletions
diff --git a/vendor/github.com/go-ini/ini/parser.go b/vendor/github.com/go-ini/ini/parser.go
index 826e893c0..d5aa2db60 100644
--- a/vendor/github.com/go-ini/ini/parser.go
+++ b/vendor/github.com/go-ini/ini/parser.go
@@ -198,7 +198,7 @@ func hasSurroundedQuote(in string, quote byte) bool {
func (p *parser) readValue(in []byte,
parserBufferSize int,
- ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines bool) (string, error) {
+ ignoreContinuation, ignoreInlineComment, unescapeValueDoubleQuotes, unescapeValueCommentSymbols, allowPythonMultilines, spaceBeforeInlineComment bool) (string, error) {
line := strings.TrimLeftFunc(string(in), unicode.IsSpace)
if len(line) == 0 {
@@ -240,11 +240,22 @@ func (p *parser) readValue(in []byte,
// Check if ignore inline comment
if !ignoreInlineComment {
- i := strings.IndexAny(line, "#;")
+ var i int
+ if spaceBeforeInlineComment {
+ i = strings.Index(line, " #")
+ if i == -1 {
+ i = strings.Index(line, " ;")
+ }
+
+ } else {
+ i = strings.IndexAny(line, "#;")
+ }
+
if i > -1 {
p.comment.WriteString(line[i:])
line = strings.TrimSpace(line[:i])
}
+
}
// Trim single and double quotes
@@ -429,7 +440,8 @@ func (f *File) parse(reader io.Reader) (err error) {
f.options.IgnoreInlineComment,
f.options.UnescapeValueDoubleQuotes,
f.options.UnescapeValueCommentSymbols,
- f.options.AllowPythonMultilineValues)
+ f.options.AllowPythonMultilineValues,
+ f.options.SpaceBeforeInlineComment)
if err != nil {
return err
}
@@ -458,7 +470,8 @@ func (f *File) parse(reader io.Reader) (err error) {
f.options.IgnoreInlineComment,
f.options.UnescapeValueDoubleQuotes,
f.options.UnescapeValueCommentSymbols,
- f.options.AllowPythonMultilineValues)
+ f.options.AllowPythonMultilineValues,
+ f.options.SpaceBeforeInlineComment)
if err != nil {
return err
}