Super basic NIP file parser

This commit is contained in:
Héctor Giménez
2023-03-11 19:41:51 +09:00
parent 2414f0a727
commit d71894a044
5 changed files with 361 additions and 0 deletions

34
pkg/nip/rule.go Normal file
View File

@@ -0,0 +1,34 @@
package pickit
const (
OperandEqual Operand = "=="
OperandGreaterThan Operand = ">"
OperandGreaterOrEqualTo Operand = ">="
OperandLessThan Operand = "<"
OperandLessThanOrEqualTo Operand = "<="
OperandNotEqualTo Operand = "!="
OperandAnd Operand = "&&"
OperandOr Operand = "||"
)
type Rule struct {
Properties []Group
Stats []Group
MaxQuantity []Group
}
type Keyword string
type Operand string
type Comparable struct {
Keyword string
Comparison Operand
ValueInt int
ValueString string
Operand
}
type Group struct {
Comparable []Comparable
Operand
}