Template
feat(kdl): add DSL schema validation
This commit is contained in:
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
/* stupid.kdl - the canonical stupidtools build file (todo 9 fixture).
|
||||
|
||||
Pins the stupidtools DSL grammar (enforced by src/kdl/schema.h):
|
||||
|
||||
project "name" version "semver" required, MUST be the first node
|
||||
target "name" { src "file" ... ; feature "name" ... }
|
||||
feature "name" { <checks> } checks: structural until todo 10
|
||||
option "name" default=#bool default is an optional bool property
|
||||
|
||||
This is the VALID fixture for tests/unit/test_schema.c and is reused by
|
||||
todo 16 (configure generation) and todo 23 (self-host), so it is
|
||||
representative of a real build file, not a minimal toy. */
|
||||
|
||||
// The project node: the name is the first positional argument; the
|
||||
// version string follows the literal `version` keyword.
|
||||
project "stupidtools" version "1.0.0"
|
||||
|
||||
// Features bundle the checks a target depends on. `header` and `library`
|
||||
// are two of the 8 check kinds (todo 10 defines them all); here they are
|
||||
// structural placeholders.
|
||||
feature "pthread" {
|
||||
header "pthread.h"
|
||||
library "pthread"
|
||||
}
|
||||
|
||||
feature "math" {
|
||||
library "m"
|
||||
}
|
||||
|
||||
// A target: the sources that make up one artifact, plus the features it
|
||||
// needs at build/link time.
|
||||
target "default" {
|
||||
src "src/main.c"
|
||||
src "src/cli.c"
|
||||
src "src/kdl/lexer.c"
|
||||
src "src/kdl/parser.c"
|
||||
feature "pthread"
|
||||
feature "math"
|
||||
}
|
||||
|
||||
// An option maps to --enable-debug / --disable-debug; `default` is an
|
||||
// optional boolean property (unannotated #true/#false only).
|
||||
option "debug" default=#false
|
||||
Reference in New Issue
Block a user