Skip to content

Commit

Permalink
Merge pull request #86 from NuruProgramming/fh/cleanup
Browse files Browse the repository at this point in the history
use NuruProgramming packages
  • Loading branch information
AvicennaJr authored Jun 9, 2024
2 parents 1a9ee6f + 31cbcf3 commit 9c317d5
Show file tree
Hide file tree
Showing 68 changed files with 197 additions and 201 deletions.
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<h1 align="center">NURU🔥PROGRAMMING🔥LANGUAGE</h1>
<p align="center">
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/badge/Nuru-Programming%20Language-yellow"></a>
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/badge/platform-Linux | Windows | Android-green.svg"></a>
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/last-commit/AvicennaJr/Nuru"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/badge/Nuru-Programming%20Language-yellow"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/badge/platform-Linux | Windows | Android-green.svg"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/last-commit/AvicennaJr/Nuru"></a>
<br>
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/downloads/avicennajr/nuru/total"></a>
<a href="https://github.com/AvicennaJr/Nuru/releases"><img alt="Nuru Programming Language" src="https://img.shields.io/github/v/release/avicennajr/nuru?include_prereleases"></a>
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/actions/workflow/status/AvicennaJr/Nuru/tests.yml?style=plastic"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/downloads/avicennajr/nuru/total"></a>
<a href="https://github.com/NuruProgramming/Nuru/releases"><img alt="Nuru Programming Language" src="https://img.shields.io/github/v/release/avicennajr/nuru?include_prereleases"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/actions/workflow/status/AvicennaJr/Nuru/tests.yml?style=plastic"></a>
<br>
<a href="https://github.com/AvicennaJr/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/stars/AvicennaJr/Nuru?style=social"></a>
<a href="https://github.com/NuruProgramming/Nuru"><img alt="Nuru Programming Language" src="https://img.shields.io/github/stars/AvicennaJr/Nuru?style=social"></a>
</p>
A Swahili Programming Language of its kind built from the ground up.

Expand All @@ -21,7 +21,7 @@ To get started download the executables from the release page or follow the inst
- Download the binary:

```
curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.5.16/nuru_Linux_amd64.tar.gz
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.16/nuru_Linux_amd64.tar.gz
```

- Extract the file to make global available:
Expand All @@ -44,13 +44,13 @@ nuru -v
- For apple silicon mac use:

```
curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.5.16/nuru_Darwin_arm64.tar.gz
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.16/nuru_Darwin_arm64.tar.gz
```

- For apple intel mac use:

```
curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.5.16/nuru_Darwin_amd64.tar.gz
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.16/nuru_Darwin_amd64.tar.gz
```
- Extract the file to make global available:
Expand Down Expand Up @@ -114,14 +114,14 @@ To install Nuru on your Android device using Termux, follow these steps:
For a more streamlined installation, you can use the following one-liner:

```bash
curl -O -L https://github.com/AvicennaJr/Nuru/releases/download/v0.5.16/nuru_Android_arm64.tar.gz && mkdir -p /data/data/com.termux/files/usr/share/nuru && tar -xzvf nuru_Android_arm64.tar.gz -C /data/data/com.termux/files/usr/share/nuru && echo "alias nuru='/data/data/com.termux/files/usr/share/nuru/nuru'" >> ~/.bashrc && source ~/.bashrc && echo "Installation complete.."
curl -O -L https://github.com/NuruProgramming/Nuru/releases/download/v0.5.16/nuru_Android_arm64.tar.gz && mkdir -p /data/data/com.termux/files/usr/share/nuru && tar -xzvf nuru_Android_arm64.tar.gz -C /data/data/com.termux/files/usr/share/nuru && echo "alias nuru='/data/data/com.termux/files/usr/share/nuru/nuru'" >> ~/.bashrc && source ~/.bashrc && echo "Installation complete.."
```


### Windows

