Handle disabled and hidden attributes

This commit is contained in:
Jon Evans
2025-10-15 22:18:50 -04:00
parent 6baf5e798e
commit f9bee87185
5 changed files with 29 additions and 0 deletions
+2
View File
@@ -97,6 +97,8 @@ bool LIBRARY_TABLE::addRowFromIR( const LIBRARY_TABLE_ROW_IR& aIR )
row.m_type = wxString::FromUTF8( aIR.type );
row.m_options = wxString::FromUTF8( aIR.options );
row.m_description = wxString::FromUTF8( aIR.description );
row.m_hidden = aIR.hidden;
row.m_disabled = aIR.disabled;
row.m_ok = true;
row.m_scope = m_scope;
+14
View File
@@ -122,6 +122,20 @@ DEFINE_STRING_ACTION( KEYWORDS::URI, current_row_model.uri );
DEFINE_STRING_ACTION( KEYWORDS::OPTIONS, current_row_model.options );
DEFINE_STRING_ACTION( KEYWORDS::DESCR, current_row_model.description );
// Handle (hidden), (disabled)
#define DEFINE_FLAG_ACTION( Rule, StateVariable ) \
template <> \
struct LIBRARY_TABLE_PARSER_ACTION<Rule> \
{ \
static void apply0( LIBRARY_TABLE_PARSER_STATE& s ) \
{ \
s.StateVariable = true; \
} \
} \
DEFINE_FLAG_ACTION( HIDDEN_MARKER, current_row_model.hidden );
DEFINE_FLAG_ACTION( DISABLED_MARKER, current_row_model.disabled );
template <>
struct LIBRARY_TABLE_PARSER_ACTION<LIB_ROW>
+4
View File
@@ -62,6 +62,8 @@ public:
const wxString& Options() const { return m_options; }
const wxString& Description() const { return m_description; }
LIBRARY_TABLE_SCOPE Scope() const { return m_scope; }
bool Disabled() const { return m_disabled; }
bool Hidden() const { return m_hidden; }
std::map<std::string, UTF8> GetOptionsMap() const;
@@ -74,6 +76,8 @@ private:
wxString m_type;
wxString m_options;
wxString m_description;
bool m_disabled;
bool m_hidden;
bool m_ok = false;
wxString m_errorDescription;
@@ -41,6 +41,8 @@ namespace KEYWORDS
struct URI : TAO_PEGTL_STRING( "uri" ) {};
struct OPTIONS : TAO_PEGTL_STRING( "options" ) {};
struct DESCR : TAO_PEGTL_STRING( "descr" ) {};
struct HIDDEN : TAO_PEGTL_STRING( "hidden" ) {};
struct DISABLED : TAO_PEGTL_STRING( "disabled" ) {};
struct SYM_LIB_TABLE : TAO_PEGTL_STRING( "sym_lib_table" ) {};
struct FP_LIB_TABLE : TAO_PEGTL_STRING( "fp_lib_table" ) {};
@@ -99,12 +101,17 @@ struct TABLE_VERSION : seq<
RPAREN
> {};
struct HIDDEN_MARKER : seq< LPAREN, KEYWORDS::HIDDEN, RPAREN > {};
struct DISABLED_MARKER : seq< LPAREN, KEYWORDS::DISABLED, RPAREN > {};
// (lib (name ...)(type ...)...)
struct LIB_ROW : if_must<
pad< LPAREN, space >,
KEYWORDS::LIB,
plus< space >,
plus< pad< LIB_PROPERTY, space > >,
pad_opt<HIDDEN_MARKER, space>,
pad_opt<DISABLED_MARKER, space>,
pad< RPAREN, space>
> {};
+2
View File
@@ -37,6 +37,8 @@ struct LIBRARY_TABLE_ROW_IR
std::string type;
std::string options;
std::string description;
bool disabled = false;
bool hidden = false;
};
/**