aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/ast/scanner.go
Commit message (Collapse)AuthorAgeFilesLines
* all: use any instead of interface{}Dmitry Vyukov2025-12-221-1/+1
| | | | Any is the preferred over interface{} now in Go.
* tools/syz-declextract: ignore files with non US-ASCII charsDmitry Vyukov2025-04-151-8/+14
|
* all: support || operator in syzlang if conditionJiao, Joey2024-11-131-0/+4
| | | | | | | | | | | 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]
* all: follow new linter recommendationsTaras Madan2024-09-101-8/+8
|
* pkg/ast: support expressions with ast.TypeAleksandr Nogikh2024-02-191-0/+21
| | | | | | | | | | | | | | | | | | | | | 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.
* pkg/ast: improve test outputDmitry Vyukov2020-05-051-0/+22
| | | | Improve the test utility to group error messages by line.
* pkg/ast: introduce hex-encoded string literalsDmitry Vyukov2020-02-101-32/+27
| | | | | | | | | | | | | 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.
* pkg/ast: fix out-of-bounds accessDmitry Vyukov2019-07-301-1/+0
| | | | | Scanner can access data out of bounds on bad input. Also fix regression fuzz test to be able to detect the bug.
* sys/linux: extend AX25/ROSE/NETROM descriptionsDmitry Vyukov2018-12-241-0/+1
|
* pkg/compiler: support negative integersDmitry Vyukov2018-07-091-14/+15
| | | | | | 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.
* gometalinter: enable cyclomatic complexity checkingDmitry Vyukov2018-05-041-70/+93
| | | | | | Refactor some functions to be simpler. Update #538
* pkg/ast: support char constantsDmitry Vyukov2018-04-291-0/+11
| | | | | | | Frequently it's useful to do something like: int8['a':'z'] punctuation = ',', '-', ':'
* pkg/compiler: allow use of empty stringsDmitry Vyukov2018-01-231-6/+0
| | | | This comes up in several contexts in netfilter.
* executor, sys/windows: initial windows supportDmitry Vyukov2017-09-251-0/+3
|
* pkg/ast: prohibit empty stringsDmitry Vyukov2017-09-041-0/+6
| | | | This is currently unsupported and unused.
* pkg/compiler: check and generate typesDmitry Vyukov2017-09-021-8/+8
| | | | | | Move most of the logic from sysgen to pkg/compiler. Update #217
* pkg/compiler: more static error checkingDmitry Vyukov2017-08-271-1/+5
| | | | Update #217
* pkg/compiler, sys/syz-sysgen: move const handling to pkg/compilerDmitry Vyukov2017-08-271-4/+6
| | | | Now pkg/compiler deals with consts.
* sys/syz-sysgen: switch to new parserDmitry Vyukov2017-08-181-3/+5
| | | | | For now we just generate the old structs from the new AST. But this allows to delete the old parser entirely.
* sys/syz-extract: switch to the new parserDmitry Vyukov2017-08-181-0/+6
|
* pkg/ast: new parser for sys descriptionsDmitry Vyukov2017-08-181-0/+260
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.