-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.dsl
More file actions
78 lines (64 loc) · 2.02 KB
/
Copy pathscript.dsl
File metadata and controls
78 lines (64 loc) · 2.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# SUMD DSL Script Example
# This script demonstrates various DSL capabilities
# Set up variables
project_name = "SUMD Project"
working_dir = cwd()
print("Working in: " + working_dir)
print("Project: " + project_name)
# Check if we have a SUMD.md file
if exists("SUMD.md"):
print("✅ SUMD.md found")
# Get file info
content = read_file("SUMD.md")
lines = len(content.splitlines())
print("SUMD.md has " + str(lines) + " lines")
# Validate the document
result = sumd_validate("SUMD.md")
if result.valid:
print("✅ SUMD.md is valid")
else:
print("❌ SUMD.md has validation issues")
print("Markdown issues: " + str(result.markdown_issues))
print("Codeblock issues: " + str(result.codeblock_issues))
else:
print("❌ SUMD.md not found")
print("Creating a basic SUMD.md...")
# Create a basic SUMD.md
basic_content = "# " + project_name + """
## Intent
This is a sample SUMD document generated by DSL script.
## Architecture
- Python project structure
- Modern development practices
## Dependencies
- Python 3.8+
- Standard libraries
## Installation
```bash
pip install -e .
```
"""
write_file("SUMD.md", basic_content)
print("✅ SUMD.md created")
# List Python files in the project
python_files = list_files("*.py")
print("Found " + str(len(python_files)) + " Python files:")
for file in python_files[:5]: # Show first 5
print(" - " + file)
# Demonstrate arithmetic and logic
file_count = len(python_files)
if file_count > 0:
print("Project has " + str(file_count) + " Python files")
if file_count > 10:
print("📊 This is a substantial project")
else:
print("📊 This is a small project")
else:
print("📊 No Python files found")
# Show available commands
print("\n🛠️ Available DSL commands:")
print(" cat, ls, edit, mkdir, rm")
print(" sumd_scan, sumd_map, sumd_validate, sumd_info")
print(" find, grep, echo, pwd, cd")
print(" set, get, unset, vars")
print("\n✅ DSL script completed successfully!")