File tree Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Expand file tree Collapse file tree 2 files changed +19
-13
lines changed Original file line number Diff line number Diff line change @@ -937,6 +937,23 @@ EsObject* dsl_entry_xget_string (const tagEntry *entry, const char* name)
937937 return es_false ;
938938}
939939
940+ EsObject * dsl_entry_xget_integer (const tagEntry * entry , const char * name )
941+ {
942+ const char * end_str = entry_xget (entry , name );
943+ EsObject * o ;
944+
945+ if (end_str )
946+ {
947+ o = es_read_from_string (end_str , NULL );
948+ if (es_integer_p (o ))
949+ return es_object_autounref (o );
950+ else
951+ return es_false ;
952+ }
953+ else
954+ return es_false ;
955+ }
956+
940957/*
941958 * Accessesors for tagEntry
942959 */
@@ -1005,19 +1022,7 @@ EsObject* dsl_entry_extras (const tagEntry *entry)
10051022
10061023EsObject * dsl_entry_end (const tagEntry * entry )
10071024{
1008- const char * end_str = entry_xget (entry , "end" );
1009- EsObject * o ;
1010-
1011- if (end_str )
1012- {
1013- o = es_read_from_string (end_str , NULL );
1014- if (es_integer_p (o ))
1015- return es_object_autounref (o );
1016- else
1017- return es_false ;
1018- }
1019- else
1020- return es_false ;
1025+ return dsl_entry_xget_integer (entry , "end" );
10211026}
10221027
10231028EsObject * dsl_entry_kind (const tagEntry * entry )
Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ EsObject *dsl_compile_and_eval (EsObject *expr, DSLEnv *env);
9797
9898
9999EsObject * dsl_entry_xget_string (const tagEntry * entry , const char * name );
100+ EsObject * dsl_entry_xget_integer (const tagEntry * entry , const char * name );
100101
101102EsObject * dsl_entry_name (const tagEntry * entry );
102103EsObject * dsl_entry_input (const tagEntry * entry );
You can’t perform that action at this time.
0 commit comments