Git Product home page Git Product logo

haml-rs's Introduction

jhartwell's github stats

haml-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

haml-rs's Issues

Get rid of warnings

There are way too many warnings when compiling. Ideally, there should be none so that needs to be cleaned up.

Add documentation

There needs to be better documentation in the codebase to make it easier to navigate and understand

Add Ruby dictionary syntax for attributes

Currently only the html syntax for attributes is supported but in order to keep up with the standard implementation we should be able to handle Ruby dictionary attributes as well

New Lexer

If you ever come back to this project, I want to note I am starting my own HAML parser and renderer. So far I have only made a new Lexer and have not done the parsing, but it's streamlined and handles both inline and multiline comments so far.

https://github.com/ryankopf/hamlrs

Happy to collaborate for a great, official Rust HAML parser!

Enhance CLI to allow printing abstract syntax tree

The user should be able to get an idea of what the AST will look like when they are converting a Haml file to HTML. This would just show the abstract syntax tree and not actually do the conversion.

Enhance CLI application to allow to process folders

Right now the CLI only takes two arguments: input file and output file. There should be an option to allow the user to supply an input folder and destination folder and the files will be converted to HTML with the original file names and just an HTML extension.

Add Web Assembly support

While the CLI would not be able to be moved to Web Assembly, we could easily move the library to web assembly which would allow us to utilize haml-rs in the browser.

Add variable support

In order to be useful for future projects I want to work on as well as just keeping up with standard implementation variables need to be supported.

Scanner does not properly handle newlines in Windows

When the scanner encounters a \n it will actually create a newline, however, it is allowing \r control characters to get through. This is causing issues with Doctypes since the html generation is looking for 5 but is finding 5\r

Periods cause parsing error "Expecting text value for class name"

If I use this test data:

Sentence. Another sentence.

...with the following as my Rust binary:

#! /usr/bin/env run-cargo-script
//! ```cargo
//! [dependencies]
//! hamlrs = "0.4.1"
//! ```

extern crate haml;

use {
    haml::to_html as haml_to_html,
    std::{
        error::Error,
        io::{
            stdin,
            Read,
        },
    },
};

pub fn main() -> Result<(), Box<Error>> {
    let mut input = String::new();
    stdin().read_to_string(&mut input)?;
    println!("{}", haml_to_html(&input));
    Ok(())
}

...then I get this error with RUST_BACKTRACE=1:

thread 'main' panicked at 'Expecting text value for class name', /home/erich/.cargo/registry/src/github.com-1ecc6299db9ec823/hamlrs-0.4.1/src/parser.rs:90:34
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::print
             at libstd/sys_common/backtrace.rs:71
             at libstd/sys_common/backtrace.rs:59
   2: std::panicking::default_hook::{{closure}}
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:511
   5: std::panicking::begin_panic
   6: haml::parser::Parser::parse
   7: haml::to_html
   8: compile::main
   9: std::rt::lang_start::{{closure}}
  10: std::panicking::try::do_call
             at libstd/rt.rs:59
             at libstd/panicking.rs:310
  11: __rust_maybe_catch_panic
             at libpanic_unwind/lib.rs:105
  12: std::rt::lang_start_internal
             at libstd/panicking.rs:289
             at libstd/panic.rs:392
             at libstd/rt.rs:58
  13: main
  14: __libc_start_main
  15: _start

The output of rustup show is:

active toolchain
----------------

stable-x86_64-unknown-linux-gnu (default)
rustc 1.28.0 (9634041f0 2018-07-30)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.