about summary refs log tree commit diff stats
path: root/wiki/inc/lang/fi/revisions.txt
diff options
context:
space:
mode:
authorahriman <ahriman@falte.red>2018-12-03 18:26:49 -0500
committerahriman <ahriman@falte.red>2018-12-03 18:26:49 -0500
commitf57f6cc5a2d159f90168d292437dc4bd8cd7f934 (patch)
tree3082d675e24e913e63f2f2fd68849734e58e2741 /wiki/inc/lang/fi/revisions.txt
parentf37aa32dd8fc64fe288a7c65afed039c13d5548c (diff)
downloadsite-f57f6cc5a2d159f90168d292437dc4bd8cd7f934.tar.gz
changed formatting and contact info on CoC page
Diffstat (limited to 'wiki/inc/lang/fi/revisions.txt')
0 files changed, 0 insertions, 0 deletions
ipes again take ingredients and reply with results' href='/akkartik/mu/commit/cpp/021call_ingredient?h=main&id=69f04c3fb0136778b80f7f64e16ae37cf8d22907'>69f04c3f ^
57699011 ^
69f04c3f ^
88be3dbc ^
4be9a93b ^



5497090a ^
4be9a93b ^


ca01193d ^
fca0ebbe ^
ac0e9db5 ^
50eab110 ^

69f04c3f ^
012d2ee1 ^
ac0e9db5 ^
012d2ee1 ^
69f04c3f ^
69f04c3f ^
1848b18f ^

69f04c3f ^
363be37f ^
69f04c3f ^

31401373 ^
ac0e9db5 ^
0487a30e ^
31401373 ^
ac0e9db5 ^
0487a30e ^
31401373 ^
69f04c3f ^
4be9a93b ^
0487a30e ^


4be9a93b ^
69f04c3f ^

717ab659 ^
88be3dbc ^
717ab659 ^



5497090a ^
717ab659 ^

5497090a ^
717ab659 ^








363be37f ^
717ab659 ^

31401373 ^
717ab659 ^


88be3dbc ^
717ab659 ^



5497090a ^

717ab659 ^






363be37f ^
717ab659 ^

ab6ed192 ^
ac0e9db5 ^

31401373 ^
0487a30e ^
31401373 ^
ac0e9db5 ^
827898fc ^
31401373 ^
717ab659 ^

ac0e9db5 ^
0487a30e ^

827898fc ^
717ab659 ^



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
                                                                         
                                       
 
                           



             

                                       
 
                              
 
                                   



             
                                 


                              
                           
                                         
                                         

                                
 
                         
                                                       
                                                                               
 
 

                                             
                                        
                                                    

                                                
                                          
                                                                                                                          
                       
                                                                                                                       
                                                                           
                                
                                                                
   
        


                                                                                               
   

        
 
                              



             
                                                    

                                                                  
                                                                       








                                             
                                                          

                                                
                                                                


        
                      



                        

                                                                                    






                                             
                                          

                                                
                                                              

                                                                                                                    
                                                                                        
                       
                                                                                                                       
                                                                           
                                
                                                                

        
                                                   
pre { line-height: 125%; } td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; } td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; } .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .ges { font-weight: bold; font-style: italic } /* Generic.EmphStrong */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
//: Clean syntax to manipulate and check the console in scenarios.
//: Instruction 'assume-console' implicitly creates a variable called
//: 'console' that is accessible inside other 'run' instructions in the
//: scenario. Like with the fake screen, 'assume-console' transparently
//: supports unicode.

:(scenarios run_mu_scenario)
:(scenario keyboard_in_scenario)
scenario keyboard-in-scenario [
  assume-console [
    type [abc]
  ]
  run [
    1:character, console:address, 2:boolean <- read-key console:address
    3:character, console:address, 4:boolean <- read-key console:address
    5:character, console:address, 6:boolean <- read-key console:address
    7:character, console:address, 8:boolean, 9:boolean <- read-key console:address
  ]
  memory-should-contain [
    1 <- 97  # 'a'
    2 <- 1
    3 <- 98  # 'b'
    4 <- 1
    5 <- 99  # 'c'
    6 <- 1
    7 <- 0  # unset
    8 <- 1
    9 <- 1  # end of test events
  ]
]

