summary refs log tree commit diff stats
path: root/config
Commit message (Expand)AuthorAgeFilesLines
* Add delete to the default binds.confDrew DeVault2019-06-021-0/+1
* Add :save and :pipe commands to viewerGalen Abell2019-05-271-0/+1
* Implement :edit in compose screenDrew DeVault2019-05-261-0/+1
* Subsitute prefix in aerc.conf for installDrew DeVault2019-05-261-3/+3
* binds.conf: make reply -a easier to use than replyDrew DeVault2019-05-251-4/+4
* Change ex command to C-x when using terminalDrew DeVault2019-05-241-2/+2
* Bind :compose to C in binds.confFrancis Dinh2019-05-231-0/+2
* Install default configs to XDG config if not foundDrew DeVault2019-05-221-4/+34
* Show account wizard if no accounts configuredDrew DeVault2019-05-221-6/+3
* New account wizard, part oneDrew DeVault2019-05-211-0/+9
* Use kebab-case for cred-cmdsDrew DeVault2019-05-211-2/+2
* Implement :next-part, :prev-partDrew DeVault2019-05-201-0/+2
* Rename :delete-message et al to :delete et alDrew DeVault2019-05-191-14/+14
* Implement loading passwords from external commandsGalen Abell2019-05-181-8/+61
* Install filters to /usr/share/aerc/filtersDrew DeVault2019-05-171-3/+3
* Remove unimplemented color configurationDrew DeVault2019-05-171-42/+0
* Implement ui.empty-message config optionDrew DeVault2019-05-172-17/+0
* Abort if accounts.conf is world readableReto Brunner2019-05-161-1/+26
* Revert "Abort if accounts.conf is world readable"Drew DeVault2019-05-161-25/+1
* Revert "s/aerc.conf/address.conf/ in permission check"Drew DeVault2019-05-161-1/+1
* s/aerc.conf/address.conf/ in permission checkCole Helbling2019-05-161-1/+1
* Abort if accounts.conf is world readableReto Brunner2019-05-161-1/+25
* Change default bindings for repliesDrew DeVault2019-05-161-4/+4
* Change default reply keybindingsDrew DeVault2019-05-161-8/+8
* Copy sent emails to the Sent folderDrew DeVault2019-05-152-0/+4
* Fix default bindings for quit and editDrew DeVault2019-05-141-1/+4
* Move ! bind to [messages]Drew DeVault2019-05-141-1/+1
* Add (non-functional) reply commands to bindingsDrew DeVault2019-05-141-2/+9
* Add ! to default keybindingsDrew DeVault2019-05-141-0/+1
* Add $EDITOR, internal config for composeDrew DeVault2019-05-142-0/+17
* Add distinct keybindings for each compose viewDrew DeVault2019-05-143-11/+31
* Populate "From" header from config for new emailsDrew DeVault2019-05-132-0/+5
* Add outgoing account configurationDrew DeVault2019-05-122-5/+10
* Add initial compose widgetDrew DeVault2019-05-121-0/+8
* Use better regex for identifying patchesDrew DeVault2019-03-311-1/+1
* Remove show-headers config optionDrew DeVault2019-03-311-6/+0
* Remove unused config optionsDrew DeVault2019-03-311-6/+0
* Remove key bindings from aerc.confDrew DeVault2019-03-311-46/+0
* Add script for sandboxing w3mDrew DeVault2019-03-311-1/+1
* Use shell to execute filters, fix non-determinismDrew DeVault2019-03-311-1/+2
* Improve plaintext.pyDrew DeVault2019-03-311-1/+0
* Implement header-regex-match filtersDrew DeVault2019-03-312-7/+21
* Add basic filter implementationDrew DeVault2019-03-312-25/+67
* Add message view commands, :closeDrew DeVault2019-03-301-1/+1
* Update default config/binds.confDrew DeVault2019-03-301-2/+17
* Handle no configured accounts gracefullyJulian P Samaroo2019-03-301-0/+4
* Rig up terminal keybinding groupDrew DeVault2019-03-211-0/+1
* Add context-specific keybindingsDrew DeVault2019-03-213-12/+114
* Add additional context to key binding setDrew DeVault2019-03-211-4/+14
* Handle terminal title, login shellDrew DeVault2019-03-171-1/+1
1b2e6c7ce94c986fe7888a60f0e1ba24a05ce9'>201b2e6c ^
d855b0a0 ^
2b250717 ^
e4630643 ^

23d3a022 ^
2b250717 ^
e4630643 ^

4f5bb5b6 ^
2b250717 ^
e4630643 ^

f7d3dc0e ^



4f5bb5b6 ^
d855b0a0 ^



dc1323e9 ^
23d3a022 ^
c442a5ad ^
201b2e6c ^

1066660e ^
c442a5ad ^
59874868 ^



201b2e6c ^

4a943d4e ^














201b2e6c ^
4a943d4e ^













