No description
Find a file
2020-06-28 19:25:26 +08:00
examples update 2020-06-28 19:23:17 +08:00
src update 2020-06-28 19:23:17 +08:00
LICENSE Initial commit 2020-06-28 16:54:00 +08:00
nimish.nimble initial 2020-06-28 17:53:25 +08:00
README.md Update README.md 2020-06-28 19:25:26 +08:00

nimish

Make Nim support C macro for fun!

Usage

translate single file

nimish example.nish

translate all files(must be with the extension ".nish")

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.

nimish c -r example.nish

Example

example.nish

#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



# 1 "example.nim.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "example.nim.c"



proc hello(a: int) =
  echo "Hello, World!"
  echo 12
  echo 3 + 4
  echo "string"