easycoder 251028.1__tar.gz → 251103.3__tar.gz
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-251103.3/.github/copilot-instructions.md +112 -0
- {easycoder-251028.1 → easycoder-251103.3}/PKG-INFO +1 -1
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/__init__.py +1 -1
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_compiler.py +9 -3
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_core.py +11 -6
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_handler.py +1 -1
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_program.py +2 -3
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_pyside.py +33 -16
- {easycoder-251028.1 → easycoder-251103.3}/.gitignore +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/LICENSE +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/README.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/backdrop.jpg +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/README.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/README.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/boolean.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/empty.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/ends.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/even.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/exists.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/greater.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/hasProperty.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/includes.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/is.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/less.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/list.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/none.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/not.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/numeric.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/object.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/odd.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/starts.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/conditions/string.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/add.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/append.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/assert.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/begin.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/clear.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/close.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/create.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/debug.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/decrement.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/delete.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/divide.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/exit.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/file.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/fork.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/get.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/go.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/gosub.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/if.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/import.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/increment.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/index.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/init.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/input.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/load.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/lock.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/log.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/module.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/multiply.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/negate.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/on.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/open.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/pop.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/post.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/print.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/push.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/put.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/read.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/release.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/replace.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/return.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/run.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/save.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/script.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/send.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/set.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/shuffle.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/split.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/stack.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/stop.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/system.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/take.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/toggle.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/truncate.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/unlock.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/use.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/variable.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/wait.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/while.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/keywords/write.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/arg.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/args.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/cos.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/datime.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/decode.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/element.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/elements.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/empty.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/encode.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/error.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/files.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/float.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/from.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/hash.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/index.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/integer.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/json.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/keys.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/left.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/length.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/lowercase.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/memory.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/modification.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/modulo.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/newline.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/now.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/position.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/property.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/random.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/right.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/sin.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/stringify.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/tab.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/tan.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/timestamp.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/today.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/trim.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/type.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/uppercase.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/value.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/core/values/weekday.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/README.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/attach.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/close.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/create.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/ellipse.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/image.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/move.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/on.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/rectangle.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/render.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/run.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/set.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/keywords/text.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/values/attribute.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/doc/graphics/values/window.md +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/close.png +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_border.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_classes.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_condition.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_keyboard.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_timestamp.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/ec_value.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/easycoder/tick.png +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/images/Semoigo Dawn.jpg +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/json/graphics-demo.json +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/plugins/ec_keyboard.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/plugins/ec_p100.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/plugins/ec_pyside6.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/plugins/points.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/plugins/sql.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/pyproject.toml +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/benchmark.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/ec_keyboard.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/fizzbuzz.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/hello.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/points.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/test.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/scripts/tests.ecs +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/test.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/testrc.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/testsql.py +0 -0
- {easycoder-251028.1 → easycoder-251103.3}/testui.py +0 -0
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
# EasyCoder-py AI Assistant Instructions
|
|
2
|
+
|
|
3
|
+
This guide helps AI coding assistants understand and work effectively with the EasyCoder-py codebase.
|
|
4
|
+
|
|
5
|
+
## Project Overview
|
|
6
|
+
|
|
7
|
+
EasyCoder-py is a high-level English-like domain-specific scripting language (DSL) implemented in Python. Key characteristics:
|
|
8
|
+
|
|
9
|
+
- English-like syntax focused on vocabulary rather than structure
|
|
10
|
+
- Command-line based with an emerging graphics module using PySide6
|
|
11
|
+
- Acts as a wrapper around standard Python functions
|
|
12
|
+
- Extensible through plugin modules
|
|
13
|
+
- Suitable for prototyping, rapid testing, and control systems
|
|
14
|
+
|
|
15
|
+
## Core Architecture
|
|
16
|
+
|
|
17
|
+
### Main Components:
|
|
18
|
+
|
|
19
|
+
1. Core Language (`easycoder/`)
|
|
20
|
+
- `ec_compiler.py`: Handles script compilation
|
|
21
|
+
- `ec_program.py`: Manages program execution
|
|
22
|
+
- `ec_core.py`: Core language features
|
|
23
|
+
- `ec_value.py`: Value handling
|
|
24
|
+
- `ec_condition.py`: Condition processing
|
|
25
|
+
|
|
26
|
+
2. Plugin System (`plugins/`)
|
|
27
|
+
- Seamlessly extends language functionality
|
|
28
|
+
- Example: `points.py` demonstrates coordinate handling
|
|
29
|
+
|
|
30
|
+
3. Documentation (`doc/`)
|
|
31
|
+
- Core features in `doc/core/`
|
|
32
|
+
- Graphics features in `doc/graphics/`
|
|
33
|
+
- Each keyword/value/condition documented separately
|
|
34
|
+
|
|
35
|
+
## Development Workflows
|
|
36
|
+
|
|
37
|
+
### Testing
|
|
38
|
+
|
|
39
|
+
1. Run the comprehensive test suite:
|
|
40
|
+
```bash
|
|
41
|
+
easycoder scripts/tests.ecs
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
2. Performance benchmarking:
|
|
45
|
+
```bash
|
|
46
|
+
easycoder scripts/benchmark.ecs
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Script Development
|
|
50
|
+
|
|
51
|
+
1. Basic script structure:
|
|
52
|
+
```
|
|
53
|
+
script ScriptName
|
|
54
|
+
! Your code here
|
|
55
|
+
exit
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
2. Debugging:
|
|
59
|
+
- Use `log` instead of `print` for timestamped debug output
|
|
60
|
+
- Example: `log 'Debug message'` outputs with timestamp and line number
|
|
61
|
+
|
|
62
|
+
## Project Conventions
|
|
63
|
+
|
|
64
|
+
1. Script Files
|
|
65
|
+
- Extension: `.ecs`
|
|
66
|
+
- Always include `exit` command to properly terminate
|
|
67
|
+
- Use `script Name` to identify scripts for debugging
|
|
68
|
+
|
|
69
|
+
2. Plugin Development
|
|
70
|
+
- Place new plugins in `plugins/` directory
|
|
71
|
+
- Must provide both compiler and runtime modules
|
|
72
|
+
- See `plugins/points.py` for reference implementation
|
|
73
|
+
|
|
74
|
+
3. Documentation
|
|
75
|
+
- Place in `doc/` with appropriate subdirectory
|
|
76
|
+
- One markdown file per language feature
|
|
77
|
+
- Include syntax, parameters, and examples
|
|
78
|
+
|
|
79
|
+
## Common Patterns
|
|
80
|
+
|
|
81
|
+
1. Error Handling
|
|
82
|
+
```
|
|
83
|
+
on error
|
|
84
|
+
log error
|
|
85
|
+
exit
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
2. Variable Declaration
|
|
89
|
+
```
|
|
90
|
+
variable Name
|
|
91
|
+
set Name to Value
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
3. Plugin Integration
|
|
95
|
+
```
|
|
96
|
+
use plugin-name
|
|
97
|
+
! Plugin-specific commands
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
## Key Integration Points
|
|
101
|
+
|
|
102
|
+
1. Python Integration
|
|
103
|
+
- EasyCoder wraps Python functionality
|
|
104
|
+
- Custom plugins can wrap any Python library with suitable API
|
|
105
|
+
- Direct Python integration via `system` command
|
|
106
|
+
|
|
107
|
+
2. Graphics (PySide6)
|
|
108
|
+
- Graphics module under active development
|
|
109
|
+
- See `doc/graphics/` for current features
|
|
110
|
+
- Uses plugin system for seamless integration
|
|
111
|
+
|
|
112
|
+
Remember: Focus on English-like syntax and readability when writing or modifying code. Keep scripts as readable as natural language where possible.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: easycoder
|
|
3
|
-
Version:
|
|
3
|
+
Version: 251103.3
|
|
4
4
|
Summary: Rapid scripting in English
|
|
5
5
|
Keywords: compiler,scripting,prototyping,programming,coding,python,low code,hypertalk,computer language,learn to code
|
|
6
6
|
Author-email: Graham Trott <gtanyware@gmail.com>
|
|
@@ -78,7 +78,10 @@ class Compiler:
|
|
|
78
78
|
return self.program.code[pc]
|
|
79
79
|
|
|
80
80
|
# Add a command to the code list
|
|
81
|
-
def
|
|
81
|
+
def addCommand(self, command):
|
|
82
|
+
if len(self.code) == 0:
|
|
83
|
+
if hasattr(self.program, 'usingGraphics'):
|
|
84
|
+
pass
|
|
82
85
|
self.code.append(command)
|
|
83
86
|
|
|
84
87
|
def isSymbol(self):
|
|
@@ -161,7 +164,7 @@ class Compiler:
|
|
|
161
164
|
command['locked'] = False
|
|
162
165
|
command['extra'] = extra
|
|
163
166
|
if 'keyword' in command: command['hasValue'] = self.hasValue(command['keyword'])
|
|
164
|
-
self.
|
|
167
|
+
self.addCommand(command)
|
|
165
168
|
return True
|
|
166
169
|
|
|
167
170
|
# Compile the current token
|
|
@@ -209,7 +212,7 @@ class Compiler:
|
|
|
209
212
|
self.index = index
|
|
210
213
|
while True:
|
|
211
214
|
token = self.tokens[self.index]
|
|
212
|
-
keyword = token.token
|
|
215
|
+
# keyword = token.token
|
|
213
216
|
if self.debugCompile: print(self.script.lines[token.lino])
|
|
214
217
|
# if keyword != 'else':
|
|
215
218
|
if self.compileOne() == True:
|
|
@@ -223,3 +226,6 @@ class Compiler:
|
|
|
223
226
|
|
|
224
227
|
def compileFromHere(self, stopOn):
|
|
225
228
|
return self.compileFrom(self.getIndex(), stopOn)
|
|
229
|
+
|
|
230
|
+
def compileFromStart(self):
|
|
231
|
+
return self.compileFrom(0, [])
|
|
@@ -1769,12 +1769,17 @@ class Core(Handler):
|
|
|
1769
1769
|
self.program.importPlugin(f'{source}:{clazz}')
|
|
1770
1770
|
return True
|
|
1771
1771
|
return False
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1772
|
+
else:
|
|
1773
|
+
token = self.nextToken()
|
|
1774
|
+
if token in ['graphics', 'debugger']:
|
|
1775
|
+
if not hasattr(self.program, 'usingGraphics'):
|
|
1776
|
+
print('Loading graphics module')
|
|
1777
|
+
from .ec_pyside import Graphics
|
|
1778
|
+
self.program.graphics = Graphics
|
|
1779
|
+
self.program.useClass(Graphics)
|
|
1780
|
+
self.program.usingGraphics = True
|
|
1781
|
+
if token == 'debugger': self.program.debugging = True
|
|
1782
|
+
return True
|
|
1778
1783
|
return False
|
|
1779
1784
|
|
|
1780
1785
|
# Declare a general-purpose variable
|
|
@@ -23,7 +23,7 @@ class Handler:
|
|
|
23
23
|
self.rewindTo = compiler.rewindTo
|
|
24
24
|
self.warning = compiler.warning
|
|
25
25
|
self.getPC = compiler.getPC
|
|
26
|
-
self.add = compiler.
|
|
26
|
+
self.add = compiler.addCommand
|
|
27
27
|
self.getCommandAt = compiler.getCommandAt
|
|
28
28
|
self.compileOne = compiler.compileOne
|
|
29
29
|
self.compileFromHere = compiler.compileFromHere
|
|
@@ -34,9 +34,9 @@ class Program:
|
|
|
34
34
|
self.domainIndex = {}
|
|
35
35
|
self.name = '<anon>'
|
|
36
36
|
self.code = []
|
|
37
|
+
self.pc = 0
|
|
37
38
|
self.symbols = {}
|
|
38
39
|
self.onError = 0
|
|
39
|
-
self.pc = 0
|
|
40
40
|
self.debugStep = False
|
|
41
41
|
self.stack = []
|
|
42
42
|
self.script = Script(source)
|
|
@@ -48,7 +48,6 @@ class Program:
|
|
|
48
48
|
self.externalControl = False
|
|
49
49
|
self.ticker = 0
|
|
50
50
|
self.running = True
|
|
51
|
-
# self.start()
|
|
52
51
|
|
|
53
52
|
# This is called at 10msec intervals by the GUI code
|
|
54
53
|
def flushCB(self):
|
|
@@ -62,7 +61,7 @@ class Program:
|
|
|
62
61
|
module['child'] = self
|
|
63
62
|
startCompile = time.time()
|
|
64
63
|
self.tokenise(self.script)
|
|
65
|
-
if self.compiler.
|
|
64
|
+
if self.compiler.compileFromStart():
|
|
66
65
|
finishCompile = time.time()
|
|
67
66
|
s = len(self.script.lines)
|
|
68
67
|
t = len(self.script.tokens)
|
|
@@ -836,6 +836,7 @@ class Graphics(Handler):
|
|
|
836
836
|
|
|
837
837
|
# Initialize the graphics environment
|
|
838
838
|
def k_init(self, command):
|
|
839
|
+
# return True
|
|
839
840
|
if self.nextIs('graphics'):
|
|
840
841
|
self.add(command)
|
|
841
842
|
return True
|
|
@@ -847,7 +848,22 @@ class Graphics(Handler):
|
|
|
847
848
|
self.program.screenWidth = screen[0]
|
|
848
849
|
self.program.screenHeight = screen[1]
|
|
849
850
|
print(f'Screen: {self.program.screenWidth}x{self.program.screenHeight}')
|
|
850
|
-
return self.nextPC()
|
|
851
|
+
# return self.nextPC()
|
|
852
|
+
def on_last_window_closed():
|
|
853
|
+
self.program.kill()
|
|
854
|
+
def init():
|
|
855
|
+
self.program.flush(self.nextPC())
|
|
856
|
+
def flush():
|
|
857
|
+
if not self.blocked:
|
|
858
|
+
if self.runOnTick != 0:
|
|
859
|
+
self.program.run(self.runOnTick)
|
|
860
|
+
self.program.flushCB()
|
|
861
|
+
timer = QTimer()
|
|
862
|
+
timer.timeout.connect(flush)
|
|
863
|
+
timer.start(10)
|
|
864
|
+
QTimer.singleShot(500, init)
|
|
865
|
+
self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
866
|
+
self.app.exec()
|
|
851
867
|
|
|
852
868
|
# Declare a label variable
|
|
853
869
|
def k_label(self, command):
|
|
@@ -1367,21 +1383,22 @@ class Graphics(Handler):
|
|
|
1367
1383
|
return False
|
|
1368
1384
|
|
|
1369
1385
|
def r_start(self, command):
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
timer
|
|
1381
|
-
timer.
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
self.app.
|
|
1386
|
+
return self.nextPC()
|
|
1387
|
+
# def on_last_window_closed():
|
|
1388
|
+
# self.program.kill()
|
|
1389
|
+
# def init():
|
|
1390
|
+
# self.program.flush(self.nextPC())
|
|
1391
|
+
# def flush():
|
|
1392
|
+
# if not self.blocked:
|
|
1393
|
+
# if self.runOnTick != 0:
|
|
1394
|
+
# self.program.run(self.runOnTick)
|
|
1395
|
+
# self.program.flushCB()
|
|
1396
|
+
# timer = QTimer()
|
|
1397
|
+
# timer.timeout.connect(flush)
|
|
1398
|
+
# timer.start(10)
|
|
1399
|
+
# QTimer.singleShot(500, init)
|
|
1400
|
+
# self.app.lastWindowClosed.connect(on_last_window_closed)
|
|
1401
|
+
# self.app.exec()
|
|
1385
1402
|
|
|
1386
1403
|
# Declare a widget variable
|
|
1387
1404
|
def k_widget(self, command):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|