Skip to content

Commit

Permalink
Rename src package
Browse files Browse the repository at this point in the history
  • Loading branch information
kirsle committed Dec 11, 2016
1 parent 85292d5 commit a2415a5
Show file tree
Hide file tree
Showing 17 changed files with 23 additions and 21 deletions.
6 changes: 3 additions & 3 deletions rivescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ import (
const VERSION string = "0.0.3"

type RiveScript struct {
rs *src.RiveScript
rs *rivescript.RiveScript
}

func New(config *config.Config) *RiveScript {
bot := new(RiveScript)
bot.rs = src.New(config)
bot.rs = rivescript.New(config)
return bot
}

Expand Down Expand Up @@ -169,7 +169,7 @@ Parameters
name: The name of your subroutine for the `<call>` tag in RiveScript.
fn: A function with a prototype `func(*RiveScript, []string) string`
*/
func (self *RiveScript) SetSubroutine(name string, fn src.Subroutine) {
func (self *RiveScript) SetSubroutine(name string, fn rivescript.Subroutine) {
self.rs.SetSubroutine(name, fn)
}

Expand Down
2 changes: 1 addition & 1 deletion src/astmap.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

/*
For my own sanity while programming the code, these structs mirror the data
Expand Down
2 changes: 1 addition & 1 deletion src/base_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src_test
package rivescript_test

// NOTE: while these test files live in the 'src' package, they import the
// public facing API from the root rivescript-go package.
Expand Down
2 changes: 1 addition & 1 deletion src/brain.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion src/config.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Public API Configuration Methods

Expand Down
2 changes: 1 addition & 1 deletion src/debug.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Debugging methods

Expand Down
2 changes: 1 addition & 1 deletion src/inheritance.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

import "fmt"

Expand Down
2 changes: 1 addition & 1 deletion src/loading.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Loading and Parsing Methods

Expand Down
2 changes: 1 addition & 1 deletion src/parser.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// parse loads the RiveScript code into the bot's memory.
func (rs *RiveScript) parse(path string, lines []string) error {
Expand Down
2 changes: 1 addition & 1 deletion src/regexp.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Common regular expressions.

Expand Down
2 changes: 1 addition & 1 deletion src/rivescript.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ this package lest you be tempted to use it (don't).
You've been warned. Here be dragons.
*/
package src
package rivescript

import (
"regexp"
Expand Down
2 changes: 1 addition & 1 deletion src/rivescript_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src_test
package rivescript_test

import (
"fmt"
Expand Down
2 changes: 1 addition & 1 deletion src/sessions_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src_test
package rivescript_test

import (
"testing"
Expand Down
2 changes: 1 addition & 1 deletion src/sorting.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Data sorting functions

Expand Down
2 changes: 1 addition & 1 deletion src/structs.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Miscellaneous structures

Expand Down
8 changes: 5 additions & 3 deletions src/tags.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Tag processing functions.

Expand Down Expand Up @@ -366,13 +366,15 @@ func (rs *RiveScript) processTags(username string, message string, reply string,
}

// Sanity check.
value, err := strconv.Atoi(strValue)
var value int
value, err = strconv.Atoi(strValue)
abort := false
if err != nil {
insert = fmt.Sprintf("[ERR: Math can't %s non-numeric value %s]", tag, strValue)
abort = true
}
orig, err := strconv.Atoi(origStr)
var orig int
orig, err = strconv.Atoi(origStr)
if err != nil {
insert = fmt.Sprintf("[ERR: Math can't %s non-numeric user variable %s]", tag, name)
abort = true
Expand Down
2 changes: 1 addition & 1 deletion src/utils.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package src
package rivescript

// Miscellaneous utility functions.

Expand Down

0 comments on commit a2415a5

Please sign in to comment.