summaryrefslogtreecommitdiff
path: root/jam-files/engine/modules/sequence.c
diff options
context:
space:
mode:
authorChris Dyer <cdyer@cs.cmu.edu>2012-10-11 14:06:32 -0400
committerChris Dyer <cdyer@cs.cmu.edu>2012-10-11 14:06:32 -0400
commit07ea7b64b6f85e5798a8068453ed9fd2b97396db (patch)
tree644496a1690d84d82a396bbc1e39160788beb2cd /jam-files/engine/modules/sequence.c
parent37b9e45e5cb29d708f7249dbe0b0fb27685282a0 (diff)
parenta36fcc5d55c1de84ae68c1091ebff2b1c32dc3b7 (diff)
Merge branch 'master' of https://github.com/redpony/cdec
Diffstat (limited to 'jam-files/engine/modules/sequence.c')
-rw-r--r--jam-files/engine/modules/sequence.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/jam-files/engine/modules/sequence.c b/jam-files/engine/modules/sequence.c
deleted file mode 100644
index bda80d94..00000000
--- a/jam-files/engine/modules/sequence.c
+++ /dev/null
@@ -1,42 +0,0 @@
-/* Copyright Vladimir Prus 2003. Distributed under the Boost */
-/* Software License, Version 1.0. (See accompanying */
-/* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */
-
-#include "../native.h"
-
-# ifndef max
-# define max( a,b ) ((a)>(b)?(a):(b))
-# endif
-
-
-LIST *sequence_select_highest_ranked( PARSE *parse, FRAME *frame )
-{
- /* Returns all of 'elements' for which corresponding element in parallel */
- /* list 'rank' is equal to the maximum value in 'rank'. */
-
- LIST* elements = lol_get( frame->args, 0 );
- LIST* rank = lol_get( frame->args, 1 );
-
- LIST* result = 0;
- LIST* tmp;
- int highest_rank = -1;
-
- for (tmp = rank; tmp; tmp = tmp->next)
- highest_rank = max(highest_rank, atoi(tmp->string));
-
- for (; rank; rank = rank->next, elements = elements->next)
- if (atoi(rank->string) == highest_rank)
- result = list_new(result, elements->string);
-
- return result;
-}
-
-void init_sequence()
-{
- {
- char* args[] = { "elements", "*", ":", "rank", "*", 0 };
- declare_native_rule("sequence", "select-highest-ranked", args,
- sequence_select_highest_ranked, 1);
- }
-
-}