Working on a testing method
This commit is contained in:
@ -1,7 +0,0 @@
|
||||
import "./import.jrpc";
|
||||
|
||||
type TestAtom {
|
||||
val_number?: float;
|
||||
val_boolean?: boolean;
|
||||
val_string?: string;
|
||||
}
|
@ -66,7 +66,7 @@ impl FileGenerator {
|
||||
}
|
||||
|
||||
pub fn a<T: ToString>(&mut self, indent: usize, content: T) {
|
||||
let line = " ".repeat(indent) + &content.to_string();
|
||||
let line = " ".repeat(indent) + &content.to_string();
|
||||
self.content.push(line);
|
||||
}
|
||||
|
||||
|
@ -13,10 +13,7 @@ pub use tokenizer::{tokenize, Token, TokenError, TokenPosition, TokenType};
|
||||
|
||||
#[cfg(test)]
|
||||
mod test {
|
||||
use crate::{
|
||||
compile::{Compile, CompileContext},
|
||||
targets::{self, rust::RustCompiler},
|
||||
};
|
||||
use crate::targets::{self, rust::RustCompiler};
|
||||
|
||||
#[cfg(test)]
|
||||
#[ctor::ctor]
|
||||
|
@ -1,6 +1,6 @@
|
||||
use anyhow::Result;
|
||||
use log::{debug, trace};
|
||||
use std::{collections::HashMap, error::Error, fmt::Display, sync::Arc};
|
||||
use std::{error::Error, fmt::Display, sync::Arc};
|
||||
|
||||
use crate::{Token, TokenPosition, TokenType};
|
||||
|
||||
|
@ -1,75 +0,0 @@
|
||||
// Test
|
||||
import "./import";
|
||||
|
||||
define csharp_namespace Example;
|
||||
define rust_crate example;
|
||||
define dart_library_name example;
|
||||
|
||||
enum TestEnum {
|
||||
VAL1,
|
||||
VAL2,
|
||||
VAL10 = 10,
|
||||
VAL11,
|
||||
VAL12
|
||||
}
|
||||
|
||||
type Test {
|
||||
atom: TestAtom;
|
||||
array: TestAtom[];
|
||||
enumValue: TestEnum;
|
||||
map: {int, TestAtom};
|
||||
}
|
||||
|
||||
|
||||
type AddValueRequest {
|
||||
value1: float;
|
||||
value2: float;
|
||||
}
|
||||
|
||||
type AddValueResponse {
|
||||
value: float;
|
||||
}
|
||||
|
||||
service TestService {
|
||||
@Description("Add two numbers")
|
||||
@Param("request", "Parameter containing the two numbers")
|
||||
@Returns("")
|
||||
AddValuesSingleParam(request: AddValueRequest): AddValueResponse;
|
||||
|
||||
@Description("Add two numbers")
|
||||
@Param("value1", "The first value")
|
||||
@Param("value2", "The second value")
|
||||
AddValuesMultipleParams(value1: float, value2: float): float;
|
||||
|
||||
@Description("Does literaly nothing")
|
||||
@Param("param1", "Some number")
|
||||
ReturningVoid(param1: float): void;
|
||||
|
||||
@Description("Just sends an Event with a String")
|
||||
@Param("param1", "Parameter with some string for event")
|
||||
notification OnEvent(param1: string);
|
||||
|
||||
ThrowingError(): void;
|
||||
|
||||
|
||||
FunctionWithArrayAsParamAndReturn(values1: float[], values2: float[]): float[];
|
||||
|
||||
FunctionWithKeywords(type: float, static: float, event: float): float;
|
||||
}
|
||||
|
||||
type Test2 {
|
||||
name: string;
|
||||
age: int;
|
||||
}
|
||||
|
||||
type TestKeywords {
|
||||
type: float;
|
||||
static: float;
|
||||
event: float;
|
||||
}
|
||||
|
||||
service SimpleTestService {
|
||||
@Description("asdasdasd")
|
||||
GetTest(name: string, age: int): Test2;
|
||||
notification TestNot();
|
||||
}
|
Reference in New Issue
Block a user