Skip to content

Commit

Permalink
18064: Adds previous_result opcode, enhances while opcode, renames ta…
Browse files Browse the repository at this point in the history
…rget_* opcodes to current_*, changes reduce opcode, MAJOR (#29)

Makes it easier to code reduction operations while enhancing performance
and reducing memory usage.
  • Loading branch information
howsohazard authored Nov 7, 2023
1 parent 6d6c8e1 commit 450179f
Show file tree
Hide file tree
Showing 15 changed files with 569 additions and 412 deletions.
56 changes: 32 additions & 24 deletions docs/language.js

Large diffs are not rendered by default.

5 changes: 3 additions & 2 deletions src/Amalgam/Opcodes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ void StringInternPool::InitializeStaticStrings()

//stack and node manipulation
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_TARGET), "target");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_TARGET_INDEX), "target_index");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_TARGET_VALUE), "target_value");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_CURRENT_INDEX), "current_index");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_CURRENT_VALUE), "current_value");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_PREVIOUS_RESULT), "previous_result");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_STACK), "stack");
EmplaceStaticString(GetStringIdFromNodeTypeFromString(ENT_ARGS), "args");

Expand Down
7 changes: 4 additions & 3 deletions src/Amalgam/Opcodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,9 @@ enum EvaluableNodeType : uint8_t

//stack and node manipulation
ENT_TARGET,
ENT_TARGET_INDEX,
ENT_TARGET_VALUE,
ENT_CURRENT_INDEX,
ENT_CURRENT_VALUE,
ENT_PREVIOUS_RESULT,
ENT_STACK,
ENT_ARGS,

Expand Down Expand Up @@ -372,7 +373,7 @@ constexpr OrderedChildNodeType GetInstructionOrderedChildNodeType(EvaluableNodeT
case ENT_CALL: case ENT_CALL_SANDBOXED:
case ENT_RETRIEVE:
case ENT_GET:
case ENT_TARGET: case ENT_TARGET_INDEX: case ENT_TARGET_VALUE:
case ENT_TARGET: case ENT_CURRENT_INDEX: case ENT_CURRENT_VALUE: case ENT_PREVIOUS_RESULT:
case ENT_STACK: case ENT_ARGS:
case ENT_RAND: case ENT_WEIGHTED_RAND: case ENT_GET_RAND_SEED: case ENT_SET_RAND_SEED:
case ENT_SYSTEM_TIME:
Expand Down
Loading

0 comments on commit 450179f

Please sign in to comment.