Skip to content
Snippets Groups Projects
Commit 1821006b authored by Alexander Turenko's avatar Alexander Turenko Committed by Alexander Turenko
Browse files

config: add version expression lexer

The expression syntax is C alike except version literals. The
expressions are oriented to version comparisons, so arithmetic operators
are not implemented: only compare and logical operators.

Supported tokens:

* Three component version literal: `\d+.\d+.\d+`.
* Variable: `[a-zA-Z_][a-zA-Z0-9_]`.
* Operators: `(`, `)`, `<`, `>`, `<=`, `>=`, `!=`, `==`, `&&`, `||`.

The operators are token separators: `x>=` is the same as `x >= y`.

The idea how to structurize the code is borrowed from @locker's
`src/lua/xml.c`: see commit 5f596b25 ("lua: add internal xml
parser").

Part of #9452

NO_DOC=It is a supplementary module for config's conditional section
       predicates. To be documented in the last commit of the series.
NO_CHANGELOG=see NO_DOC
parent c3cd225a
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment