pkgsrc/pkgtools/pkglint/files/licenses/licenses.y
rillig 1548b3ba55 Updated pkglint to 5.4.16.
Changes since 5.4.15:

* updated vardefs from mk/defaults/mk.conf from v1.118 (2006) to v1.269
  Gone:
  * PKG_SUFX
  * USETBL
  * PKGSRC_SHOW_PATCH_ERRORMSG
  * USE_XPKGWEDGE
  * PKGVULNDIR
  Adjusted:
  * USE_GAMESGROUP
  * BIN_INSTALL_FLAG -> BIN_INSTALL_FLAGS

* fixed license parsing to be more realistic
  (the previous version didn't handle parentheses correctly)

* lots of housekeeping
  * moved some code to separate packages, allowing re-use
  * separated Line checks into LineChecker type
  * separated MkLine checks into MkLineChecker type
  * made Line an interface, for further refactorings
2017-01-17 22:37:27 +00:00

37 lines
505 B
Text

%{
package licenses
%}
%token <Node> ltNAME
%token ltAND ltOR ltOPEN ltCLOSE
%union {
Node *Condition
}
%type <Node> start list node
%%
start : list {
liyylex.(*licenseLexer).result = $$
}
list : node {
$$ = &Condition{Children: []*Condition{$1}}
}
list : list ltAND node {
$$.Children = append($$.Children, $3)
$$.And = true
}
list : list ltOR node {
$$.Children = append($$.Children, $3)
$$.Or = true
}
node : ltNAME {
$$ = $1
}
node : ltOPEN list ltCLOSE {
$$ = &Condition{Paren: $2}
}