tamejs icon indicating copy to clipboard operation
tamejs copied to clipboard

Support for .tame.js as an extension

Open m1sta opened this issue 13 years ago • 2 comments

I'd like to use the extension 'tame.js' for my tamejs files, since it will mean that I get automatically detected syntax highlighting everywhere. It doesn't appear to be supported in the current version of tame.

m1sta avatar Aug 22 '12 08:08 m1sta

That is a pretty good idea, and it can be done.

require ('tamejs').register({ extension: ['tame.js']});

jameskeane avatar Sep 12 '12 05:09 jameskeane

Are you saying that it can be done 'in theory' or have you tried it?

I've tried the following without any success...

var tame = require ('tamejs').register({ extension: ['tame.js']});
var playground = require('./playground.tame.js');

I get the following error...

    await { setTimeout (defer (), 100); }
          ^
SyntaxError: Unexpected token {
    at Module._compile (module.js:437:25)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:312:12)
    at Module.require (module.js:362:17)
    at require (module.js:378:17)
    at Object.<anonymous> (C:\...\server.js:5:18)
    at Module._compile (module.js:449:26)
    at Object.Module._extensions..js (module.js:467:10)
    at Module.load (module.js:356:32)

m1sta avatar Sep 18 '12 11:09 m1sta