From 968866f7ac183811e449b11da9b2a2f1b0d97227 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Sat, 19 Mar 2016 00:51:19 -0700 Subject: 2791 Simplify 2790 by simply not computing any type->value inside parse_type_tree. It now only generates names, and it turns out the consumers handle the absence of values anyway. Now parse_type_tree no longer pollutes the Type_ordinal table with type ingredients. --- 058shape_shifting_recipe.cc | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to '058shape_shifting_recipe.cc') diff --git a/058shape_shifting_recipe.cc b/058shape_shifting_recipe.cc index 26e0eaf6..784b1fd0 100644 --- a/058shape_shifting_recipe.cc +++ b/058shape_shifting_recipe.cc @@ -463,13 +463,8 @@ type_tree* parse_type_tree(istream& in) { in.get(); return NULL; } - if (in.peek() != '(') { - string type_name = next_word(in); - if (!contains_key(Type_ordinal, type_name)) - put(Type_ordinal, type_name, Next_type_ordinal++); - type_tree* result = new type_tree(type_name, get(Type_ordinal, type_name)); - return result; - } + if (in.peek() != '(') + return new type_tree(next_word(in), 0); in.get(); // skip '(' type_tree* result = NULL; type_tree** curr = &result; @@ -479,14 +474,8 @@ type_tree* parse_type_tree(istream& in) { skip_whitespace_but_not_newline(in); if (in.peek() == '(') (*curr)->left = parse_type_tree(in); - else { + else (*curr)->name = next_word(in); - if (!is_type_ingredient_name((*curr)->name)) { - if (!contains_key(Type_ordinal, (*curr)->name)) - put(Type_ordinal, (*curr)->name, Next_type_ordinal++); - (*curr)->value = get(Type_ordinal, (*curr)->name); - } - } curr = &(*curr)->right; } in.get(); // skip ')' -- cgit 1.4.1-2-gfad0 =f75e1d7a7b05c68f03b6b13163ac9f2b8824e7df'>diff stats
path: root/tests/functionaltests/functionaltests.c
blob: 5e8656b714fcda3226d8cbed7b0fd23ceb909314 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114