Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compile error for simple haml #60

Closed
antonkulaga opened this issue Mar 16, 2013 · 2 comments
Closed

Compile error for simple haml #60

antonkulaga opened this issue Mar 16, 2013 · 2 comments

Comments

@antonkulaga
Copy link

I tested it with simple haml:

%html
%body
%h1
This is a test file for learning HAML!

And here is what I got:

antonkulaga@antonkulaga-home ~/denigma/semanticchat/public/semantictasks $ haml-coffee -i test.haml
[Haml Coffee] Compiling file test.haml to test.jst
#{ red }[haml coffee] CoffeeScript compilation error:#{ reset } TypeError: Object function () {
switch (this.options.placement) {
case 'amd':
return this.renderAmd();
case 'standalone':
return this.renderStandalone();
default:
return this.renderGlobal();
}
} has no method 'charCodeAt'
TypeError: Object function () {
switch (this.options.placement) {
case 'amd':
return this.renderAmd();
case 'standalone':
return this.renderStandalone();
default:
return this.renderGlobal();
}
} has no method 'charCodeAt'
at Lexer.exports.Lexer.Lexer.clean (/usr/local/lib/node_modules/haml-coffee/node_modules/coffee-script/lib/coffee-script/lexer.js:47:16)
at Lexer.exports.Lexer.Lexer.tokenize (/usr/local/lib/node_modules/haml-coffee/node_modules/coffee-script/lib/coffee-script/lexer.js:28:19)
at Object.exports.compile.compile (/usr/local/lib/node_modules/haml-coffee/node_modules/coffee-script/lib/coffee-script/coffee-script.js:54:39)
at Function.module.exports.CoffeeMaker.compileFile (/usr/local/lib/node_modules/haml-coffee/src/cli/coffee-maker.coffee:56:31)
at exports.run.source (/usr/local/lib/node_modules/haml-coffee/src/cli/command.coffee:141:58)
at Object.oncomplete (fs.js:297:15)

@netzpirat
Copy link
Owner

Seems a problem only when compiling on the CLI from a file. I'll have a look over the weekend. Meanwhile you can either experiment with the online version or compile directly from STDIN:

$ haml-coffee                                                                                               2.0.0-p0 1↵
Please enter template source code and press Ctrl-D to generate:

%html
%body
%h1
This is a test file for learning HAML!
^D

(function() {
  var _ref;

  if ((_ref = window.HAML) == null) {
    window.HAML = {};
  }

  window.HAML['test'] = function(context) {
    return (function() {
      var $o;
      $o = [];
      $o.push("<html></html>\n<body></body>\n<h1></h1>\nThis is a test file for learning HAML!");
      return $o.join("\n");
    }).call(context);
  };

}).call(this);

Thanks for reporting.

@netzpirat
Copy link
Owner

Version 1.10.2 is released that fixes the issue. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants