3.9.138 • Published 4 years ago

deflang v3.9.138

Weekly downloads
419
License
CC-BY-ND
Repository
-
Last release
4 years ago

DefLang(DEFL) Wiki


npm.io This is DEFL Wiki.

Wiki commands list

  1. How to run file
  2. Commands
    1. Basic
    2. echo
    3. def
    4. vew(Deleted.)
    5. Variable
    6. calc
    7. rettofir
    8. out
    9. geturl
    10. preload
    11. sleep
    12. functions
    13. for loop
    14. drawline
    15. fillrect
    16. fillarc
    17. genimg
    18. if
    19. goto
    20. Define function

npm.io

How to Run File

First,Write This in NodeJS.

var defl=require('deflang')
var res=defl(`program main;
echo:program test!;
end program`)
console.log(res) //Display : program test!

If you want use it in Vanilla JS then load vanilla/index.js.

<script>
rundefl(`program main;
echo:test;
end program`,callback=>{
console.log(callback)
})
</script>
<script src='vanilla/index.js'></script>
<!--
  or <script src='https://cdn.jsdelivr.net/npm/deflang@latest/vanilla/index.js'></script>
-->

If you want run DefLang by cli then do this.

cd node_modules/deflang
npm link
defl [filename]

Commands

0. Basic

These are some basic rules for DefLang.

Rules
1.Write Semicolon(;) on all commands final.
2.Split string is colon(:)
3.Its have a three can escape string.
      1.AND(&&)
      2.Semicolon(&;)
      3.Colon(&:)
4.Don't use U+F000 and U+F001 and U+F002 and U+F003.Them are Control String.
5.Write program in program main; ~ end program

1. echo

echo:[message];

Run this script to display message.

2. def

def:[variable name]:[content]:[mode];

Run this to define variable name and set content to content

If mode == file then, define variable name and set file content to content.

If mode == calc then, define variable name and set calculated answer to content.

If mode == array then, define variable name and set array.format is down :

first value,second value,third value,11,22,10

If mode == object then, define variable name and set object.format is down :

key=value,name=value,number=1,data1=10

Arrays can be accessed by {array name.number}

If mode == input then, define variable name and display content and ask to user.

3. vew(Deleted.If you want use vew,install 1.2.0 from website.)

vew:[variable name];

Run this script to display variable name content.
If the variable is undefined, UNDEFINED ERROR will return and stop the script.

4. Variable

%[variable name]%

Run this script to access variable name.

5. calc

calc:[formula];

Run this script to Display to Calculated formula.

6. rettofir

rettofir;

Run this script to Loop script.

7. out

out:[filename]:[content];

Write content to filename

8. geturl

geturl:[url]:[filename];

get content from url and write content to filename.

9. preload

preload:[filename]

load content from filename and define variables.

format is key:value; preload file example :

test:hoge;test2:fuga;

10. sleep

Note,sleep command use CPU,dont use long time

sleep:[seconds];

sleep seconds.

11. functions

 echo:sin(123);
 echo:cos(123):
 echo:tan(123);
 echo:deg2rad(360);
 echo:rad2deg(6.28);

DefLang have five math functions.

12. for loop

for:[variable name]:[start value]:[end value];
{commands}
next;

for command loop not forever.

for command can select loop number.

13. drawline

drawline:[x1]:[y1]:[x2]:[y2]:[color];

draw line.

14. fillrect

fillrect:[x]:[y]:[width]:[height]:[color];

draw filled rect.

15. fillarc

fillarc:[x]:[y]:[radius]:[color]:[start angle]:[end angle];

draw filled circle.

16. genimg

genimg:[filename];

Generate PNG File filename.

(filename is without .png)

17. if

if:[value1]:[mode]:[value2]:[line];

Mode can select ==,!=,>=,<=,>,<.

line count from first command.

18. goto

goto:[line number];

Go to line number. line count from first command.

19. Define function

#function <name> begin{
[DefLang program]
}end
name:arg1:arg2...;

Define function.
You can get arguments from variable “argv”.


Changelog

3.9.131: Added Changelog and ToDo And fixed english(Thanks rediar!)

3.9.132: Fixed README.md

3.9.133: Fixed README.md

3.9.134: Fixed README.md

3.9.135: Fixed README.md

3.9.136: Supports Indent

3.9.137: Supports Double Quotation and Single Quotation

3.9.138: Fixed Program


