diff --git a/docs/LICENSE b/docs/LICENSE deleted file mode 100644 index e66f844..0000000 --- a/docs/LICENSE +++ /dev/null @@ -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. \ No newline at end of file diff --git a/docs/README.md b/docs/README.md deleted file mode 100644 index da94e10..0000000 --- a/docs/README.md +++ /dev/null @@ -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 \ No newline at end of file diff --git a/docs/docs/enviroment.md b/docs/docs/enviroment.md index 893e3fc..54e6b31 100644 --- a/docs/docs/enviroment.md +++ b/docs/docs/enviroment.md @@ -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 diff --git a/docs/versioned_docs/version-1.0.0/enviroment.md b/docs/versioned_docs/version-1.0.0/enviroment.md index 893e3fc..54e6b31 100644 --- a/docs/versioned_docs/version-1.0.0/enviroment.md +++ b/docs/versioned_docs/version-1.0.0/enviroment.md @@ -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 diff --git a/extension/.gitignore b/extension/.gitignore deleted file mode 100644 index d163863..0000000 --- a/extension/.gitignore +++ /dev/null @@ -1 +0,0 @@ -build/ \ No newline at end of file diff --git a/extension/LICENSE b/extension/LICENSE deleted file mode 100644 index e66f844..0000000 --- a/extension/LICENSE +++ /dev/null @@ -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. \ No newline at end of file diff --git a/extension/README.md b/extension/README.md deleted file mode 100644 index 7ddfcf8..0000000 --- a/extension/README.md +++ /dev/null @@ -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 \ No newline at end of file diff --git a/extension/astrolang-extension-1.0.2.vsix b/extension/astrolang-extension-1.0.0.vsix similarity index 75% rename from extension/astrolang-extension-1.0.2.vsix rename to extension/astrolang-extension-1.0.0.vsix index 0651d87..6170be4 100644 Binary files a/extension/astrolang-extension-1.0.2.vsix and b/extension/astrolang-extension-1.0.0.vsix differ diff --git a/extension/index.js b/extension/index.js index c07fe37..e9adb88 100644 --- a/extension/index.js +++ b/extension/index.js @@ -66,7 +66,6 @@ vscode.languages.registerCompletionItemProvider('astrolang', { "vége", "halgass", - "kapcsolódj", "kérés", "írj", "olvass", diff --git a/extension/package.json b/extension/package.json index 36ff78e..6f0101d 100644 --- a/extension/package.json +++ b/extension/package.json @@ -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", diff --git a/src/compiler.rs b/src/compiler.rs index 49110e5..d30d014 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -32,8 +32,7 @@ struct Compiled { variables: Vec, strings: HashMap, functions: HashMap, - try_catch: Option, - ctx: Context + try_catch: Option } #[derive(Debug, Clone)] @@ -754,8 +753,7 @@ fn compile_function(ast: Vec, args: Option>, 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 *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 } diff --git a/src/enviroment.rs b/src/enviroment.rs index 4a99d64..40cfb12 100644 --- a/src/enviroment.rs +++ b/src/enviroment.rs @@ -436,12 +436,12 @@ fn kabel_irj(machine: &mut Machine, op: &DecompiledOperation, args: Vec 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) -> 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 = 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 { arg_expect(&args, 0, "string", machine, op); arg_expect(&args, 1, "number", machine, op); @@ -1195,10 +1161,6 @@ pub fn generate() -> HashMap { 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 })); diff --git a/src/main.rs b/src/main.rs index 0b758b0..3de6c12 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 { diff --git a/test.asl b/test.asl index 3324140..5b5aa9a 100644 --- a/test.asl +++ b/test.asl @@ -1,2 +1,11 @@ -hámozd test be szaft"test2.asl"szaft -gethelj a = szaft"asd"szaft+1 \ No newline at end of file +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)) \ No newline at end of file