about summary refs log tree commit diff stats
path: root/html/screen.mu.html
Commit message (Collapse)AuthorAgeFilesLines
* 3951Kartik K. Agaram2017-06-241-10/+10
|
* 3883Kartik K. Agaram2017-05-271-3/+3
|
* 3867Kartik K. Agaram2017-05-191-22/+23
|
* 3855Kartik K. Agaram2017-05-131-9/+9
|
* 3825Kartik K. Agaram2017-04-161-8/+8
|
* 3764 - better colors for cross-linksKartik K. Agaram2017-03-081-3/+4
|
* 3761Kartik K. Agaram2017-03-071-1/+1
|
* 3725Kartik K. Agaram2016-12-271-1/+1
| | | | | | More improvements to cross-linking example programs. Include their own functions as well in the tags for each program, even as you share the core .mu files everywhere.
* 3716Kartik K. Agaram2016-12-261-0/+2
| | | | Make hyperlinks less salient in the rendered html since there's so many of them.
* 3713 - cross-link calls with definitions in htmlKartik K. Agaram2016-12-261-16/+16
|
* 3710Kartik K. Agaram2016-12-261-28/+28
| | | | | Turns out we don't need to explicitly add anchors for each line. Vim's TOhtml has magic for that out of the box.
* 3709 - line numbers in htmlKartik K. Agaram2016-12-261-31/+55
| | | | | | Each line number also gets an anchor name, but I'm not hyperlinking them for now because I don't want to encourage bookmarking these links just yet. They aren't permalinks because every revision may change what's at any given line number.
* 3569Kartik K. Agaram2016-10-231-5/+5
| | | | Update syntax highlighting to not color numeric locations like literals.
* 3431Kartik K. Agaram2016-09-301-1/+1
| | | | | Improvements to syntax highlighting, particularly for Mu code in C++ files.
* 3395Kartik K. Agaram2016-09-171-5/+5
|
* 3219Kartik K. Agaram2016-08-171-2/+1
| | | | | | | | Trying keeping html in the master branch: https://github.com/blog/2228-simpler-github-pages-publishing Let's see if https://akkartik.github.io/mu updates after I push this commit to just the master branch.
* 2812Kartik K. Agaram2016-03-271-7/+16
|
* 2745Kartik K. Agaram2016-03-091-1/+1
|
* 2744Kartik K. Agaram2016-03-091-1/+1
| | | | Tweak colors and font-sizes in generated html.
* 2743Kartik K. Agaram2016-03-091-17/+8
| | | | | Looks like "TOhtml | <other command>" doesn't work on Mac OS X for some reason..
* 2605Kartik K. Agaram2016-01-261-2/+4
|
* 2611Kartik K. Agaram2015-11-291-2/+2
|
* 2177Kartik K. Agaram2015-09-071-21/+22
|
* 2175Kartik K. Agaram2015-09-061-22/+21
|
* 1885Kartik K. Agaram2015-07-291-19/+19
|
* 1853Kartik K. Agaram2015-07-251-1/+1
|
* 1778Kartik K. Agaram2015-07-131-1/+1
|
* 1631 - update html versionsKartik K. Agaram2015-06-231-12/+12
| | | | | | Html is a little more readable thanks to feedback from J David Eisenberg (https://news.ycombinator.com/item?id=9766330), in particular the suggestion to use https://addons.mozilla.org/En-us/firefox/addon/wcag-contrast-checker.
* 1549Kartik K. Agaram2015-06-091-2/+2
|
* 1517Kartik K. Agaram2015-05-301-4/+4
|
* 1471Kartik K. Agaram2015-05-261-1/+1
|
* 1459Kartik K. Agaram2015-05-251-0/+61
for (size_t in = 0; in < inst.ingredients.size(); ++in) { //? cout << "ingredients\n"; //? 2 if (is_raw(inst.ingredients[in])) continue; //? cout << "ingredient " << inst.ingredients[in].name << '\n'; //? 2 if (inst.ingredients[in].name == "default-space") inst.ingredients[in].initialized = true; assert(!inst.ingredients[in].types.empty()); if (inst.ingredients[in].types[0] // not a literal && !inst.ingredients[in].initialized && !is_number(inst.ingredients[in].name)) { if (!already_transformed(inst.ingredients[in], names)) { raise << "use before set: " << inst.ingredients[in].name << " in " << Recipe[r].name << '\n'; } inst.ingredients[in].set_value(lookup_name(inst.ingredients[in], r)); //? cout << "lookup ingredient " << Recipe[r].name << "/" << i << ": " << inst.ingredients[in].to_string() << '\n'; //? 1 } } for (size_t out = 0; out < inst.products.size(); ++out) { //? cout << "products\n"; //? 1 if (is_raw(inst.products[out])) continue; //? cout << "product " << out << '/' << inst.products.size() << " " << inst.products[out].name << '\n'; //? 4 //? cout << inst.products[out].types[0] << '\n'; //? 1 if (inst.products[out].name == "default-space") inst.products[out].initialized = true; if (inst.products[out].types[0] // not a literal && !inst.products[out].initialized && !is_number(inst.products[out].name)) { if (names.find(inst.products[out].name) == names.end()) { trace("name") << "assign " << inst.products[out].name << " " << curr_idx; names[inst.products[out].name] = curr_idx; curr_idx += size_of(inst.products[out]); } inst.products[out].set_value(lookup_name(inst.products[out], r)); //? cout << "lookup product " << Recipe[r].name << "/" << i << ": " << inst.products[out].to_string() << '\n'; //? 1 } } } } bool already_transformed(const reagent& r, const map<string, int>& names) { return names.find(r.name) != names.end(); } size_t lookup_name(const reagent& r, const recipe_number default_recipe) { return Name[default_recipe][r.name]; } type_number skip_addresses(const vector<type_number>& types) { for (size_t i = 0; i < types.size(); ++i) { if (types[i] != Type_number["address"]) return types[i]; } raise << "expected a container" << '\n' << die(); return -1; } int find_element_name(const type_number t, const string& name) { const type_info& container = Type[t]; //? cout << "looking for element " << name << " in type " << container.name << " with " << container.element_names.size() << " elements\n"; //? 1 for (size_t i = 0; i < container.element_names.size(); ++i) { if (container.element_names[i] == name) return i; } raise << "unknown element " << name << " in container " << t << '\n' << die(); return -1; } bool is_raw(const reagent& r) { for (size_t i = /*skip value+type*/1; i < r.properties.size(); ++i) { if (r.properties[i].first == "raw") return true; } return false; } :(scenario convert_names_passes_dummy) # _ is just a dummy result that never gets consumed recipe main [ _, x:integer <- copy 0:literal ] +name: assign x 1 -name: assign _ 1 //: one reserved word that we'll need later :(scenario convert_names_passes_default_space) recipe main [ default-space:integer, x:integer <- copy 0:literal ] +name: assign x 1 -name: assign default-space 1 //: an escape hatch to suppress name conversion that we'll use later :(scenario convert_names_passes_raw) recipe main [ x:integer/raw <- copy 0:literal ] -name: assign x 1 //:: Support element names for containers in 'get' and 'get-address'. //: update our running example container for the next test :(before "End Mu Types Initialization") Type[point].element_names.push_back("x"); Type[point].element_names.push_back("y"); :(scenario convert_names_transforms_container_elements) recipe main [ a:integer <- get 0:point, y:offset b:integer <- get 0:point, x:offset ] +name: element y of type point is at offset 1 +name: element x of type point is at offset 0 :(after "Per-recipe Transforms") // replace element names of containers with offsets if (inst.operation == Recipe_number["get"] || inst.operation == Recipe_number["get-address"]) { // at least 2 args, and second arg is offset assert(inst.ingredients.size() >= 2); //? cout << inst.ingredients[1].to_string() << '\n'; //? 1 assert(isa_literal(inst.ingredients[1])); if (inst.ingredients[1].name.find_first_not_of("0123456789") == string::npos) continue; // since first non-address in base type must be a container, we don't have to canonize type_number base_type = skip_addresses(inst.ingredients[0].types); inst.ingredients[1].set_value(find_element_name(base_type, inst.ingredients[1].name)); trace("name") << "element " << inst.ingredients[1].name << " of type " << Type[base_type].name << " is at offset " << inst.ingredients[1].value; } //: this test is actually illegal so can't call run :(scenarios transform) :(scenario convert_names_handles_containers) recipe main [ a:point <- copy 0:literal b:integer <- copy 0:literal ] +name: assign a 1 +name: assign b 3 //:: Support variant names for exclusive containers in 'maybe-convert'. :(scenarios run) :(scenario maybe_convert_named) recipe main [ 12:integer <- copy 1:literal 13:integer <- copy 35:literal 14:integer <- copy 36:literal 20:address:point <- maybe-convert 12:integer-or-point, p:variant ] +name: variant p of type integer-or-point has tag 1 +mem: storing 13 in location 20 :(after "Per-recipe Transforms") // convert variant names of exclusive containers if (inst.operation == Recipe_number["maybe-convert"]) { // at least 2 args, and second arg is offset assert(inst.ingredients.size() >= 2); assert(isa_literal(inst.ingredients[1])); if (inst.ingredients[1].name.find_first_not_of("0123456789") == string::npos) continue; // since first non-address in base type must be an exclusive container, we don't have to canonize type_number base_type = skip_addresses(inst.ingredients[0].types); inst.ingredients[1].set_value(find_element_name(base_type, inst.ingredients[1].name)); trace("name") << "variant " << inst.ingredients[1].name << " of type " << Type[base_type].name << " has tag " << inst.ingredients[1].value; }