Skip to content

Commit

Permalink
Merge pull request #39 from btwael/underconstruction
Browse files Browse the repository at this point in the history
The new mammouth
  • Loading branch information
btwael committed Aug 25, 2014
2 parents 0a9a0d4 + 81cd35c commit 984b7cb
Show file tree
Hide file tree
Showing 47 changed files with 12,086 additions and 49,837 deletions.
73 changes: 73 additions & 0 deletions Features
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
- [x] Comments
- [x] SingleLine with #
- [x] MultiLine with ### text ###
- [x] Types
- [x] Boolean
- [x] Numbers
- [x] decimal number
- [x] negative number
- [x] octal number
- [x] hexadecimal number
- [x] binary number
- [x] floating point numbers
- [x] Strings
- [x] Heredocs
- [x] Arrays
- [x] null
- [x] Type Juggling (Casting/Converting)
- [x] Variables and Identifiers
- [/] Better scoping and context
- [x] Constants
- [x] If as expression
- [/] Operators
- [x] Arithmetic Operators
- [x] Assignment Operators
- [x] Bitwise Operators
- [x] Comparison Operators
- [ ] Error Control Operators
- [x] Execution Operators
- [x] Incrementing/Decrementing Operators
- [x] Logical Operators
- [x] String Operators
- [x] Type Operators
- [x] Structures
- [x] if
- [x] else
- [x] else if
- [x] while
- [x] do-while
- [x] for
- [x] foreach
- [x] break
- [x] continue
- [x] switch
- [x] declare
- [x] return
- [x] require
- [x] include
- [x] require_once
- [x] include_once
- [x] goto
- [x] echo
- [/] Classes and Objects
- [x] new
- [x] this (and @)
- [x] The Basics
- [x] Properties
- [x] Class Constants
- [x] implements in Autoloading Classes
- [x] Constructors and Destructors
- [x] Visibility
- [x] Object Inheritance
- [x] Scope Resolution Operator (::)
- [x] Static Keyword
- [x] Class Abstraction
- [x] Object Interfaces
- [ ] Traits
- [x] Object Iteration
- [x] Final Keyword
- [x] Object Cloning
- [x] Namespace
- [x] Defining
- [x] Defining with a block
- [x] reference to namespace
22 changes: 0 additions & 22 deletions LICENSE

This file was deleted.

2 changes: 2 additions & 0 deletions Make.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
coffee --compile --output lib/ src/
node generate.js
3 changes: 3 additions & 0 deletions Make.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
coffee --compile --output lib/ src/
node generate.js
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
# Mammouth - Unfancy PHP #
Mammouth is a small language that compiles into PHP, inspired by CoffeeScript. It's compiled to PHP codes/files that you can run in your PHP server.

For documentation, usage, and examples, see:
http://mammouth.wamalaka.com/

To suggest a feature, report a bug, or general discussion:
http://github.com/btwael/mammouth/issues/
DON'T USE THIS VERSION - UNDER-DEV
===================================
29 changes: 13 additions & 16 deletions bin/mammouth
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
#!/usr/bin/env node
var program = require('commander'),
fs = require('fs'),
mammouth = require('../extras/mammouth-nodejs.js'),
mammouth = require('../lib/mammouth.js'),
patch = require('path');
program
.version('0.2.3')
.usage('[options] <file ...>')
.option('-c, --compile', '')
.option('-o, --output [DIR]', 'Write out all compiled PHP files into the specified directory. Use in conjunction with --compile', './');
.version(mammouth.VERSION)
.usage('[options] <file ...>')
.option('-c, --compile', '')
.option('-o, --output [DIR]', 'Write out all compiled PHP files into the specified directory. Use in conjunction with --compile', './');
program.parse(process.argv);
///////////////////////////////////////
var copyFileSync = function(srcFile, destFile) {
// functions
function copyFileSync(srcFile, destFile) {
var BUF_LENGTH, buff, bytesRead, fdr, fdw, pos;
BUF_LENGTH = 64 * 1024;
buff = new Buffer(BUF_LENGTH);
Expand All @@ -25,8 +25,8 @@ var copyFileSync = function(srcFile, destFile) {
}
fs.closeSync(fdr);
return fs.closeSync(fdw);
};
var sharpr = function(path) {
}
function sharpr(path) {
var arr = path.split("\\");
pathr = "";
for (var i = 0; i < arr.length; i++) {
Expand All @@ -37,8 +37,7 @@ var sharpr = function(path) {
}
};
return pathr;
};

}
function bld(path, to) {
var stats = fs.lstatSync(path);
if(stats.isFile()){
Expand All @@ -49,8 +48,7 @@ function bld(path, to) {
fs.readFile(path, 'utf8', function (err, data) {
try {
r = mammouth.compile(data);
fs.writeFile(to + '/' + arr[arr.length-1].split(".")[0] + '.php', r, function () {
});
fs.writeFile(to + '/' + arr[arr.length-1].split(".")[0] + '.php', r, function () {});
} catch(err) {
console.log(err);
}
Expand Down Expand Up @@ -82,9 +80,8 @@ function buildFolder(path, output) {
for (var i = 0; i < ctn.length; i++) {
bld(path + "/" + ctn[i], output);
}
};

/////////////////////////////////
}
// program
if (program.compile) {
for (var i = 0; i < program.args.length; i++) {
path = sharpr(program.args[i]);
Expand Down
60 changes: 0 additions & 60 deletions build.js

This file was deleted.

Loading

0 comments on commit 984b7cb

Please sign in to comment.