Giter Site home page Giter Site logo

muddler's People

Contributors

jcjolley avatar jieverson avatar mister4eyes avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

mister4eyes

muddler's Issues

--skip-tests breaks muddling

It doesn't matter whether tests exist, but when using --skip-tests muddling simply terminates after it has generated the .temp.js file.

> muddle harvest.js --skip-tests --out-file harvest_mud.js
Muddling harvest.js
> 
> muddle harvest.js --out-file harvest_mud.js             
Muddling harvest.js
Success - harvest_mud_mud.js
> 

Encoding issue when muddling

There seems to be an encoding issue with special characters. See below for the original and muddled versions.

var corruptRegex = /`\w[¡¢£¤¥¦§¨©ª]`/g
l=/`\w[\u00a1\u00a2\u00a3\u00a4\u00a5\u00a6\u00a7\u00a8\u00a9\u00aa]`/g

I'm assuming it's just not handling utf-8 encoding/decoding properly?


EDIT: I guess it's more of a problem specific to hackmud, now that I think about it. The output from hackmud is as follows:

{retval:"PARSE ERROR my.script (line 0 char 261): cannot use \\u00XX or \\u{00XX} unicode identifiers in ascii range in scripts. Please use hex escape (\\xXX)",success:false}

How to avoid muddling scriptors?

I couldn't find anything regarding this (unless I didn't look hard enough), but is there a way to script muddling scriptors and calls to them?

Below is an example of what currently happens.

var d = #fs.dtr.lib()
var m = d.pp(args)

becomes

var g=#fs.h.lib()
var j=g.l(b)

Special script commands result in a parse error

When I try to use stuff like #D, #FMCL or #G in my script, muddler throws out:

Muddling C:\Users\uname\AppData\Roaming\hackmud\gname\scripts\crack.js

==========================================
C:/Users/uname/AppData/Roaming/hackmud/gname/scripts/crack.temp.js:14: ERROR - Parse error. '}' expected
            #D("EZ_21")
            ^

1 error(s), 0 warning(s)
==========================================

This is what the code looks like:

if(l.includes('EZ_21')) {
    #D("EZ_21")
    for(var i=0;i<EZ.length;++i) {
        g["ez_21"]=EZ[i]
        c()
        if(!f.includes('LOCK_ERROR')){
            #D("Cracked")
            l_num = l_num + 1  
            break
        }
    }
}

(Yes, it's a lock cracker)

Issues running on macOS due to line endings

Running muddler produces this error:

env: node\r: No such file or directory

This is due to /usr/local/bin/muddle (or muddle.js) having line endings in the DOS format. A similar issue can be seen here.

The fix is to simply convert the line endings from DOS to unix, at which point it should be compatible across all platforms.

A long term solution to this might be a simple as adding a .gitattributes file that does the formatting on it's own, as seen here.

--test-dir doesn't appear to be working

Full command/parameters I'm using right now:

muddle --watch-dir ~/.config/hackmud/scripts_dev --test-dir ~/.config/hackmud/scripts_dev/tests --out-dir ~/.config/hackmud/user/scripts

This seems to script tests (named script.test.js) in scripts_dev/tests, but works fine if I move the tests to the same directory where the scripts themselves are, so it's almost like it's not taking --test-dir in to account at all?

If I'm doing something wrong here, let me know, since I'm still struggling trying to get even a simple test to run. :)

Probably not related, but I can't seem to get any further than this when testing:

function (context, args) {
         ^
SyntaxError: Unexpected token (

EDIT: Not sure if it matters, but I don't use TypeScript at all, just JavaScript.

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.