{
"@context": "https://nxdlang.org/schema",
"doc_id": "PT003",
"title": "",
"description": "NXD Compiler Testing Notes - Nim",
"layer": "Passed Tests",
"category": "Passed Tests",
"keywords": [Transpilation, Compiler, Nim],
"doc_version": "1.0",
"status": "active"
}
# PT003
### NXD Sample:
```nxd
MODULE TEST
FUNC MAIN():
RETURN 1 ADD 2
```
### Result:
COMPILER: PASS
SEMANTICS: PASS
Failure Stage:
N/A
### Expected Output:
```json
{
"module": {
"name": "TEST",
"imports": []
},
"types": [],
"functions": [
{
"name": "MAIN",
"params": [],
"return_type": null,
"body": [
{
"kind": "return",
"value": {
"kind": "binary",
"op": "ADD",
"left": {
"kind": "literal",
"value": 1
},
"right": {
"kind": "literal",
"value": 2
}
}
}
]
}
]
}
```
### Actual Output:
```json
{
"module": {
"name": "TEST",
"imports": []
},
"types": [],
"functions": [
{
"name": "MAIN",
"params": [],
"return_type": null,
"body": [
{
"kind": "return",
"value": {
"kind": "binary",
"op": "ADD",
"left": {
"kind": "literal",
"value": 1
},
"right": {
"kind": "literal",
"value": 2
}
}
}
]
}
]
}
```
### Notes:
Confirmed:
- Operator tokenization
- Binary expression parsing
- ASTBinary generation
- IR binary lowering
- JSON serialization
Documentation