Skip to content

Commit 76beed6

Browse files
committed
Initial commit
0 parents  commit 76beed6

8 files changed

+69
-0
lines changed

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 jan0sc
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# antlr4nim
2+
Nim interface to ANTLR4 listener/visitor via jsffi

antlr4nim.nimble

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Package
2+
3+
version = "0.1.0"
4+
author = "jan0sc"
5+
description = "Nim interface to ANTLR4 listener/visitor via jsffi"
6+
license = "MIT"
7+
srcDir = "src"
8+
9+
10+
# Dependencies
11+
12+
requires "nim >= 1.4.2"

src/antlr4nim.nim

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# This is just an example to get you started. A typical library package
2+
# exports the main API in this file. Note that you cannot rename this file
3+
# but you can remove it if you wish.
4+
5+
proc add*(x, y: int): int =
6+
## Adds two files together.
7+
return x + y

src/antlr4nim/submodule.nim

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is just an example to get you started. Users of your library will
2+
# import this file by writing ``import antlr4nim/submodule``. Feel free to rename or
3+
# remove this file altogether. You may create additional modules alongside
4+
# this file as required.
5+
6+
type
7+
Submodule* = object
8+
name*: string
9+
10+
proc initSubmodule*(): Submodule =
11+
## Initialises a new ``Submodule`` object.
12+
Submodule(name: "Anonymous")

tests/config.nims

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
switch("path", "$projectDir/../src")

tests/test1.nim

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# This is just an example to get you started. You may wish to put all of your
2+
# tests into a single file, or separate them into multiple `test1`, `test2`
3+
# etc. files (better names are recommended, just make sure the name starts with
4+
# the letter 't').
5+
#
6+
# To run these tests, simply execute `nimble test`.
7+
8+
import unittest
9+
10+
import antlr4nim
11+
test "can add":
12+
check add(5, 5) == 10

0 commit comments

Comments
 (0)