add C-style comment support
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"multini/output"
|
||||
"multini/types"
|
||||
"multini/internal/output"
|
||||
"multini/internal/types"
|
||||
)
|
||||
|
||||
func chk() int {
|
||||
|
@ -4,8 +4,8 @@ import (
|
||||
"errors"
|
||||
"os"
|
||||
|
||||
"multini/output"
|
||||
"multini/types"
|
||||
"multini/internal/output"
|
||||
"multini/internal/types"
|
||||
|
||||
"github.com/juju/gnuflag"
|
||||
)
|
||||
|
@ -3,8 +3,8 @@ package main
|
||||
import (
|
||||
"os"
|
||||
|
||||
"multini/output"
|
||||
"multini/types"
|
||||
"multini/internal/output"
|
||||
"multini/internal/types"
|
||||
)
|
||||
|
||||
const (
|
||||
|
@ -7,8 +7,8 @@ import (
|
||||
"regexp"
|
||||
"strings"
|
||||
|
||||
"multini/output"
|
||||
"multini/types"
|
||||
"multini/internal/output"
|
||||
"multini/internal/types"
|
||||
)
|
||||
|
||||
var (
|
||||
@ -26,15 +26,15 @@ var (
|
||||
|
||||
RxBodyPrefix string = `(?P<` + NgPrefix + `>\s+)?`
|
||||
RxSectionName string = `\[(?P<` + NgSection + `>.+)\]`
|
||||
RxKey string = `(?P<` + NgKey + `>(?:[^;#=]+[^\s=;#]|[^;#=]))?`
|
||||
RxKey string = `(?P<` + NgKey + `>(?:[^;#/=]+[^\s=;#/]|[^;#/=]))?`
|
||||
RxKeyPostfix string = `(?P<` + NgKeyPostfix + `>\s+)?`
|
||||
RxValuePrefix string = `(?P<` + NgValuePrefix + `>\s+)?`
|
||||
RxValue string = `(?P<` + NgValue + `>(?:[^;#]+[^\s;#]|[^;#]))?`
|
||||
RxValue string = `(?P<` + NgValue + `>(?:[^;#/]+[^\s;#/]|[^;#/]))?`
|
||||
RxValuePostfix string = `(?P<` + NgValuePostfix + `>\s+)?`
|
||||
RxKeyVal string = RxKey + RxKeyPostfix + `=` + RxValuePrefix + RxValue + RxValuePostfix
|
||||
RxBody string = `(?:` + RxSectionName + `|` + RxKeyVal + `)?`
|
||||
RxBodyPostfix string = `(?P<` + NgPostifx + `>\s+)?`
|
||||
RxCommentPrefix string = `(?P<` + NgCommentPrefix + `>[#;]\s*)`
|
||||
RxCommentPrefix string = `(?P<` + NgCommentPrefix + `>([#;]|//)\s*)`
|
||||
RxCommentText string = `(?P<` + NgComment + `>.+)?`
|
||||
RxComment string = `(?:` + RxCommentPrefix + RxCommentText + `)?`
|
||||
Rx string = RxBodyPrefix + RxBody + RxBodyPostfix + RxComment
|
||||
|
@ -7,7 +7,7 @@ import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"multini/types"
|
||||
"multini/internal/types"
|
||||
)
|
||||
|
||||
// Source: https://gist.github.com/var23rav/23ae5d0d4d830aff886c3c970b8f6c6b
|
||||
|
Reference in New Issue
Block a user