201b2e6c ^
4a943d4e ^














23d3a022 ^
1848b18f ^

201b2e6c ^
795f5244 ^
d855b0a0 ^
201b2e6c ^
d855b0a0 ^
2b250717 ^
e4630643 ^

23d3a022 ^
2b250717 ^
e4630643 ^

4f5bb5b6 ^
2b250717 ^
e4630643 ^

f7d3dc0e ^



4f5bb5b6 ^
d855b0a0 ^



dc1323e9 ^
23d3a022 ^
c442a5ad ^
201b2e6c ^

1066660e ^
c442a5ad ^
59874868 ^



201b2e6c ^

4a943d4e ^














201b2e6c ^
4a943d4e ^













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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
                   
 












                                                                              
 
                                             
     
                                        
                                  
                                       
            
                                    
                                                                                                                               

          
                                            
                                                                                                                                                                                                                                                                           

          



                                                                                              



                                                
                                                              
                                                    
                                                                                                



                                           

 

                                          
                               
 















                                          
 










                                                            
 

                                             
                                        
                                        
                                       
               
                                    
                                                                                                                                

          
                                                                                        
                                                                                                                                                                                                                                                                       

          
                                            
                                                                                                                                                                                                                                                                                

          



                                                                                                 
                       



                                                
                                                              
                                           
                                                                       

          
                                                    
                                                                                                



                                           

 














                                                                                
 













                                                         
 














                                                                                
 

                                             
                                        
                                                
                                       
                   
                                    
                                                                                                                                

          
                                                                                        
                                                                                                                                                                                                                                                                       

          
                                            
                                                                                                                                                                                                                                                                                

          



                                                                                              
                           



                                                
                                                              
                                          
                                                                           

          
                                                    
                                                                                                



                                           

 














                                                                                
 













                                                              
//: Jump primitives

void test_jump_can_skip_instructions() {
  run(
      "def main [\n"
      "  jump 1:offset\n"
      "  1:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump {1: \"offset\"}\n"
  );
  CHECK_TRACE_DOESNT_CONTAIN("run: {1: \"number\"} <- copy {1: \"literal\"}");
  CHECK_TRACE_DOESNT_CONTAIN("mem: storing 1 in location 1");
}

:(before "End Primitive Recipe Declarations")
JUMP,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "jump", JUMP);
:(before "End Primitive Recipe Checks")
case JUMP: {
  if (SIZE(inst.ingredients) != 1) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' should get exactly one ingredient\n" << end();
    break;
  }
  if (!is_literal(inst.ingredients.at(0))) {
    raise << maybe(get(Recipe, r).name) << "first ingredient of '" << to_original_string(inst) << "' should be a label or offset, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
    break;
  }
  if (!inst.products.empty()) {
    raise << maybe(get(Recipe, r).name) << "'jump' instructions write no products\n" << end();
    break;
  }
  break;
}
:(before "End Primitive Recipe Implementations")
case JUMP: {
  assert(current_instruction().ingredients.at(0).initialized);
  current_step_index() += ingredients.at(0).at(0)+1;
  trace(Callstack_depth+1, "run") << "jumping to instruction " << current_step_index() << end();
  // skip rest of this instruction
  write_products = false;
  fall_through_to_next_instruction = false;
  break;
}

//: special type to designate jump targets
:(before "End Mu Types Initialization")
put(Type_ordinal, "offset", 0);

:(code)
void test_jump_backward() {
  run(
      "def main [\n"
      "  jump 1:offset\n"  // 0 -+
      "  jump 3:offset\n"  //    |   +-+ 1
                           //   \/  /\ |
      "  jump -2:offset\n" //  2 +-->+ |
      "]\n"                //         \/ 3
  );
  CHECK_TRACE_CONTENTS(
      "run: jump {1: \"offset\"}\n"
      "run: jump {-2: \"offset\"}\n"
      "run: jump {3: \"offset\"}\n"
  );
}

void test_jump_takes_no_products() {
  Hide_errors = true;
  run(
      "def main [\n"
      "  1:num <- jump 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "error: main: 'jump' instructions write no products\n"
  );
}

:(before "End Primitive Recipe Declarations")
JUMP_IF,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "jump-if", JUMP_IF);
:(before "End Primitive Recipe Checks")
case JUMP_IF: {
  if (SIZE(inst.ingredients) != 2) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' should get exactly two ingredients\n" << end();
    break;
  }
  if (!is_mu_address(inst.ingredients.at(0)) && !is_mu_scalar(inst.ingredients.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' requires a boolean for its first ingredient, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
    break;
  }
  if (!is_literal(inst.ingredients.at(1))) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' requires a label or offset for its second ingredient, but '" << inst.ingredients.at(1).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(1).type) << "'\n" << end();
    break;
  }
  if (!inst.products.empty()) {
    raise << maybe(get(Recipe, r).name) << "'jump-if' instructions write no products\n" << end();
    break;
  }
  // End JUMP_IF Checks
  break;
}
:(before "End Primitive Recipe Implementations")
case JUMP_IF: {
  assert(current_instruction().ingredients.at(1).initialized);
  if (!scalar_ingredient(ingredients, 0)) {
    trace(Callstack_depth+1, "run") << "jump-if fell through" << end();
    break;
  }
  current_step_index() += ingredients.at(1).at(0)+1;
  trace(Callstack_depth+1, "run") << "jumping to instruction " << current_step_index() << end();
  // skip rest of this instruction
  write_products = false;
  fall_through_to_next_instruction = false;
  break;
}

