easycoder 1__py2.py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of easycoder might be problematic. Click here for more details.
- easycoder/__init__.py +12 -0
- easycoder/ec_classes.py +51 -0
- easycoder/ec_compiler.py +201 -0
- easycoder/ec_condition.py +26 -0
- easycoder/ec_core.py +2181 -0
- easycoder/ec_handler.py +71 -0
- easycoder/ec_program.py +302 -0
- easycoder/ec_timestamp.py +10 -0
- easycoder/ec_value.py +99 -0
- easycoder-1.dist-info/LICENSE +201 -0
- easycoder-1.dist-info/METADATA +78 -0
- easycoder-1.dist-info/RECORD +13 -0
- easycoder-1.dist-info/WHEEL +5 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
|
+
Name: easycoder
|
|
3
|
+
Version: 1
|
|
4
|
+
Summary: EasyCoder for Python
|
|
5
|
+
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
6
|
+
Description-Content-Type: text/markdown
|
|
7
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
8
|
+
Project-URL: Home, https://github.com/easycoder
|
|
9
|
+
|
|
10
|
+
# Introduction
|
|
11
|
+
This is the Python version of EasyCoder, a high-level English-like scripting language suited for prototyping and rapid testing of ideas. It operates on the command line.
|
|
12
|
+
|
|
13
|
+
The JavaScript version of EasyCoder, which provides a full set of graphical features to run in a browser, is at [https://easycoder.github.io](https://easycoder.github.io)
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
1: Install EasyCoder in your Python environment:
|
|
17
|
+
```
|
|
18
|
+
pip install easycoder@git+https://github.com/easycoder/easycoder.git
|
|
19
|
+
```
|
|
20
|
+
2: Write a test script, 'hello.ecs':
|
|
21
|
+
```
|
|
22
|
+
print `Hello, world!`
|
|
23
|
+
```
|
|
24
|
+
This is traditionally the first program to be written in virtually any language. To run it under REPL, launch Python and type the following commands:
|
|
25
|
+
```
|
|
26
|
+
from easycoder import Program
|
|
27
|
+
Program(['hello.ecs'])
|
|
28
|
+
```
|
|
29
|
+
The script is passed in as a list because it could be just one of a number of command-line arguments.
|
|
30
|
+
|
|
31
|
+
The output will look like this:
|
|
32
|
+
```
|
|
33
|
+
Compiled <anon>: 1 lines (2 tokens) in 0 ms
|
|
34
|
+
Run <anon>
|
|
35
|
+
1-> Hello, world!
|
|
36
|
+
```
|
|
37
|
+
To avoid having to use REPL you can set up a simple executable command such as this Python script. On Linux the first line will ensure it runs as a command if given execute permission. You can name it 'easycoder' - there's no need for a '.py' extension.
|
|
38
|
+
```
|
|
39
|
+
#!/bin/python3
|
|
40
|
+
|
|
41
|
+
from sys import argv
|
|
42
|
+
from easycoder import Program
|
|
43
|
+
|
|
44
|
+
if (len(argv) > 1):
|
|
45
|
+
Program(argv[1:])
|
|
46
|
+
else:
|
|
47
|
+
print('Syntax: easycoder <scriptname> [plugins]')
|
|
48
|
+
```
|
|
49
|
+
With this you can run your script with the command `easycoder hello.ecs`. You can place `easycoder` anywhere on your system execution path, such as in a local `bin` directory.
|
|
50
|
+
|
|
51
|
+
It's conventional to add a program title to a script:
|
|
52
|
+
```
|
|
53
|
+
! Test script
|
|
54
|
+
|
|
55
|
+
script Test
|
|
56
|
+
|
|
57
|
+
print `Hello, world!`
|
|
58
|
+
```
|
|
59
|
+
The first line here is just a comment and has no effect on the running of the script. The second line gives the script a name, which is useful in debugging as it says which script was running. When run, the output is now
|
|
60
|
+
```
|
|
61
|
+
Compiled Test: 5 lines (4 tokens) in 0 ms
|
|
62
|
+
Run Test
|
|
63
|
+
5-> Hello, world!
|
|
64
|
+
```
|
|
65
|
+
As you can guess from the above, the print command gives the line in the script it was called from. This is very useful in tracking down debugging print commands in large scripts.
|
|
66
|
+
|
|
67
|
+
In the repository is a folder called `tests` containing a couple of sample scripts. `benchmark.ecs` allows the performance of EasyCoder to be compared to other languages if a similar program is written for each one. `tests.ecs` is a test program containing many of the EasyCoder features.
|
|
68
|
+
|
|
69
|
+
## The EasyCoder programming language
|
|
70
|
+
There are three primary components to the language:
|
|
71
|
+
1 Keywords
|
|
72
|
+
2 Values
|
|
73
|
+
3 Conditions
|
|
74
|
+
|
|
75
|
+
All program lines start with a keyword - a command to EasyCoder to do something
|
|
76
|
+
|
|
77
|
+
(Under construction)
|
|
78
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
easycoder/__init__.py,sha256=mpv1kWMMPFilGEN7AjxNVnmbGJlZD7LhaUfTGWOem3I,255
|
|
2
|
+
easycoder/ec_classes.py,sha256=onBKF6Lj8BZKNuJKacx4HyhOrVLXsoHdzl6RnMf77uM,1413
|
|
3
|
+
easycoder/ec_compiler.py,sha256=ByWwWA4GTzDX1kljgNbBwzfvvUuR34FRQSEpRVtRo5s,4670
|
|
4
|
+
easycoder/ec_condition.py,sha256=s7xKM3ZeOOiSgZv16RnWznAikHZaJRp1UHwrliebpUE,748
|
|
5
|
+
easycoder/ec_core.py,sha256=_PnwCJcxa7vD5MouuM9COTAC9RnGvzSZ9022Tlqzh5M,74591
|
|
6
|
+
easycoder/ec_handler.py,sha256=WDDIz0awD3vSQZ149rgbUWsClt6zXqED8ByXQJ5p1Ds,2200
|
|
7
|
+
easycoder/ec_program.py,sha256=oO6jLtlRbw_YiA1MZ3Gkgj2hgVrLIdShLOOC972mjs8,7378
|
|
8
|
+
easycoder/ec_timestamp.py,sha256=_3QFJPzIWZ9Rzk3SQOQJ-gwmvB07pg78k23SPntoZtY,288
|
|
9
|
+
easycoder/ec_value.py,sha256=GnHkWSfcB2InGeLj4T8x_H8U9bvbkj9lF4klEUylt38,2371
|
|
10
|
+
easycoder-1.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
11
|
+
easycoder-1.dist-info/WHEEL,sha256=ssQ84EZ5gH1pCOujd3iW7HClo_O_aDaClUbX4B8bjKY,100
|
|
12
|
+
easycoder-1.dist-info/METADATA,sha256=wK6yIGPIiCgoTgihRuZ_6BhLJziY2B2a6U--j51KSVo,2991
|
|
13
|
+
easycoder-1.dist-info/RECORD,,
|