| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
| |
Any is the preferred over interface{} now in Go.
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
| |
ex. f3 field has logic or operator in if condition:
conditional_struct {
mask int32
f1 field1 (if[value[mask] & FIELD_FLAG1])
f2 int64 (if[value[mask] & FIELD_FLAG2])
f3 int64 (if[value[mask] == FIELD_FLAG1 || value[mask] == FIELD_FLAG2])
} [packed]
|
| | |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So far they have the following grammar:
OP = "==", "!=", "&"
value-expr = value-expr OP value-expr
| factor
factor = "(" and-expr ")"
| integer
| identifier
| string
Operators are left associative, e.g. A & B & C is the same as
(A & B) & C.
Further restrictions will be imposed in pkg/compiler.
This will help implement conditionally included fields.
|
| |
|
|
| |
Improve the test utility to group error messages by line.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The stringnozescapes does not make sense with filename,
also we may need similar escaping for string flags.
Handle escaped strings on ast level instead.
This avoids introducing new type and works seamleassly with flags.
As alternative I've also tried using strconv.Quote/Unquote
but it leads to ugly half-escaped strings:
"\xb0\x80s\xe8\xd4N\x91\xe3ڒ,\"C\x82D\xbb\x88\\i\xe2i\xc8\xe9\xd85\xb1\x14):M\xdcn"
Make hex-encoded strings a separate string format instead.
|
| |
|
|
|
| |
Scanner can access data out of bounds on bad input.
Also fix regression fuzz test to be able to detect the bug.
|
| | |
|
| |
|
|
|
|
| |
Currently we have to use 0xffffffffffffffff to represent -1,
and we can't express e.g. -20:20 int range.
Support negative consts to fix both problems.
|
| |
|
|
|
|
| |
Refactor some functions to be simpler.
Update #538
|
| |
|
|
|
|
|
| |
Frequently it's useful to do something like:
int8['a':'z']
punctuation = ',', '-', ':'
|
| |
|
|
| |
This comes up in several contexts in netfilter.
|
| | |
|
| |
|
|
| |
This is currently unsupported and unused.
|
| |
|
|
|
|
| |
Move most of the logic from sysgen to pkg/compiler.
Update #217
|
| |
|
|
| |
Update #217
|
| |
|
|
| |
Now pkg/compiler deals with consts.
|
| |
|
|
|
| |
For now we just generate the old structs from the new AST.
But this allows to delete the old parser entirely.
|
| | |
|
|
|
The old parser in sys/sysparser is too hacky, difficult to extend
and drops debug info too early, so that we can't produce proper error messages.
Add a new parser that is build like a proper language parser
and preserves full debug info for every token.
|