Sim: Ignore everything between principal value and parameter-value pairs

This commit is contained in:
Mikolaj Wielgus 2022-10-21 18:39:40 +02:00
parent d1bf889e71
commit 209ff933e7
1 changed files with 8 additions and 2 deletions

View File

@ -84,12 +84,18 @@ namespace SIM_MODEL_GRAMMAR
struct fieldInferValueType : plus<upper> {};
struct fieldInferValuePrincipalValue : seq<// HACK: Because `number` matches empty string,
// ensure it is not empty.
// ensure it is not empty.
at<sor<tao::pegtl::digit,
one<'.'>>>,
// END HACK.
number<SIM_VALUE::TYPE_FLOAT, NOTATION::SI>,
star<not_at<sep>, not_at<one<'='>>, any>> {};
// Hackish: match anything until param-value pairs.
// Because the user may want to write something like
// "10k 30% 30mW w=0.4", but we care only about the
// "10k" and "w=0.4".
star<not_at<sep,
fieldParamValuePairs>,
any>> {};
struct fieldInferValue : sor<seq<fieldInferValueType,
opt<sep,
fieldParamValuePairs>>,