:(before "End Scenario Globals")
const long long int CONSOLE = Next_predefined_global_for_scenarios++;
:(before "End Special Scenario Variable Names(r)")
Name[r]["console"] = CONSOLE;

//: allow naming just for 'console'
:(before "End is_special_name Cases")
if (s == "console") return true;

//: Unlike assume-keyboard, assume-console is easiest to implement as just a
//: primitive recipe.
:(before "End Primitive Recipe Declarations")
ASSUME_CONSOLE,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["assume-console"] = ASSUME_CONSOLE;
:(before "End Primitive Recipe Implementations")
case ASSUME_CONSOLE: {
//?   cerr << "aaa: " << current_instruction().ingredients.at(0).name << '\n'; //? 2
  // create a temporary recipe just for parsing; it won't contain valid instructions
  istringstream in("[" + current_instruction().ingredients.at(0).name + "]");
  recipe r = slurp_recipe(in);
  long long int num_events = count_events(r);
//?   cerr << "fff: " << num_events << '\n'; //? 3
  // initialize the events
  long long int size = num_events*size_of_event() + /*space for length*/1;
  ensure_space(size);
  long long int event_data_address = Current_routine->alloc;
  Memory[event_data_address] = num_events;
  ++Current_routine->alloc;
  for (long long int i = 0; i < SIZE(r.steps); ++i) {
    const instruction& curr = r.steps.at(i);
    if (curr.name == "left-click") {
      Memory[Current_routine->alloc] = /*tag for 'touch-event' variant of 'event' exclusive-container*/2;
      Memory[Current_routine->alloc+1+/*offset of 'type' in 'mouse-event'*/0] = TB_KEY_MOUSE_LEFT;
      Memory[Current_routine->alloc+1+/*offset of 'row' in 'mouse-event'*/1] = to_integer(curr.ingredients.at(0).name);
      Memory[Current_routine->alloc+1+/*offset of 'column' in 'mouse-event'*/2] = to_integer(curr.ingredients.at(1).name);
//?       cerr << "AA left click: " << Memory[Current_routine->alloc+2] << ' ' << Memory[Current_routine->alloc+3] << '\n'; //? 1
      Current_routine->alloc += size_of_event();
    }
    else if (curr.name == "press") {
      Memory[Current_routine->alloc] = /*tag for 'keycode' variant of 'event' exclusive-container*/1;
      Memory[Current_routine->alloc+1] = to_integer(curr.ingredients.at(0).name);
//?       cerr << "AA press: " << Memory[Current_routine->alloc+1] << '\n'; //? 3
      Current_routine->alloc += size_of_event();
    }
    // End Event Handlers
    else {
      // keyboard input
      assert(curr.name == "type");
      const string& contents = curr.ingredients.at(0).name;
      const char* raw_contents = contents.c_str();
      long long int num_keyboard_events = unicode_length(contents);
      long long int curr = 0;
//?       cerr << "AAA: " << num_keyboard_events << '\n'; //? 1
      for (long long int i = 0; i < num_keyboard_events; ++i) {
        Memory[Current_routine->alloc] = /*tag for 'text' variant of 'event' exclusive-container*/0;
        uint32_t curr_character;
        assert(curr < SIZE(contents));
        tb_utf8_char_to_unicode(&curr_character, &raw_contents[curr]);
//?         cerr << "AA keyboard: " << curr_character << '\n'; //? 3
        Memory[Current_routine->alloc+/*skip exclusive container tag*/1] = curr_character;
        curr += tb_utf8_char_length(raw_contents[curr]);
        Current_routine->alloc += size_of_event();
      }
    }
  }
  assert(Current_routine->alloc == event_data_address+size);
  // wrap the array of events in an event object
  ensure_space(size_of_events());
  Memory[CONSOLE] = Current_routine->alloc;
  Current_routine->alloc += size_of_events();
//?   cerr << "writing " << event_data_address << " to location " << Memory[CONSOLE]+1 << '\n'; //? 1
  Memory[Memory[CONSOLE]+/*offset of 'data' in container 'events'*/1] = event_data_address;
//?   cerr << Memory[Memory[CONSOLE]+1] << '\n'; //? 1
//?   cerr << "alloc now " << Current_routine->alloc << '\n'; //? 1
  break;
}

