Skip to content

Commit 8d7b61f

Browse files
committed
dsl: add a field accessor, $nth
Signed-off-by: Masatake YAMATO <[email protected]>
1 parent cf3388e commit 8d7b61f

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

dsl/dsl.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ DECLARE_VALUE_FN(inherits);
9696
DECLARE_VALUE_FN(implementation);
9797
DECLARE_VALUE_FN(kind);
9898
DECLARE_VALUE_FN(language);
99+
DECLARE_VALUE_FN(nth);
99100
DECLARE_VALUE_FN(scope);
100101
DECLARE_VALUE_FN(scope_kind);
101102
DECLARE_VALUE_FN(scope_name);
@@ -213,6 +214,8 @@ static DSLProcBind pbinds [] = {
213214
.helpstr = "-> <list>" },
214215
{ "$implementation", value_implementation, NULL, DSL_PATTR_MEMORABLE, 0UL,
215216
.helpstr = "-> #f|<string>" },
217+
{ "$nth", value_nth, NULL, DSL_PATTR_MEMORABLE, 0UL,
218+
.helpstr = "-> #f|<integer>"},
216219
{ "$kind", value_kind, NULL, DSL_PATTR_MEMORABLE, 0UL,
217220
.helpstr = "-> #f|<string>"},
218221
{ "$language", value_language, NULL, DSL_PATTR_MEMORABLE, 0UL,
@@ -903,6 +906,7 @@ DEFINE_VALUE_FN(inherits)
903906
DEFINE_VALUE_FN(implementation)
904907
DEFINE_VALUE_FN(kind)
905908
DEFINE_VALUE_FN(language)
909+
DEFINE_VALUE_FN(nth)
906910
DEFINE_VALUE_FN(scope)
907911
DEFINE_VALUE_FN(scope_kind)
908912
DEFINE_VALUE_FN(scope_name)
@@ -995,6 +999,11 @@ EsObject* dsl_entry_language (const tagEntry *entry)
995999
return dsl_entry_xget_string (entry, "language");
9961000
}
9971001

1002+
EsObject* dsl_entry_nth (const tagEntry *entry)
1003+
{
1004+
return dsl_entry_xget_integer(entry, "nth");
1005+
}
1006+
9981007
EsObject* dsl_entry_implementation (const tagEntry *entry)
9991008
{
10001009
return dsl_entry_xget_string (entry, "implementation");

dsl/dsl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ EsObject* dsl_entry_inherits (const tagEntry *entry);
112112
EsObject* dsl_entry_implementation (const tagEntry *entry);
113113
EsObject* dsl_entry_kind (const tagEntry *entry);
114114
EsObject* dsl_entry_language (const tagEntry *entry);
115+
EsObject* dsl_entry_nth (const tagEntry *entry);
115116
EsObject* dsl_entry_scope (const tagEntry *entry);
116117
EsObject* dsl_entry_scope_kind (const tagEntry *entry);
117118
EsObject* dsl_entry_scope_name (const tagEntry *entry);

0 commit comments

Comments
 (0)