:(code)
void test_jump_if() {
  run(
      "def main [\n"
      "  jump-if 999, 1:offset\n"
      "  123:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump-if {999: \"literal\"}, {1: \"offset\"}\n"
      "run: jumping to instruction 2\n"
  );
  CHECK_TRACE_DOESNT_CONTAIN("run: {123: \"number\"} <- copy {1: \"literal\"}");
  CHECK_TRACE_DOESNT_CONTAIN("mem: storing 1 in location 123");
}

void test_jump_if_fallthrough() {
  run(
      "def main [\n"
      "  jump-if 0, 1:offset\n"
      "  123:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump-if {0: \"literal\"}, {1: \"offset\"}\n"
      "run: jump-if fell through\n"
      "run: {123: \"number\"} <- copy {1: \"literal\"}\n"
      "mem: storing 1 in location 123\n"
  );
}

void test_jump_if_on_address() {
  run(
      "def main [\n"
      "  10:num/alloc-id, 11:num <- copy 0, 999\n"
      "  jump-if 10:&:number, 1:offset\n"
      "  123:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump-if {10: (\"address\" \"number\")}, {1: \"offset\"}\n"
      "run: jumping to instruction 3\n"
  );
  CHECK_TRACE_DOESNT_CONTAIN("run: {123: \"number\"} <- copy {1: \"literal\"}");
  CHECK_TRACE_DOESNT_CONTAIN("mem: storing 1 in location 123");
}

:(before "End Primitive Recipe Declarations")
JUMP_UNLESS,
:(before "End Primitive Recipe Numbers")
put(Recipe_ordinal, "jump-unless", JUMP_UNLESS);
:(before "End Primitive Recipe Checks")
case JUMP_UNLESS: {
  if (SIZE(inst.ingredients) != 2) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' should get exactly two ingredients\n" << end();
    break;
  }
  if (!is_mu_address(inst.ingredients.at(0)) && !is_mu_scalar(inst.ingredients.at(0))) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' requires a boolean for its first ingredient, but '" << inst.ingredients.at(0).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(0).type) << "'\n" << end();
    break;
  }
  if (!is_literal(inst.ingredients.at(1))) {
    raise << maybe(get(Recipe, r).name) << "'" << to_original_string(inst) << "' requires a label or offset for its second ingredient, but '" << inst.ingredients.at(1).name << "' has type '" << names_to_string_without_quotes(inst.ingredients.at(1).type) << "'\n" << end();
    break;
  }
  if (!inst.products.empty()) {
    raise << maybe(get(Recipe, r).name) << "'jump' instructions write no products\n" << end();
    break;
  }
  // End JUMP_UNLESS Checks
  break;
}
:(before "End Primitive Recipe Implementations")
case JUMP_UNLESS: {
  assert(current_instruction().ingredients.at(1).initialized);
  if (scalar_ingredient(ingredients, 0)) {
    trace(Callstack_depth+1, "run") << "jump-unless fell through" << end();
    break;
  }
  current_step_index() += ingredients.at(1).at(0)+1;
  trace(Callstack_depth+1, "run") << "jumping to instruction " << current_step_index() << end();
  // skip rest of this instruction
  write_products = false;
  fall_through_to_next_instruction = false;
  break;
}

:(code)
void test_jump_unless() {
  run(
      "def main [\n"
      "  jump-unless 0, 1:offset\n"
      "  123:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump-unless {0: \"literal\"}, {1: \"offset\"}\n"
      "run: jumping to instruction 2\n"
  );
  CHECK_TRACE_DOESNT_CONTAIN("run: {123: \"number\"} <- copy {1: \"literal\"}");
  CHECK_TRACE_DOESNT_CONTAIN("mem: storing 1 in location 123");
}

void test_jump_unless_fallthrough() {
  run(
      "def main [\n"
      "  jump-unless 999, 1:offset\n"
      "  123:num <- copy 1\n"
      "]\n"
  );
  CHECK_TRACE_CONTENTS(
      "run: jump-unless {999: \"literal\"}, {1: \"offset\"}\n"
      "run: jump-unless fell through\n"
      "run: {123: \"number\"} <- copy {1: \"literal\"}\n"
      "mem: storing 1 in location 123\n"
  );
}