pkgsrc/pkgtools/pkglint/files/license.y
rillig 2498c7154b Updated pkglint to 5.4.7.
Changes since 5.4.6:

* Allow conditionals of the form "${var1}" == "${var2}"
* Check for indentation of .include directives
* Check arbitrarily complex license conditions
* General code cleanup
2016-07-10 21:24:47 +00:00

35 lines
457 B
Text
Executable file

%{
package main
%}
%token <Node> ltNAME
%token ltAND ltOR ltOPEN ltCLOSE
%union {
Node *LicenseCondition
}
%type <Node> start list condition
%%
start : list {
liyylex.(*licenseLexer).result = $$
}
list : condition {
$$ = $1
}
list : list ltAND condition {
$$.And = append($$.And, $3)
}
list : list ltOR condition {
$$.Or = append($$.Or, $3)
}
condition : ltNAME {
$$ = $1
}
condition : ltOPEN list ltCLOSE {
$$ = &LicenseCondition{Main: $2}
}