Skip to content

Commit

Permalink
Documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Sameh Fakoua committed Jun 16, 2019
1 parent c92fb98 commit 743bd0f
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
34 changes: 33 additions & 1 deletion labiba-parser/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,30 @@
# Labiba Parser

> The Labiba parser
> Labiba Arabic Programing Language Parser
For working IDE see our repository: [labiba](https://github.com/fakoua/labiba)

Labiba Parser generates AST according to babel AST format

## Example:
```sh
import {parse} from 'labiba-parser';

let labibaCode =`
//Comment
متغير سامح = 1;
مهمة مثل() {
ارجاع 'مرحبا';
}
مثل()
`

let ast = parse(labibaCode)

console.log(ast)

```

## Install

Expand All @@ -15,3 +39,11 @@ or using yarn:
```sh
yarn add labiba-parser --dev
```

## Build

```sh
yarn install
gulp build
```

2 changes: 1 addition & 1 deletion labiba-parser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "labiba-parser",
"version": "0.0.6",
"version": "0.0.7",
"description": "The Labiba parser",
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
"homepage": "https://github.com/fakoua/labiba",
Expand Down
43 changes: 41 additions & 2 deletions labiba-transformer/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,56 @@
# Labiba Transformer

> The Labiba Transformer
> Transform Labiba Syntax into JavaScript
For working IDE see our repository: [labiba](https://github.com/fakoua/labiba)

## Example:
```sh
const labiba = require('labiba-transformer')

let labibaCode =`
//Comment
متغير سامح = 1;
مهمة مثل() {
ارجاع 'مرحبا';
}
مثل()
`
let code = labiba.transform(labibaCode);

console.log(code)

------------
output:
//Comment

var سامح = 1;

function مثل() {
return 'مرحبا';
}

مثل();

```

## Install

Using npm:

```sh
npm install --save-dev labiba-transformer
npm install labiba-transformer --save-dev
```

or using yarn:

```sh
yarn add labiba-transformer --dev
```

## Build
```sh
yarn install
yarn build
```
8 changes: 7 additions & 1 deletion labiba-transformer/dist/test.js
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
"use strict";
"use strict";

var labiba = require('./index');

var labibaCode = "\n//Comment\n\u0645\u062A\u063A\u064A\u0631 \u0633\u0627\u0645\u062D = 1;\n\u0645\u0647\u0645\u0629 \u0645\u062B\u0644() {\n \u0627\u0631\u062C\u0627\u0639 '\u0645\u0631\u062D\u0628\u0627';\n}\n\n\u0645\u062B\u0644()\n";
var code = labiba.transform(labibaCode);
console.log(code);
2 changes: 1 addition & 1 deletion labiba-transformer/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "labiba-transformer",
"version": "0.0.7",
"version": "0.0.8",
"description": "Labiba Transformer",
"author": "Sameh Fakoua <s.fakoua@gmail.com>",
"homepage": "https://github.com/fakoua/labiba",
Expand Down
14 changes: 14 additions & 0 deletions labiba-transformer/src/test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const labiba = require('./index')

let labibaCode =`
//Comment
متغير سامح = 1;
مهمة مثل() {
ارجاع 'مرحبا';
}
مثل()
`
let code = labiba.transform(labibaCode);

console.log(code)

0 comments on commit 743bd0f

Please sign in to comment.