ToDo

  • More Data Types
  • Command for call other DefLang program
  • Command for HTTP(S) Request
3.9.138

4 years ago

3.9.136

4 years ago

3.9.137

4 years ago

3.9.135

4 years ago

3.9.134

4 years ago

3.9.132

4 years ago

3.9.133

4 years ago

3.9.131

4 years ago

3.9.120

4 years ago

3.9.129

4 years ago

3.9.123

4 years ago

3.9.124

4 years ago

3.9.121

4 years ago

3.9.122

4 years ago

3.9.127

4 years ago

3.9.128

4 years ago

3.9.125

4 years ago

3.9.126

4 years ago

3.9.130

4 years ago

3.9.119

4 years ago

3.9.118

4 years ago

3.9.117

4 years ago

3.9.116

4 years ago

3.9.115

4 years ago

3.9.114

4 years ago

3.9.112

4 years ago

3.9.113

4 years ago

3.9.110

4 years ago

3.9.111

4 years ago

3.9.109

4 years ago

3.9.108

4 years ago

3.9.107

4 years ago

3.9.106

4 years ago

3.9.105

4 years ago

3.9.104

4 years ago

3.9.103

4 years ago

3.9.101

4 years ago

3.9.102

4 years ago

3.9.100

4 years ago

3.9.99

4 years ago

3.9.98

4 years ago

3.9.97

4 years ago

3.9.96

4 years ago

3.9.95

4 years ago

3.9.90

4 years ago

3.9.93

4 years ago

3.9.94

4 years ago

3.9.91

4 years ago

3.9.92

4 years ago

3.9.91-beta2

4 years ago

3.9.91-beta

4 years ago

3.9.88

4 years ago

3.9.89

4 years ago

3.9.86

4 years ago

3.9.87

4 years ago

3.9.84

4 years ago

3.9.85

4 years ago

3.9.82

4 years ago

3.9.83

4 years ago

3.9.81

4 years ago

3.9.80

4 years ago

3.9.79

4 years ago

3.9.78

4 years ago

3.9.77

4 years ago

3.9.76

4 years ago

3.9.75

4 years ago

3.9.74

4 years ago

3.9.73

4 years ago

3.9.71

4 years ago

3.9.72

4 years ago

3.9.70

4 years ago

3.9.69

4 years ago

3.9.68

4 years ago

3.9.67

4 years ago

3.9.66

4 years ago

3.9.64

4 years ago

3.9.65

4 years ago

3.9.63

4 years ago

3.9.62

4 years ago

3.9.61

4 years ago

3.9.60

4 years ago

3.9.59

4 years ago

3.9.58

4 years ago

3.9.57

4 years ago

3.9.55

4 years ago

3.9.56

4 years ago

3.9.54

4 years ago

3.9.53

4 years ago

3.9.52

4 years ago

3.9.51

4 years ago

3.9.50

4 years ago

3.9.49

4 years ago

3.9.48

4 years ago

3.9.46

4 years ago

3.9.47

4 years ago

3.9.45

4 years ago

3.9.44

4 years ago

3.9.43

4 years ago

3.8.43

4 years ago

3.8.42

4 years ago

3.8.41

4 years ago

3.8.40

4 years ago

3.8.38

4 years ago

3.8.39

4 years ago

3.8.37

4 years ago

3.8.36

4 years ago

3.8.35

4 years ago

3.8.33

4 years ago

3.8.32

4 years ago

3.8.31

4 years ago

3.8.30

4 years ago

3.8.28

4 years ago

3.8.29

4 years ago

3.8.27

4 years ago

3.8.25

4 years ago

3.8.26

4 years ago

3.8.24

4 years ago

3.8.23

4 years ago

3.8.22

4 years ago

3.7.22

4 years ago

3.5.21

4 years ago

3.5.20

4 years ago

3.5.14

4 years ago

3.5.13

4 years ago

3.5.12

4 years ago

3.5.11

4 years ago

3.5.10

4 years ago

3.5.19

4 years ago

3.5.18

4 years ago

3.5.17

4 years ago

3.5.16

4 years ago

3.5.15

4 years ago

3.5.9

4 years ago

3.5.8

4 years ago

3.5.7

4 years ago

3.5.6

4 years ago

3.5.5

4 years ago

3.5.3

4 years ago

3.5.4

4 years ago

3.5.2

4 years ago

3.5.1

4 years ago

3.5.0

4 years ago