Skip to content

Commit

Permalink
fixed associated array for variable reference codes
Browse files Browse the repository at this point in the history
the variable reference code was incorrectly set to the constant
associated code array; updated expected encoder test #1 results
  • Loading branch information
thunder422 committed Sep 7, 2013
1 parent 94ca269 commit 88913ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion table.cpp
Expand Up @@ -1083,7 +1083,7 @@ static TableEntry tableEntries[] =
{ // VarRef_Code
IntFuncN_TokenType, OneWord_Multiple,
"", "VarRef", HasOperand_Flag, 2, Double_DataType,
new ExprInfo(Null_Code, Operands(Dbl), AssocCode(Const))
new ExprInfo(Null_Code, Operands(Dbl), AssocCode(VarRef))
},
{ // VarRefInt_Code
IntFuncN_TokenType, OneWord_Multiple,
Expand Down
4 changes: 2 additions & 2 deletions test/encoder01.txt
Expand Up @@ -6,13 +6,13 @@ Input: PRINT A
Output: Var |A| PrintDbl PRINT

Input: B%=6
Output: ConstInt |B%| ConstInt |6| Assign%
Output: VarRefInt |B%| ConstInt |6| Assign%

Input: PRINT B%
Output: VarInt |B%| PrintInt PRINT

Input: C$="Test"
Output: ConstStr |C$| ConstStr |Test| Assign$
Output: VarRefStr |C$| ConstStr |Test| Assign$

Input: PRINT C$
Output: VarStr |C$| PrintStr PRINT
Expand Down

0 comments on commit 88913ed

Please sign in to comment.