Skip to content

Commit

Permalink
Updates README.
Browse files Browse the repository at this point in the history
  • Loading branch information
mtresnik committed Jun 7, 2024
1 parent 228aa92 commit 81ef732
Showing 1 changed file with 38 additions and 1 deletion.
39 changes: 38 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,44 @@
# goast
[![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](https://github.com/mtresnik/math/blob/main/LICENSE)
[![version](https://img.shields.io/badge/version-1.0.0-blue)](https://github.com/mtresnik/math/releases/tag/v1.0)
[![version](https://img.shields.io/badge/version-1.0.1-blue)](https://github.com/mtresnik/goast/releases/tag/v1.0.1)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-green.svg?style=flat-square)](https://makeapullrequest.com)
<hr>

Goast (pronounced Ghost) is a Go implementation of an AST and parser. This allows for strings to be converted to and from mathematical structures.


### Sample Code

In your project run:
```
go get github.com/mtresnik/goast@main
```

Your `go.mod` file should look like this:
```go
module mymodule

go 1.22.3

require github.com/mtresnik/goast v1.0.1
```


Then in your go files you should be able to access the parser:
```go
package main

import (
"fmt"
"github.com/mtresnik/goast/pkg/operations/parser"
)

func main() {
operation, err := parser.ParseOperation("a * bc + 123 / sin(3.1415 * n) ^ log_(2, 8) - e")
if err != nil {
fmt.Println((*err).Error())
return
}
fmt.Println(operation.ToString())
}
```

0 comments on commit 81ef732

Please sign in to comment.