Update for language changes regarding unique strings

This commit is contained in:
Patrick Walton 2012-07-12 22:49:01 -07:00
parent 5afae787ce
commit b7b17dccd1
8 changed files with 18 additions and 16 deletions

View file

@ -112,7 +112,7 @@ class Content<S:Sink send copy> {
fn handle_control_msg(control_msg: ControlMsg) -> bool {
alt control_msg {
ParseMsg(filename) {
#debug["content: Received filename `%s` to parse", *filename];
#debug["content: Received filename `%s` to parse", filename];
// Note: we can parse the next document in parallel
// with any previous documents.
@ -131,11 +131,11 @@ class Content<S:Sink send copy> {
}
ExecuteMsg(filename) {
#debug["content: Received filename `%s` to execute", *filename];
#debug["content: Received filename `%s` to execute", filename];
alt read_whole_file(*filename) {
alt read_whole_file(filename) {
err(msg) {
println(#fmt["Error opening %s: %s", *filename, msg]);
println(#fmt["Error opening %s: %s", filename, msg]);
}
ok(bytes) {
let cx = self.jsrt.cx();
@ -143,7 +143,7 @@ class Content<S:Sink send copy> {
cx.set_logging_error_reporter();
cx.new_compartment(global_class).chain(|compartment| {
compartment.define_functions(debug_fns);
cx.evaluate_script(compartment.global_obj, bytes, *filename, 1u)
cx.evaluate_script(compartment.global_obj, bytes, filename, 1u)
});
}
}

View file

@ -36,7 +36,7 @@ class Engine<S:Sink send copy> {
alt request {
LoadURLMsg(url) {
let url = copy url;
if (*url).ends_with(".js") {
if url.ends_with(".js") {
self.content.send(ExecuteMsg(url))
} else {
self.content.send(ParseMsg(url))

View file

@ -223,15 +223,15 @@ fn spawn_css_lexer_task(-filename: ~str) -> port<Token> {
let result_chan = chan(result_port);
task::spawn(|| {
assert (*copy filename).ends_with(".css");
let file_try = io::read_whole_file(*filename);
assert (copy filename).ends_with(".css");
let file_try = io::read_whole_file(filename);
// Check if the given css file existed, if it does, parse it,
// otherwise just send an eof. This is a hack to allow
// guessing that if foo.html exists, foo.css is the
// corresponding stylesheet.
if file_try.is_ok() {
#debug["Lexing css sheet %s", *copy filename];
#debug["Lexing css sheet %s", copy filename];
let file_data = file_try.get();
let reader = io::bytes_reader(file_data);
@ -244,7 +244,7 @@ fn spawn_css_lexer_task(-filename: ~str) -> port<Token> {
if should_break { break; }
}
} else {
#debug["Failed to open css sheet %s", *copy filename];
#debug["Failed to open css sheet %s", copy filename];
result_chan.send(Eof);
}
});

View file

@ -159,7 +159,7 @@ fn build_dom(scope: NodeScope, stream: port<Token>) -> (Node, port<Stylesheet>)
alt elmt.get_attr("href") {
some(filename) {
#debug["Linking to a css sheet named: %s", filename];
style_chan.send(file(~copy filename));
style_chan.send(file(copy filename));
}
none { /* fall through*/ }
}

View file

@ -169,8 +169,8 @@ fn spawn_html_lexer_task(-filename: ~str) -> port<Token> {
task::spawn(|| {
let filename = copy html_file;
assert (copy *filename).ends_with(".html");
let file_data = io::read_whole_file(*filename).get();
assert (copy filename).ends_with(".html");
let file_data = io::read_whole_file(filename).get();
let reader = io::bytes_reader(file_data);
let lexer = lexer(reader, NormalHtml);

View file

@ -69,7 +69,8 @@ fn mainloop(po: port<Msg>) {
let check_for_messages = fn@() {
// Handle messages
#debug("osmain: peeking");
if po.peek() {
let mut i = 0u;
while po.peek() {
alt po.recv() {
AddKeyHandler(key_ch) {
key_handlers.push(key_ch);

View file

@ -15,6 +15,7 @@ use stb_image;
use geom;
use glut;
use layers;
use opengles;
mod dom {
mod base;

View file

@ -40,7 +40,7 @@ fn run_pipeline_screen(urls: ~[str]) {
for urls.each |filename| {
#debug["master: Sending filename `%s`", filename];
engine_chan.send(LoadURLMsg(~copy filename));
engine_chan.send(LoadURLMsg(copy filename));
#debug["master: Waiting for keypress"];
keypress_from_osmain.recv();
}
@ -68,7 +68,7 @@ fn run_pipeline_png(-url: str, outfile: str) {
let engine = Engine(sink);
let engine_chan = engine.start();
let url = copy url;
engine_chan.send(LoadURLMsg(~url));
engine_chan.send(LoadURLMsg(url));
alt buffered_file_writer(outfile) {
ok(writer) {
writer.write(pngdata_from_sink.recv())