Compare commits

..

No commits in common. "main" and "V1.0.0" have entirely different histories.
main ... V1.0.0

14 changed files with 18 additions and 119 deletions

View file

@ -1,7 +0,0 @@
Copyright 2025 Afonya
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,26 +0,0 @@
# Astro Lang Docs
Egy magyar + GenZ programozási nyelv
---
## Miben jobb:
- többszavas változók
- magyar kulcsszavak
- teljes értékű dokumentáció
- Rustban írt
---
## Példa:
```asl
gethelj a = 10
ugass(a)
```
---
Weboldal és dokumentáció: [itt](https://astrolang.afonyanet.hu)
Kiadások: [itt](https://git.afonyanet.hu/afonya/AstroLang/releases)
Licensz: MIT

View file

@ -119,7 +119,6 @@ Példa: `kábel.halgass`
|Név|Leírás|Használat|Példa|
|---|---|---|---|
|halgass|Hallgat egy porton.|`halgass(host: string, port: number): halgató`|`halgass(szaft"0.0.0.0"szaft,1010)`|
|kapcsolódj|Rákapcsolódik egy célra.|`kapcsolódj(target: string): kapcsolat`|`kapcsolódj(szaft"example.com:80"szaft)`|
:::warning

View file

@ -119,7 +119,6 @@ Példa: `kábel.halgass`
|Név|Leírás|Használat|Példa|
|---|---|---|---|
|halgass|Hallgat egy porton.|`halgass(host: string, port: number): halgató`|`halgass(szaft"0.0.0.0"szaft,1010)`|
|kapcsolódj|Rákapcsolódik egy célra.|`kapcsolódj(target: string): kapcsolat`|`kapcsolódj(szaft"example.com:80"szaft)`|
:::warning

View file

@ -1 +0,0 @@
build/

View file

@ -1,7 +0,0 @@
Copyright 2025 Afonya
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -1,26 +0,0 @@
# Astro Lang Extension
Egy magyar + GenZ programozási nyelv
---
## Miben jobb:
- többszavas változók
- magyar kulcsszavak
- teljes értékű dokumentáció
- Rustban írt
---
## Példa:
```asl
gethelj a = 10
ugass(a)
```
---
Weboldal és dokumentáció: [itt](https://astrolang.afonyanet.hu)
Kiadások: [itt](https://git.afonyanet.hu/afonya/AstroLang/releases)
Licensz: MIT

View file

@ -66,7 +66,6 @@ vscode.languages.registerCompletionItemProvider('astrolang', {
"vége",
"halgass",
"kapcsolódj",
"kérés",
"írj",
"olvass",

View file

@ -2,7 +2,7 @@
"name": "astrolang-extension",
"displayName": "Astro Lang",
"icon": "asl.png",
"version": "1.0.2",
"version": "1.0.0",
"description": "The extension for Astro Lang",
"license": "MIT",
"author": "Afonya",

View file

@ -32,8 +32,7 @@ struct Compiled {
variables: Vec<Variable>,
strings: HashMap<u32, String>,
functions: HashMap<u32, Compiled>,
try_catch: Option<u32>,
ctx: Context
try_catch: Option<u32>
}
#[derive(Debug, Clone)]
@ -754,8 +753,7 @@ fn compile_function(ast: Vec<ASTPart>, args: Option<Vec<String>>, registers: &mu
variables,
strings,
functions,
try_catch,
ctx: ctx.clone(),
try_catch
};
}
@ -827,7 +825,7 @@ fn compile_body(compiled: Compiled, fpos: &mut usize, ctx: &Context) -> (Vec<u8>
*fpos += 1;
append_be_num(&mut output, 3, *funcs as usize);
append_be_num(&mut output, 4, *fpos);
let (compiled, mut context) = compile_body(compiled.functions[funcs].clone(), fpos, &compiled.functions[funcs].ctx);
let (compiled, mut context) = compile_body(compiled.functions[funcs].clone(), fpos, ctx);
for c in &mut context {
c.c_funcid = *fpos
}

View file

@ -436,12 +436,12 @@ fn kabel_irj(machine: &mut Machine, op: &DecompiledOperation, args: Vec<VMMemory
if stream.is_none() {
error(String::from("Stream is not a TcpStream"), machine, op);
}
let mut stream = stream.unwrap();
let mut listener = stream.unwrap();
let write = match &args[1] {
VMMemory::String(s) => s.value.clone(),
_ => String::new()
};
match stream.write_all(write.as_bytes()) {
match listener.write_all(write.as_bytes()) {
Ok(_) => {},
Err(e) => {
error(format!("Failed to write to stream: {}", e), machine, op);
@ -540,40 +540,6 @@ fn kabel_keres(machine: &mut Machine, op: &DecompiledOperation, args: Vec<VMMemo
}
return VMMemory::Null(VMMemoryNull { variable_id: 0 });
}
fn kabel_kapcsolodj(machine: &mut Machine, op: &DecompiledOperation, args: Vec<VMMemory>) -> VMMemory {
arg_expect(&args, 0, "string", machine, op);
let str = match &args[0] {
VMMemory::String(s) => s.value.clone(),
_ => String::new()
};
let stream = match TcpStream::connect(&str) {
Ok(s) => s,
Err(err) => {
error(format!("Failed to connect to {}: {}", str, err), machine, op);
return VMMemory::Null(VMMemoryNull { variable_id: 0 });
}
};
machine.storage.push(Box::new(stream));
let ret_table: Vec<TableValue> = vec![
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("olvass"), variable_id: 0 }),
value: VMMemory::NativeFunction(VMMemoryNativeFunction { func: kabel_olvass, variable_id: 0 }),
},
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("írj"), variable_id: 0 }),
value: VMMemory::NativeFunction(VMMemoryNativeFunction { func: kabel_irj, variable_id: 0 }),
},
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("zár"), variable_id: 0 }),
value: VMMemory::NativeFunction(VMMemoryNativeFunction { func: kabel_zar, variable_id: 0 }),
},
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("id"), variable_id: 0 }),
value: VMMemory::Number(VMMemoryNumber { value: (machine.storage.len()-1) as f64, variable_id: 0 }),
}
];
return VMMemory::Table(VMMemoryTable { values: ret_table, variable_id: 0 });
}
fn kabel_halgass(machine: &mut Machine, op: &DecompiledOperation, args: Vec<VMMemory>) -> VMMemory {
arg_expect(&args, 0, "string", machine, op);
arg_expect(&args, 1, "number", machine, op);
@ -1195,10 +1161,6 @@ pub fn generate() -> HashMap<String, VMMemory> {
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("halgass"), variable_id: 0 }),
value: VMMemory::NativeFunction(VMMemoryNativeFunction { func: kabel_halgass, variable_id: 0 }),
},
TableValue {
key: VMMemory::String(VMMemoryString { value: String::from("kapcsolódj"), variable_id: 0 }),
value: VMMemory::NativeFunction(VMMemoryNativeFunction { func: kabel_kapcsolodj, variable_id: 0 }),
}
];
mem.insert(String::from("kábel"), VMMemory::Table(VMMemoryTable { values: kabel, variable_id: 0 }));

View file

@ -10,7 +10,7 @@ mod virtualmachine;
mod errors;
mod decompiler;
const CLIVER: [u8; 3] = [1,0,2];
const CLIVER: [u8; 3] = [1,0,0];
#[derive(Debug, Clone)]
struct Context {

View file

@ -1,2 +1,11 @@
hámozd test be szaft"test2.asl"szaft
gethelj a = szaft"asd"szaft+1
lőcsve test() {
lőcsve toast() {
ugass(2)
}
toast()
ugass(1)
}
gethelj k = krumpli.létrehoz(test)
ugass(krumpli.státusz(k))
krumpli.folytat(k)
ugass(krumpli.státusz(k))