Finish implementing getCharacter(SymbolType) #37

Closed
opened 2022-12-12 11:10:57 +00:00 by deavmi · 1 comment
Owner

We need to finish implementing the function:

/** 
 * Returns the corresponding character for a given SymbolType
 *
 * For example <code>SymbolType.ADD</code> returns +
 *
 * Params:
 *   symbolIn = The symbol to lookup against
 * Returns: The corresponding character
 *
 */
public string getCharacter(SymbolType symbolIn)
{
    if(symbolIn == SymbolType.ADD)
    {
        return "+";
    }
    else
    {
        gprintln("getCharacter: No back-mapping for "~to!(string)(symbolIn), DebugType.ERROR);
        assert(false);
    }
}

It must support the following:

  • SymbolType.ADD -> +
  • SymbolType.SUBTRACT -> -
  • SymbolType.MULTIPLY -> *
  • SymbolType.DIVIDE -> /
We need to finish implementing the function: ```d /** * Returns the corresponding character for a given SymbolType * * For example <code>SymbolType.ADD</code> returns + * * Params: * symbolIn = The symbol to lookup against * Returns: The corresponding character * */ public string getCharacter(SymbolType symbolIn) { if(symbolIn == SymbolType.ADD) { return "+"; } else { gprintln("getCharacter: No back-mapping for "~to!(string)(symbolIn), DebugType.ERROR); assert(false); } } ``` It must support the following: - [x] `SymbolType.ADD` -> `+` - [x] `SymbolType.SUBTRACT` -> `-` - [x] `SymbolType.MULTIPLY` -> `*` - [x] `SymbolType.DIVIDE` -> `/`
deavmi added reference vardec_varass_dependency 2022-12-12 11:11:03 +00:00
deavmi self-assigned this 2022-12-12 11:11:07 +00:00
deavmi added the
needsfix
label 2022-12-12 11:11:15 +00:00
deavmi added this to the (deleted) project 2022-12-12 11:36:54 +00:00
deavmi added the
emit
label 2022-12-12 11:36:58 +00:00
deavmi added this to the Code emit project 2022-12-12 11:37:53 +00:00
Author
Owner

Completed with commit 8978a74a21 on the branch of this issue

Completed with commit 8978a74a21f4a4e37a157b5f05729b7774604e3b on the branch of this issue
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: tlang/tlang#37
No description provided.