From da89ac0b25c5198bb0d707d7545bea7bc1c5a01e Mon Sep 17 00:00:00 2001 From: Pauli Date: Thu, 16 May 2019 14:50:18 +1000 Subject: [PATCH] Optional property query support. Add the possibility of a property query clause to be optional by preceding it with a question mark. Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/8943) --- crypto/property/properties.ebnf | 9 +-- crypto/property/properties.xhtml | 104 ++++++++++++++++++++++--------- crypto/property/property.c | 11 ++-- crypto/property/property_lcl.h | 5 +- crypto/property/property_parse.c | 47 ++++++++++---- test/property_test.c | 41 +++++++----- 6 files changed, 153 insertions(+), 64 deletions(-) mode change 100644 => 100755 crypto/property/properties.xhtml diff --git a/crypto/property/properties.ebnf b/crypto/property/properties.ebnf index 9a6857f751..0051c7e430 100644 --- a/crypto/property/properties.ebnf +++ b/crypto/property/properties.ebnf @@ -2,16 +2,17 @@ Definition ::= PropertyName ( '=' Value )? ( ',' PropertyName ( '=' Value )? )* -Query ::= ( '-'? PropertyName | PropertyName ( '=' | '!=' ) Value ) - ( ',' ( '-'? PropertyName | PropertyName ( '=' | '!=' ) Value ) )* +Query ::= PropertyQuery ( ',' PropertyQuery )* +PropertyQuery ::= '-'? PropertyName + | '?' ( PropertyName (( '=' | '!=' ) Value)?) Value ::= NumberLiteral | StringLiteral StringLiteral ::= QuotedString | UnquotedString QuotedString ::= '"' [^"]* '"' - | "'" [^']* "'" + | "'" [^']* "'" UnquotedString ::= [^{space},]+ NumberLiteral ::= '0' ( [0-7]* | 'x' [0-9A-Fa-f]+ ) - | '-'? [1-9] [0-9]+ + | '-'? [1-9] [0-9]+ PropertyName ::= [A-Z] [A-Z0-9_]* ( '.' [A-Z] [A-Z0-9_]* )* diff --git a/crypto/property/properties.xhtml b/crypto/property/properties.xhtml old mode 100644 new mode 100755 index 33827226c0..766d885bf0 --- a/crypto/property/properties.xhtml +++ b/crypto/property/properties.xhtml @@ -2,7 +2,7 @@ - + - - - - - - - - PropertyName - - - PropertyName - - = - - - != - - - Value + + + + PropertyQuery , - - - + + + -
Query    ::= ( '-'? PropertyName | PropertyName ( '=' | '!=' ) Value ) ( ',' ( '-'? PropertyName | PropertyName ( '=' | '!=' ) Value ) )*
+
Query    ::= PropertyQuery ( ',' PropertyQuery )*
- no referencesValue: + no referencesPropertyQuery: + + + + + + + + - + + + PropertyName + + ? + + + PropertyName + + = + + + != + + + Value + + + + +
         ::= '-'? PropertyName
+
           | '?' PropertyName ( ( '=' | '!=' ) Value )?
+
+ referenced by: + + Query + + Value: