Merge remote-tracking branch 'upstream/master'

This commit is contained in:
2023-03-28 23:18:46 +01:00
7 changed files with 97 additions and 3 deletions

38
.github/ISSUE_TEMPLATE/bug_report.md vendored Normal file
View File

@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Expected behavior**
A clear and concise description of what you expected to happen.
**Screenshots**
If applicable, add screenshots to help explain your problem.
**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]
**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]
**Additional context**
Add any other context about the problem here.

View File

@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

2
merge.bat Normal file
View File

@@ -0,0 +1,2 @@
git fetch upstream
git merge upstream/master master

9
src/config.go Normal file
View File

@@ -0,0 +1,9 @@
package main
var websiteLang = "https://argon.wbell.dev/"
var docs = "https://argon.wbell.dev/docs/"
var mainrepo = "https://github.com/Open-Argon/argon-v3"
var mainissuesPage = "https://github.com/Open-Argon/argon-v3/issues"
var fork = false
var forkrepo = ""
var forkissuesPage = ""

View File

@@ -1,6 +1,7 @@
package main
import (
"fmt"
"os"
"syscall/js"
)
@@ -19,6 +20,27 @@ func newscope() ArObject {
func main() {
c := make(chan ArObject)
defer func() {
if r := recover(); r != nil {
fmt.Println("There was a fundamental error in argon v3 that caused it to crash.")
fmt.Println()
if fork {
fmt.Println("This is a fork of Open-Argon. Please report this to the fork's maintainer.")
fmt.Println("Fork repo:", forkrepo)
fmt.Println("Fork issue page:", forkissuesPage)
fmt.Println()
} else {
fmt.Println("Please report this to the Open-Argon team.")
fmt.Println("Main repo:", mainrepo)
fmt.Println("Issue page:", mainissuesPage)
fmt.Println()
}
fmt.Println("please include the following information:")
fmt.Println("panic:", r)
os.Exit(1)
}
}()
initRandom()
garbageCollect()
obj := js.Global().Get("Object").New()
obj.Set("eval", js.FuncOf(func(this js.Value, args []js.Value) interface{} {

View File

@@ -181,7 +181,7 @@ var ArArccosec = builtinFunc{"arccosec", func(args ...any) (any, ArErr) {
}
num := args[0].(number)
n, _ := num.Float64()
if n < -1 || n > 1 {
if n > -1 && n < 1 {
return nil, ArErr{TYPE: "Runtime Error",
message: fmt.Sprintf("arccosec expected number between -1 and 1, got %s", anyToArgon(n, true, true, 3, 0, false, 0)),
EXISTS: true,
@@ -229,7 +229,7 @@ var ArArcsec = builtinFunc{"arcsec", func(args ...any) (any, ArErr) {
}
num := args[0].(number)
n, _ := num.Float64()
if n < -1 || n > 1 {
if n > -1 && n < 1 {
return nil, ArErr{TYPE: "Runtime Error",
message: fmt.Sprintf("arcsec expected number between -1 and 1, got %s", anyToArgon(n, true, true, 3, 0, false, 0)),
EXISTS: true,

View File

@@ -28,6 +28,10 @@ func parseTryCatch(code UNPARSEcode, index int, codelines []UNPARSEcode) (TryCat
return TryCatch{}, false, err, i
}
totalIndex += i
if index+totalIndex >= len(codelines) {
return TryCatch{}, false, ArErr{"Syntax Error", "expected catch statement", code.line, code.path, code.realcode, true}, i
}
catchtrimmed := strings.TrimSpace(codelines[index+totalIndex].code)
if !catchCompiled.MatchString(catchtrimmed) {
return TryCatch{}, false, ArErr{"Syntax Error", "invalid syntax", code.line, code.path, code.realcode, true}, i
@@ -36,7 +40,6 @@ func parseTryCatch(code UNPARSEcode, index int, codelines []UNPARSEcode) (TryCat
catchbracketSplit := strings.SplitN(catchtrimmed, ")", 2)
errorName := strings.TrimSpace(strings.TrimSpace(catchbracketSplit[0])[1:])
errcode := catchbracketSplit[1]
catchparsed, worked, err, i := translateVal(UNPARSEcode{errcode, code.realcode, code.line, code.path}, index+totalIndex, codelines, 1)
if !worked {
return TryCatch{}, false, err, i