Compare commits

..

No commits in common. "c2a087785e27fd561c97df9806f755a8186e4038" and "86eab29173ab8291f768a3bc1a9847ccea76adc9" have entirely different histories.

7 changed files with 15 additions and 8 deletions

View File

@ -33,7 +33,7 @@ fn fibonacci(n: u16) -> u16 {
```
Currently missing relevant features (TODOs) are:
- ~~Arrays~~ (DONE)
- Arrays
- Structs (and custom types as such)
- Extern functions
- Strings

View File

@ -351,6 +351,7 @@ impl InstructionHolder {
),
ArrayAlloca(ty, len) => {
let array_len = ConstValue::U16(*len as u16).as_llvm(module.context_ref);
let array_ty = Type::Ptr(Box::new(ty.clone()));
LLVMBuildArrayAlloca(
module.builder_ref,
ty.as_llvm(module.context_ref),

View File

@ -1,7 +1,7 @@
// Arithmetic, function calls and imports!
fn array() -> [[[u16; 4]; 1]; 1] {
return [[[10, 15, 7, 9]]];
fn array() -> [[u16; 4]; 1] {
return [[10, 15, 7, 9]];
}
fn main() -> u16 {
@ -9,7 +9,7 @@ fn main() -> u16 {
let mut list = array();
list[0][0][3] = 5;
list[0][3] = 5;
return list[0][0][3];
return list[0][3];
}

View File

@ -155,6 +155,8 @@ impl<'ctx, 'a> Scope<'ctx, 'a> {
impl IndexedVariableReference {
fn get_stack_value(&self, scope: &mut Scope) -> Option<(StackValue, Vec<u32>)> {
use StackValueKind as Kind;
match &self.kind {
mir::IndexedVariableReferenceKind::Named(NamedVariableRef(_, name, _)) => scope
.stack_values

View File

@ -32,7 +32,7 @@
//! }
//!
//! Currently missing relevant features (TODOs) are:
//! - ~~Arrays~~ (DONE)
//! - Arrays
//! - Structs (and custom types as such)
//! - Extern functions
//! - Strings

View File

@ -4,7 +4,7 @@
//! must then be passed through TypeCheck with the same [`TypeRefs`] in order to
//! place the correct types from the IDs and check that there are no issues.
use std::iter;
use std::{convert::Infallible, iter};
use crate::{mir::TypeKind, util::try_all};

View File

@ -1,4 +1,8 @@
use super::*;
use super::{
pass::{ScopeVariable, Storage},
typecheck::ErrorKind,
*,
};
#[derive(Debug, Clone)]
pub enum ReturnTypeOther {