fix broken function pointer

This commit is contained in:
Ugric committed 2022-06-30 21:48:44 +01:00
1 parent 0d07bc1112
commit 89cc0cefab
7 files changed
+16 -86

No files matched your search

-38
View File
@@ -1,38 +0,0 @@
---
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.
-20
View File
@@ -1,20 +0,0 @@
---
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.
+5 -4
View File
@@ -1,5 +1,6 @@
{
"files.associations": {
"*.ar": "C"
}
}
"C_Cpp.errorSquiggles": "Disabled",
"files.associations": {
"*.ar": "C"
}
}
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -1 +1 @@
go build -o argon.exe .
go build -o argon-lang/argon.exe .
+4 -23
View File
@@ -1,24 +1,5 @@
from 'math' import atan, asin, acos
sub coolsub(func) [
func('wow very cool')
]
log('SohCahToa')
log('1. Soh')
log('2. Cah')
log('3. Toa')
log()
const choice = whole(input('Enter your choice: '))
if choice == 1 [
o = number(input('Enter the opposite: '))
h = number(input('Enter the hypotenuse: '))
log('The angle is: ' + (asin(o/h)))
] else [
if choice == 2 [
a = number(input('Enter the adjacent: '))
h = number(input('Enter the hypotenuse: '))
log('The angle is: ' + (acos(o/h)))
] else [
o = number(input('Enter the opposite: '))
a = number(input('Enter the adjacent: '))
log('The angle is: ' + (atan(o/a)))
]
]
coolsub(log)
+6
View File
@@ -172,6 +172,12 @@ func callFunc(call funcCallType, vargroups []map[string]variableValue, origin st
for variables[callable.name].TYPE != "func" && variables[callable.name].TYPE != "init_function" && fmt.Sprint(reflect.TypeOf(variables[callable.name].VAL)) == "main.variable" {
callable = funcCallType{name: variables[callable.name].VAL.(variable).variable, args: callable.args, line: callable.line}
}
for i := len(vargroups) - 1; i >= 0; i-- {
if vargroups[i][callable.name].EXISTS != nil {
variables = vargroups[i]
break
}
}
if variables[callable.name].TYPE != "func" && variables[callable.name].TYPE != "init_function" {
log.Fatal("'" + call.name + "' is not a function on line " + fmt.Sprint(call.line+1))
}