https://github.com/ringabout/nimish
Make Nim language support C macro for fun. :-)
https://github.com/ringabout/nimish
Last synced: about 1 year ago
JSON representation
Make Nim language support C macro for fun. :-)
- Host: GitHub
- URL: https://github.com/ringabout/nimish
- Owner: ringabout
- License: apache-2.0
- Created: 2020-06-28T08:53:59.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-06-28T11:41:00.000Z (almost 6 years ago)
- Last Synced: 2024-10-14T15:03:51.440Z (over 1 year ago)
- Language: Nim
- Homepage:
- Size: 9.77 KB
- Stars: 4
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# nimish
Make Nim support C macro for fun!
## Usage
**translate single file**
```bash
nimish example.nish
```
**translate all files(must be with the extension ".nish")**
```bash
nimish --all
nimish -a
```
**Run as Nim file**
You can pass the same parameters as normal Nim's file, make
sure filename is at the end of the parameters list.
```bash
nimish c -r example.nish
```
## Example
**example.nish**
```nim
#define text 12
#define name "string"
#define Add(a, b) a + b
proc hello(a: int) =
echo "Hello, World!"
echo text
echo Add(3, 4)
echo name
```
Type `nimish example.nim.c` ->
**example.nim**
```nim
# 1 "example.nim.c"
# 1 ""
# 1 ""
# 1 "example.nim.c"
proc hello(a: int) =
echo "Hello, World!"
echo 12
echo 3 + 4
echo "string"
```