:(scenario events_in_scenario)
scenario events-in-scenario [
  assume-console [
    type [abc]
    left-click 0, 1
    press 65515  # up arrow
    type [d]
  ]
  run [
    # 3 keyboard events; each event occupies 4 locations
#?     $start-tracing #? 2
    1:event <- read-event console:address
    5:event <- read-event console:address
    9:event <- read-event console:address
    # mouse click
    13:event <- read-event console:address
    # non-character keycode
    17:event <- read-event console:address
    # final keyboard event
    21:event <- read-event console:address
  ]
  memory-should-contain [
    1 <- 0  # 'text'
    2 <- 97  # 'a'
    3 <- 0  # unused
    4 <- 0  # unused
    5 <- 0  # 'text'
    6 <- 98  # 'b'
    7 <- 0  # unused
    8 <- 0  # unused
    9 <- 0  # 'text'
    10 <- 99  # 'c'
    11 <- 0  # unused
    12 <- 0  # unused
    13 <- 2  # 'mouse'
    14 <- 65513  # mouse click
    15 <- 0  # row
    16 <- 1  # column
    17 <- 1  # 'keycode'
    18 <- 65515  # up arrow
    19 <- 0  # unused
    20 <- 0  # unused
    21 <- 0  # 'text'
    22 <- 100  # 'd'
    23 <- 0  # unused
    24 <- 0  # unused
    25 <- 0
  ]
]

//: Deal with special keys and unmatched brackets by allowing each test to
//: independently choose the unicode symbol to denote them.
:(before "End Primitive Recipe Declarations")
REPLACE_IN_CONSOLE,
:(before "End Primitive Recipe Numbers")
Recipe_ordinal["replace-in-console"] = REPLACE_IN_CONSOLE;
:(before "End Primitive Recipe Implementations")
case REPLACE_IN_CONSOLE: {
  assert(scalar(ingredients.at(0)));
//?   cerr << "console: " << Memory[CONSOLE] << '\n'; //? 1
  if (!Memory[CONSOLE])
    raise << "console not initialized\n" << die();
  long long int console_data = Memory[Memory[CONSOLE]+1];
//?   cerr << "console data starts at " << console_data << '\n'; //? 1
  long long int size = Memory[console_data];  // array size
//?   cerr << "size of console data is " << size << '\n'; //? 1
  for (long long int i = 0, curr = console_data+1; i < size; ++i, curr+=size_of_event()) {
//?     cerr << curr << '\n'; //? 1
    if (Memory[curr] != /*text*/0) continue;
    if (Memory[curr+1] != ingredients.at(0).at(0)) continue;
    for (long long int n = 0; n < size_of_event(); ++n)
      Memory[curr+n] = ingredients.at(1).at(n);
  }
  break;
}

:(code)
long long int count_events(const recipe& r) {
  long long int result = 0;
  for (long long int i = 0; i < SIZE(r.steps); ++i) {
    const instruction& curr = r.steps.at(i);
//?     cerr << "aa: " << curr.name << '\n'; //? 3
//?     cerr << "bb: " << curr.ingredients.at(0).name << '\n'; //? 1
    if (curr.name == "type")
      result += unicode_length(curr.ingredients.at(0).name);
    else
      result++;
//?     cerr << "cc: " << result << '\n'; //? 1
  }
  return result;
}

long long int size_of_event() {
  // memoize result if already computed
  static long long int result = 0;
  if (result) return result;
  vector<type_ordinal> type;
  type.push_back(Type_ordinal["event"]);
  result = size_of(type);
  return result;
}

long long int size_of_events() {
  // memoize result if already computed
  static long long int result = 0;
  if (result) return result;
  vector<type_ordinal> type;
  assert(Type_ordinal["console"]);
  type.push_back(Type_ordinal["console"]);
  result = size_of(type);
  return result;
}