Git Product home page Git Product logo

apfel's People

Contributors

jmoody avatar

Stargazers

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

Watchers

 avatar  avatar  avatar

apfel's Issues

Does not handle escaped strings

Like so:

"\".\" Shortcut" = "„.“ Kurzbefehl";

This fails the key value checker:

def key_value_pair?
  !!(/^\s*"([^"]+)"\s*=/.match(content))
end

and results to the key-value output being nil

Does not handle // comments at end of line, and error message does not say which line

RuntimeError because some of my lines didn't end with ";", while Xcode (or whichever Apple tool handles this) doesn't have any problem with it (not even a warning).

I believe that a "//" comment at the end of a line should be considered a comment belonging to the previous pair if on the same line, whereas when it is on a line of its own it should be attached to the following one instead. Personally I only use #to_hash(with_comments:false) but for those who do care about keeping comments, this rule would match how people use "//" in any source code that I know.

Also, error messages should say which line of the file it failed in, and ideally which file too, though for the latter it's easier to trace from one's own program, whereas for the line number I had to edit Apfel's dot_strings_parser.rb to add numbers, e.g.

linenum=0
@read_file.each do |content_line|
  linenum+=1
  current_line = begin Line.new(content_line)
    rescue Exception => e
    throw RuntimeError.new("at line #{linenum}: #{e.message}") end

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.