mbrubeck / robinson Goto Github PK
View Code? Open in Web Editor NEWA toy web rendering engine
Home Page: http://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html
License: MIT License
A toy web rendering engine
Home Page: http://limpet.net/mbrubeck/2014/08/08/toy-layout-engine-1.html
License: MIT License
This will cause a problem when you have comma-separated selectors
I haven't actually tested this but my Scala implementation has this problem.
Using bebcebc and running make
with rustc 0.12.0-nightly (dc987adfc 2014-10-04 23:42:07 +0000)
, the following error occurs:
src/css.rs:185:16: 185:18 error: expected `=>`, found `..`
src/css.rs:185 '0'..'9' => self.parse_length(),
[censored]>cargo run --release
Finished release [optimized] target(s) in 0.12s
Running [censored]\robinson-master\robinson-master\target\rel ease\robinson.exe
thread 'main' panicked at 'called Result::unwrap()
on an Err
value: Os { cod
e: 3, kind: NotFound, message: "The system cannot find the path specified." }',
libcore\result.rs:945:5
note: Run with RUST_BACKTRACE=1
for a backtrace.
error: process didn't exit successfully: [censored]\robinson-maste r\robinson-master\target\release\robinson.exe
(exit code: 101)
Line 33 in 474a2b4
FIXME
I wish I had written below. :(
1-) If either c was written in c ++ or python. now i will learn rust but i get
2-) I would like to add a screenshot or Intro video
I have rustc 0.11.0
installed and I get this output from make
:
src/dom.rs:47:5: 49:6 note: consider using an explicit lifetime parameter as shown: fn get_attribute<'a>(&'a self, key: &str) -> Option<&'a String>
src/dom.rs:47 pub fn get_attribute(&self, key: &str) -> Option<&String> {
src/dom.rs:48 self.attributes.find_equiv(&key)
src/dom.rs:49 }
src/dom.rs:48:9: 48:41 error: cannot infer an appropriate lifetime for autoref due to conflicting requirements
src/dom.rs:48 self.attributes.find_equiv(&key)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/layout.rs:48:5: 54:6 note: consider using an explicit lifetime parameter as shown: fn new<'b>(box_type: BoxType<'b>) -> LayoutBox<'b>
src/layout.rs:48 fn new(box_type: BoxType) -> LayoutBox {
src/layout.rs:49 LayoutBox {
src/layout.rs:50 box_type: box_type,
src/layout.rs:51 dimensions: Default::default(),
src/layout.rs:52 children: Vec::new(),
src/layout.rs:53 }
...
src/layout.rs:49:9: 53:10 error: cannot infer an appropriate lifetime for lifetime parameter `'a due to conflicting requirements
src/layout.rs:49 LayoutBox {
src/layout.rs:50 box_type: box_type,
src/layout.rs:51 dimensions: Default::default(),
src/layout.rs:52 children: Vec::new(),
src/layout.rs:53 }
src/layout.rs:244:5: 257:6 note: consider using an explicit lifetime parameter as shown: fn get_inline_container<'b>(&'b mut self) -> &'b mut LayoutBox<'a>
src/layout.rs:244 fn get_inline_container(&mut self) -> &mut LayoutBox<'a> {
src/layout.rs:245 match self.box_type {
src/layout.rs:246 InlineNode(_) | AnonymousBlock => self,
src/layout.rs:247 BlockNode(_) => {
src/layout.rs:248 // If we've just generated an anonymous block box, keep using it.
src/layout.rs:249 // Otherwise, create a new one.
...
src/layout.rs:254:17: 254:41 error: cannot infer an appropriate lifetime for autoref due to conflicting requirements
src/layout.rs:254 self.children.mut_last().unwrap()
^~~~~~~~~~~~~~~~~~~~~~~~
src/main.rs:22:27: 22:38 error: type `getopts::Fail_` does not implement any method in scope named `to_string`
src/main.rs:22 Err(f) => fail!(f.to_string())
^~~~~~~~~~~
src/main.rs:31:38: 31:54 error: type `core::result::Result<std::io::fs::File,std::io::IoError>` does not implement any method in scope named `read_to_string`
src/main.rs:31 File::open(&Path::new(path)).read_to_string().unwrap()
^~~~~~~~~~~~~~~~
error: aborting due to 5 previous errors
Makefile:249: recipe for target 'bin/main' failed
make: *** [bin/main] Error 101
I would try to debug, but I'm trying to learn Rust and browser engines so it's all new to me.
Rust Version | Cargo Version |
---|---|
rustc 1.0.0-nightly (458a6a2f6 2015-01-25 21:20:37 +0000) | cargo 0.0.1-pre-nightly (bb28e71 2015-01-22 06:06:34 +0000) |
I'm getting this error when running cargo build:
Compiling rustc-serialize v0.2.7
Compiling getopts v0.1.4
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/base64.rs:207:5: 209:6 error: method `detail` is not a member of trait `error::Error`
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/base64.rs:207 fn detail(&self) -> Option<String> {
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/base64.rs:208 Some(format!("{:?}", self))
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/base64.rs:209 }
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/hex.rs:91:5: 93:6 error: method `detail` is not a member of trait `error::Error`
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/hex.rs:91 fn detail(&self) -> Option<String> {
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/hex.rs:92 Some(format!("{:?}", self))
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/hex.rs:93 }
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/json.rs:336:5: 336:84 error: method `detail` is not a member of trait `std::error::Error`
/home/bsve/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-serialize-0.2.7/src/json.rs:336 fn detail(&self) -> Option<std::string::String> { Some(format!("{:?}", self)) }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 3 previous errors
Build failed, waiting for other jobs to finish...
Could not compile `rustc-serialize`.
To learn more, run the command again with --verbose
I'm sorry if this issue does not belong here as it seems to be an dependency issue.
However, I tried to clone rustc-serialize (albeit v0.2.9) and built it without any errors.
This will make the already very educational code more readable.
Please tag this issue as 'Hacktoberfest' ๐
Thanks so much for your "Let's build a browser engine!" series. Really cool.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.