diff --git a/csharp_mod/Extensions.cs b/csharp_mod/Extensions.cs index c309f00..e957a88 100644 --- a/csharp_mod/Extensions.cs +++ b/csharp_mod/Extensions.cs @@ -42,11 +42,8 @@ namespace Slang */ public static Line AsList(this Vec_FfiToken_t vec) { - L.Info("Converting output into a C# List."); var list = new Line(); - L.Info("Created new `Line`."); list.Capacity = (int)vec.len; - L.Info("Changed `Capacity` to be returned Vec's len"); var currentPtr = vec.ptr; diff --git a/csharp_mod/Marshal.cs b/csharp_mod/Marshal.cs index 753c41d..bc52a99 100644 --- a/csharp_mod/Marshal.cs +++ b/csharp_mod/Marshal.cs @@ -12,17 +12,13 @@ namespace Slang return new Line(); } - L.Info("Input string not empty"); - fixed (char* ptrString = source) { - L.Info("In `fixed` block."); var input = new slice_ref_uint16_t { ptr = (ushort*)ptrString, len = (UIntPtr)source.Length, }; - L.Info("Calling tokenize_line"); return Ffi.tokenize_line(input).AsList(); } } diff --git a/csharp_mod/Patches.cs b/csharp_mod/Patches.cs index 78d067f..d4c4d82 100644 --- a/csharp_mod/Patches.cs +++ b/csharp_mod/Patches.cs @@ -19,7 +19,7 @@ namespace Slang return; } - L.Info("Detected Slang source, compiling..."); + L.Debug("Detected Slang source, compiling..."); // Compile the Slang source into IC10 string compiled = SlangPlugin.Compile(result); diff --git a/rust_compiler/src/lib.rs b/rust_compiler/src/lib.rs index ed994a3..9913506 100644 --- a/rust_compiler/src/lib.rs +++ b/rust_compiler/src/lib.rs @@ -2,7 +2,7 @@ use compiler::Compiler; use parser::Parser; use safer_ffi::prelude::*; use std::io::BufWriter; -use tokenizer::{Error as TokenizerError, Tokenizer}; +use tokenizer::{token::TokenType, Error as TokenizerError, Tokenizer}; #[derive_ReprC] #[repr(C)] @@ -63,13 +63,14 @@ pub fn tokenize_line(input: safer_ffi::slice::Ref<'_, u16>) -> safer_ffi::Vec return safer_ffi::Vec::EMPTY, - Ok(token) => tokens.push(FfiToken { + Ok(token) if !matches!(token.token_type, TokenType::EOF) => tokens.push(FfiToken { text: token.token_type.to_string().into(), tooltip: "".into(), error: "".into(), status: "".into(), column: token.column as i32, }), + _ => {} } }