Skip to content

Commit

Permalink
changing 'within' keyword to 'in', hopefully without breaking anythin…
Browse files Browse the repository at this point in the history
…g :)
  • Loading branch information
objeck committed Feb 17, 2024
1 parent e20293c commit d69aca8
Show file tree
Hide file tree
Showing 5 changed files with 94 additions and 94 deletions.
48 changes: 24 additions & 24 deletions core/compiler/lib_src/encrypt.obs
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@ bundle Encryption {
class Hash {
#~
Hash input using SHA-256
@param input bytes to hashed
@param stream_in bytes to hashed
@return hashed bytes
~#
function : SHA256(input : Byte[]) ~ Byte[] {
if(input <> Nil) {
function : SHA256(stream_in : Byte[]) ~ Byte[] {
if(stream_in <> Nil) {
array_args := Base->New[2];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(input);
array_args[1] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_hash_sha256", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand All @@ -46,14 +46,14 @@ bundle Encryption {

#~
Hash input using SHA-512
@param input bytes to hashed
@param stream_in bytes to hashed
@return hashed bytes
~#
function : SHA512(input : Byte[]) ~ Byte[] {
if(input <> Nil) {
function : SHA512(stream_in : Byte[]) ~ Byte[] {
if(stream_in <> Nil) {
array_args := Base->New[2];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(input);
array_args[1] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_hash_sha512", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand All @@ -65,14 +65,14 @@ bundle Encryption {

#~
Hash input using MD5
@param input bytes to hashed
@param stream_in bytes to hashed
@return hashed bytes
~#
function : MD5(input : Byte[]) ~ Byte[] {
if(input <> Nil) {
function : MD5(stream_in : Byte[]) ~ Byte[] {
if(stream_in <> Nil) {
array_args := Base->New[2];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(input);
array_args[1] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_hash_md5", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand All @@ -84,14 +84,14 @@ bundle Encryption {

#~
Hash input using RIPEMD digest
@param input bytes to hashed
@param stream_in bytes to hashed
@return hashed bytes
~#
function : RIPEMD160(input : Byte[]) ~ Byte[] {
if(input <> Nil) {
function : RIPEMD160(stream_in : Byte[]) ~ Byte[] {
if(stream_in <> Nil) {
array_args := Base->New[2];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(input);
array_args[1] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_hash_ripemd160", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand All @@ -109,15 +109,15 @@ bundle Encryption {
#~
Encrypt input using AES-256
@param key encryption key
@param input bytes to encrypted
@param stream_in bytes to encrypted
@return encrypted bytes
~#
function : AES256(key : Byte[], input : Byte[]) ~ Byte[] {
if(key <> Nil & input <> Nil) {
function : AES256(key : Byte[], stream_in : Byte[]) ~ Byte[] {
if(key <> Nil & stream_in <> Nil) {
array_args := Base->New[3];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(key);
array_args[2] := ByteArrayRef->New(input);
array_args[2] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_encrypt_aes256", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand Down Expand Up @@ -150,15 +150,15 @@ bundle Encryption {
#~
Decrypts input using AES-256
@param key encryption key
@param input bytes to decrypted
@param stream_in bytes to decrypted
@return decrypted bytes
~#
function : AES256(key : Byte[], input : Byte[]) ~ Byte[] {
if(key <> Nil & input <> Nil) {
function : AES256(key : Byte[], stream_in : Byte[]) ~ Byte[] {
if(key <> Nil & stream_in <> Nil) {
array_args := Base->New[3];
array_args[0] := ByteArrayRef->New(Nil->As(Byte[]));
array_args[1] := ByteArrayRef->New(key);
array_args[2] := ByteArrayRef->New(input);
array_args[2] := ByteArrayRef->New(stream_in);
Proxy->GetDllProxy()->CallFunction("openssl_decrypt_aes256", array_args);

holder := array_args[0]->As(ByteArrayRef);
Expand Down
6 changes: 3 additions & 3 deletions core/compiler/lib_src/json.obs
Original file line number Diff line number Diff line change
Expand Up @@ -317,10 +317,10 @@ if(doc <> Nil) {

#~
Creates a new parser
@param input Json input string
@param stream_in Json input string
~#
New(input : String) {
@input := input->Trim()->ToCharArray();
New(stream_in : String) {
@input := stream_in->Trim()->ToCharArray();
@input_index := 0;

@tokens_max := 32;
Expand Down
24 changes: 12 additions & 12 deletions core/compiler/lib_src/misc.obs
Original file line number Diff line number Diff line change
Expand Up @@ -212,34 +212,34 @@ bundle System.Utility {
class Parser {
#~
Simple tokenizer
@param input source input
@param stream_in source input
@return vector of string tokens
~#
function : Tokenize(input : String) ~ Vector<String> {
function : Tokenize(stream_in : String) ~ Vector<String> {
tokens := Vector->New()<String>;

each(i : input) {
each(i : stream_in) {
# identifier
if(input->Get(i)->IsChar()) {
if(stream_in->Get(i)->IsChar()) {
start := i;
while(input->Get(i)->IsChar() | input->Get(i)->IsDigit() | input->Get(i) = '_') {
while(stream_in->Get(i)->IsChar() | stream_in->Get(i)->IsDigit() | stream_in->Get(i) = '_') {
i += 1;
};
tokens->AddBack(input->SubString(start, i - start));
tokens->AddBack(stream_in->SubString(start, i - start));
i -= 1;
}
# number
else if(input->Get(i)->IsDigit()) {
else if(stream_in->Get(i)->IsDigit()) {
start := i;
while(input->Get(i)->IsDigit() | input->Get(i) = '.') {
while(stream_in->Get(i)->IsDigit() | stream_in->Get(i) = '.') {
i += 1;
};
tokens->AddBack(input->SubString(start, i - start));
tokens->AddBack(stream_in->SubString(start, i - start));
i -= 1;
}
# other
else {
value := input->Get(i);
value := stream_in->Get(i);
if(value <> ' ' & value <> '\t' & value <> '\r' & value <> '\n') {
tokens->AddBack(value->ToString());
};
Expand Down Expand Up @@ -1667,8 +1667,8 @@ bundle System.Utility {
@keywords : Hash<String, Token>;
@tokens : Vector<Token>;

New(input : String) {
@buffer := input->ToCharArray();
New(stream_in : String) {
@buffer := stream_in->ToCharArray();
@line_num := @line_pos := 1;
@tokens := Vector->New()<Token>;

Expand Down
8 changes: 4 additions & 4 deletions core/compiler/lib_src/ml.obs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,19 +1378,19 @@ else if(args->Size() = 1) {
if(inputs->Size() = targets->Size()) {
each(i : iterations) {
each(j : inputs) {
input := inputs->Get(j)->Get();
stream_in := inputs->Get(j)->Get();
target := targets->Get(j)->Get();

# calculate signals into hidden layer
hidden_outputs := Matrix2D->DotSigmoid(@weight_inputs_hidden, input);
hidden_outputs := Matrix2D->DotSigmoid(@weight_inputs_hidden, stream_in);
# calculate signals into final output layer
final_outputs := Matrix2D->DotSigmoid(@weight_outputs_hidden, hidden_outputs);
# output layer error is the (target - actual)
output_errors := Matrix2D->Subtract(target, final_outputs);
# hidden layer error is the output_errors, split by weights, recombined at hidden nodes
hidden_errors := Matrix2D->DotProduct(Matrix2D->Transpose(@weight_outputs_hidden), output_errors);
# update the weights for the links between the input and hidden layers
@weight_inputs_hidden := Matrix2D->Add(@weight_inputs_hidden, Adjust(rate, hidden_errors, hidden_outputs, input));
# update the weights for the links between the stream_in and hidden layers
@weight_inputs_hidden := Matrix2D->Add(@weight_inputs_hidden, Adjust(rate, hidden_errors, hidden_outputs, stream_in));
# update the weights for the links between the hidden and output layers
@weight_outputs_hidden := Matrix2D->Add(@weight_outputs_hidden, Adjust(rate, output_errors, final_outputs, hidden_outputs));
};
Expand Down
Loading

0 comments on commit d69aca8

Please sign in to comment.