1.0.3 • Published 11 months ago

leziscript v1.0.3

Weekly downloads
-
License
ISC
Repository
-
Last release
11 months ago

LeziScript (.ls)

LeziScript is a custom language with a unique syntax that consists of only five keywords: " ", "lezi", "Lezi", "LEZI", and "\n". It allows you to write code using a combination of these keywords, which are then parsed into binary values.

Syntax and Keywords

The LeziScript language has the following keywords:

  • : Represents the binary value 0.
  • lezi: Represents the binary value 1.
  • Lezi: Creates looping data.
  • LEZI: Used within a loop to indicate the current loop index.
  • \n: Starts a new character.

Example Code

Here's an example code snippet in LeziScript that prints "Hello, World!":

lezilezi   lezilezi
lezilezi lezilezilezilezi
lezilezi lezilezilezi 
lezilezilezi  lezilezi
lezilezi lezilezilezilezi
lezilezi lezilezi  
lezilezi  lezi lezi
lezi lezilezilezi 
lezilezi lezilezi  
lezilezi lezilezilezilezi
lezilezi  lezilezilezi
lezi lezi   
lezi  lezilezilezi
lezilezi lezi   
lezilezi  lezi lezi
lezilezi lezilezi  
lezilezi lezilezi  
lezilezi lezilezilezilezi
lezi     
lezilezilezi lezilezilezi
lezilezi lezilezilezilezi
lezilezilezi  lezi 
lezilezi lezilezi  
lezilezi  lezi  
lezi    lezi
lezi  lezilezilezi
lezi lezi  lezi
lezilezilezi lezilezi

This code snippet utilizes the LeziScript syntax and keywords to represent the binary values that make up the string "Hello, World!".

Please note that the above example is specific to LeziScript and may not be directly executable in other programming languages.

Usage

To use LeziScript, you can include the LeziScript package in your project and write your code using the LeziScript syntax. The package will provide functionality for parsing and executing LeziScript code. Your node.js code should be like:

const leziScript = require("leziscript");

leziScript.run('./file.ls');

Functions

Here are some functions that you will get while importing the package.

const leziScript = require("leziscript");


leziScript.run(codeFile, debug?) // Run The LeziScript Code.
//string: codeFile - Path to the code
//bool: debug - Logs the execution time and binary values of your code etc. (default: false)

leziScript.encode(text) // Encodes Text To LeziScript
//string: text - Text to encode

leziScript.decode(text) // Same as .run() but this won't execute the code but just return the parsed string
//string: text - Text to decode

Working Principle

So the execution is done in these steps:

  • A code snippet of LeziScript is passed to run function such as: lezilezi lezi lezilezi lezi lezi
  • This will decode as ["1101000", "1101001"] in an array of binary values
  • Each value is converted to string ["h", "i"]
  • Then the array is eval so that the output is hi

Creating Loop

Lezi and LEZI are the keywords used to loop.

leziLezilezilezi
lezi LEZILezi

This code will be decoded as ["1", {n: "11", data: "10LEZI"}]. This object in second value is the loop object. Property n of the object represents binary value of "how many times to loop?", here its 11 which converts to 3 in number. data property represents "what to loop?" Here its 10LEZI, The key word LEZI will be replaced to the current loop count, example for first loop out of three it will be 101 then for second 1010 then for third 1011 so on...

Acknowledgements

Special thanks to ChatGPT for assisting in creating this README page.

1.0.3

11 months ago

1.0.2

11 months ago

1.0.1

11 months ago

1.0.0

11 months ago