Commit 9672f98
committed
feat(ovsm): add Python-style (#) comment support
**Enhancement:**
Added support for Python-style # comments in OVSM scripts, complementing
the existing // C-style comments.
**Problem Solved:**
AI agents were generating OVSM code with # comments, which caused tokenization
errors. This enhancement allows both comment styles, making OVSM more compatible
with AI-generated code and more user-friendly.
**Implementation:**
- Modified scanner.rs to recognize '#' character
- Comments extend from # to end of line
- Works alongside existing // comment support
**Test Results:**
✅ Both # and // comments work correctly
✅ Inline comments supported
✅ Multiple comment styles can coexist in same script
✅ 10 transactions counted successfully with commented code
**Impact:**
- Improves AI agent compatibility
- Makes OVSM more familiar to Python developers
- Enables better code documentation
**Example:**
```ovsm
# This is a Python-style comment
CONST ADDRESS = "6EF8..." // C-style comment also works
$result = getSignatures(address: ADDRESS, limit: 10) # Inline comment
RETURN COUNT($result)
```
**Files Changed:**
- crates/ovsm/src/lexer/scanner.rs (lines 97-102)1 parent baedd32 commit 9672f98
1 file changed
+6
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
97 | 103 | | |
98 | 104 | | |
99 | 105 | | |
| |||
0 commit comments