Skip to content

Commit

Permalink
Change README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
silverreve23 committed Feb 28, 2018
1 parent 1db9191 commit f008b9d
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 38 deletions.
90 changes: 54 additions & 36 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,80 +8,98 @@
This package is for those who like beautiful, orderly and easily program code!
</p>

### API

Class patterns:

* @php => <?php
* @class => class
* @extends => extends
* @implements => implements
* @var[+/-/.] => [public/private/protected] variable
* @vars[+/-/.] => [public/private/protected] static variable
* @def[+/-/.] => [public/private/protected] function
* @defs[+/-/.] => [public/private/protected] static function

Construction patterns:

* @foreach => foreach
* @if => if
* @end => close construction

### Example:

#### Source In
##### This package in developer mode!!
Source in:

```
```php

@php

@class Test
namespace App\Http\Controllers;

@var+ $testPublic = array();
@var- $testPrivate = 20;
@var. $testProtected = 'test';
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Classes\Contracts\ReplacerInterface;

@var(static). $testStatic = 'static';
@class TestController

@def+ test()
@extends MainController
@implements ReplacerInterface

@foreach(@this.test as $key => $val)
use Request;

echo $key.$val;
@vars. $staticVar = 'TEST';

@end
@def+ __construct()

@end
parent::__construct();

@def(static)- staticTest($test)
@end

@if($test)
@defs+ testFunction($params)

return true;
return true;

@end
@end
@end

@end

```

#### Source Out
Source out:

```php

<?php

class Test{

public $testPublic = array();
private $testPrivate = 20;
protected $testProtected = 'test';
namespace App\Http\Controllers;

protected static $testStatic = 'static';
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\DB;
use App\Classes\Contracts\ReplacerInterface;

public function test(){
class TestController

foreach($this->test as $key => $val){
extends MainController
implements ReplacerInterface{

echo $key.$val;
use Request;

}
protected static $staticVar = 'TEST';

}
public function __construct(){

private static function staticTest($test){
parent::__construct();

if($test){
}

return true;
public static function testFunction($params){

}
return true;

}
}

}

Expand Down
4 changes: 2 additions & 2 deletions system/processor.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ function parseFile($filePath){
});

// Pares [variable] word
line = line.replace(/\@var(\(static\))?\s{0,}([\+|\-|\.]){0,}[$|\w|\s|,|=]{1,}/, function(findedStr, static, access){
line = line.replace(/\@var(s)?\s{0,}([\+|\-|\.]){0,}[$|\w|\s|,|=]{1,}/, function(findedStr, static, access){

if(static)
return accesseVals[access] + ' static ' + findedStr.substr(14);
return accesseVals[access] + ' static ' + findedStr.substr(7);

return accesseVals[access] + findedStr.substr(5);

Expand Down

0 comments on commit f008b9d

Please sign in to comment.