- Executable:
- Download the Nuru zip file [Here](https://github.com/AvicennaJr/Nuru/releases/download/v0.5.16/nuru_Windows_amd64.zip)
- Download the Nuru zip file [Here](https://github.com/NuruProgramming/Nuru/releases/download/v0.5.16/nuru_Windows_amd64.zip)
- Unzip to get the executable
- Double click the executable

Expand Down Expand Up @@ -370,7 +370,7 @@ nuru myFile.nr

## Issues

Kindly open an [Issue](https://github.com/AvicennaJr/Nuru/issues) to make suggestions and anything else.
Kindly open an [Issue](https://github.com/NuruProgramming/Nuru/issues) to make suggestions and anything else.

## Contributions

Expand Down
4 changes: 2 additions & 2 deletions ast/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"bytes"
"strings"

"github.com/AvicennaJr/Nuru/token"
"github.com/NuruProgramming/Nuru/token"
)

type Node interface {
TokenLiteral() string
String() string // to help debug the many errors lmao
String() string
}

type Statement interface {
Expand Down
2 changes: 1 addition & 1 deletion ast/ast_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package ast
import (
"testing"

"github.com/AvicennaJr/Nuru/token"
"github.com/NuruProgramming/Nuru/token"
)

func TestString(t *testing.T) {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/assign.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalAssign(node *ast.Assign, env *object.Environment) object.Object {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/assignEqual.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package evaluator
import (
"strings"

"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalAssignEqual(node *ast.AssignEqual, env *object.Environment) object.Object {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/at.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalAt(node *ast.At, env *object.Environment) object.Object {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/bang.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package evaluator

import "github.com/AvicennaJr/Nuru/object"
import "github.com/NuruProgramming/Nuru/object"

func evalBangOperatorExpression(right object.Object) object.Object {
switch right {
Expand All @@ -13,4 +13,4 @@ func evalBangOperatorExpression(right object.Object) object.Object {
default:
return FALSE
}
}
}
4 changes: 2 additions & 2 deletions evaluator/block.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalBlockStatement(block *ast.BlockStatement, env *object.Environment) object.Object {
Expand Down
2 changes: 1 addition & 1 deletion evaluator/builtins.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"os"
"strings"

"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/object"
)

var builtins = map[string]*object.Builtin{
Expand Down
4 changes: 2 additions & 2 deletions evaluator/call.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalCall(node *ast.CallExpression, env *object.Environment) object.Object {
Expand Down
6 changes: 3 additions & 3 deletions evaluator/dict.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalDictLiteral(node *ast.DictLiteral, env *object.Environment) object.Object {
Expand All @@ -29,4 +29,4 @@ func evalDictLiteral(node *ast.DictLiteral, env *object.Environment) object.Obje
}

return &object.Dict{Pairs: pairs}
}
}
6 changes: 3 additions & 3 deletions evaluator/evaluator.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ package evaluator
import (
"fmt"

"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

var (
Expand Down Expand Up @@ -134,7 +134,7 @@ func Eval(node ast.Node, env *object.Environment) object.Object {
return val
}
return evalPropertyAssignment(node.Name, val, env)
case *ast.Assign: // making let temporarily optional as I debug
case *ast.Assign:
return evalAssign(node, env)
case *ast.AssignEqual:
return evalAssignEqual(node, env)
Expand Down
6 changes: 3 additions & 3 deletions evaluator/evaluator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import (
"testing"
"time"

"github.com/AvicennaJr/Nuru/lexer"
"github.com/AvicennaJr/Nuru/object"
"github.com/AvicennaJr/Nuru/parser"
"github.com/NuruProgramming/Nuru/lexer"
"github.com/NuruProgramming/Nuru/object"
"github.com/NuruProgramming/Nuru/parser"
)

func TestEvalIntegerExpression(t *testing.T) {
Expand Down
6 changes: 3 additions & 3 deletions evaluator/forin.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalForInExpression(fie *ast.ForIn, env *object.Environment, line int) object.Object {
Expand All @@ -26,4 +26,4 @@ func evalForInExpression(fie *ast.ForIn, env *object.Environment, line int) obje
default:
return newError("Mstari %d: Huwezi kufanya operesheni hii na %s", line, i.Type())
}
}
}
4 changes: 2 additions & 2 deletions evaluator/function.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalFunction(node *ast.FunctionLiteral, env *object.Environment) object.Object {
Expand Down
6 changes: 3 additions & 3 deletions evaluator/identifier.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalIdentifier(node *ast.Identifier, env *object.Environment) object.Object {
Expand All @@ -14,4 +14,4 @@ func evalIdentifier(node *ast.Identifier, env *object.Environment) object.Object
}

return newError("Mstari %d: Neno Halifahamiki: %s", node.Token.Line, node.Value)
}
}
6 changes: 3 additions & 3 deletions evaluator/if.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalIfExpression(ie *ast.IfExpression, env *object.Environment) object.Object {
Expand All @@ -19,4 +19,4 @@ func evalIfExpression(ie *ast.IfExpression, env *object.Environment) object.Obje
} else {
return NULL
}
}
}
13 changes: 6 additions & 7 deletions evaluator/import.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,15 @@ package evaluator

import (
"fmt"
"io/ioutil"
"os"
"path/filepath"
"strings"

"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/lexer"
"github.com/AvicennaJr/Nuru/module"
"github.com/AvicennaJr/Nuru/object"
"github.com/AvicennaJr/Nuru/parser"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/lexer"
"github.com/NuruProgramming/Nuru/module"
"github.com/NuruProgramming/Nuru/object"
"github.com/NuruProgramming/Nuru/parser"
)

var searchPaths []string
Expand Down Expand Up @@ -62,7 +61,7 @@ func fileExists(file string) bool {
}

func evaluateFile(file string, env *object.Environment) (*object.Environment, object.Object) {
source, err := ioutil.ReadFile(file)
source, err := os.ReadFile(file)
if err != nil {
return nil, &object.Error{Message: fmt.Sprintf("Tumeshindwa kufungua pakeji: %s", file)}
}
Expand Down
2 changes: 1 addition & 1 deletion evaluator/in.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package evaluator
import (
"strings"

"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/object"
)

func evalInExpression(left, right object.Object, line int) object.Object {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/index.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package evaluator

import "github.com/AvicennaJr/Nuru/object"
import "github.com/NuruProgramming/Nuru/object"

func evalIndexExpression(left, index object.Object, line int) object.Object {
switch {
Expand Down Expand Up @@ -41,4 +41,4 @@ func evalDictIndexExpression(dict, index object.Object, line int) object.Object
}

return pair.Value
}
}
4 changes: 2 additions & 2 deletions evaluator/infix.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import (
"math"
"strings"

"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/object"
)

func evalInfixExpression(operator string, left, right object.Object, line int) object.Object {
if right == nil {
return newError("Mstari %d: Umekosea hapa", line)
}
}
if left == nil {
return newError("Mstari %d: Umekosea hapa", line)
}
Expand Down
4 changes: 2 additions & 2 deletions evaluator/method.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalMethodExpression(node *ast.MethodExpression, env *object.Environment) object.Object {
Expand Down
4 changes: 2 additions & 2 deletions evaluator/package.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package evaluator

import (
"github.com/AvicennaJr/Nuru/ast"
"github.com/AvicennaJr/Nuru/object"
"github.com/NuruProgramming/Nuru/ast"
"github.com/NuruProgramming/Nuru/object"
)

func evalPackage(node *ast.Package, env *object.Environment) object.Object {
Expand Down
Loading

0 comments on commit 9c317d5

Please sign in to comment.