<s> import unittest <EOL> from pynes . compiler import lexical , syntax , semantic <EOL> class IncTest ( unittest . TestCase ) : <EOL> def test_inc_zp ( self ) : <EOL> tokens = list ( lexical ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( <NUM_LIT:2> , len ( tokens ) ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:type>' ] ) <EOL> ast = syntax ( tokens ) <EOL> self . assertEquals ( <NUM_LIT:1> , len ( ast ) ) <EOL> self . assertEquals ( '<STR_LIT>' , ast [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> code = semantic ( ast ) <EOL> self . assertEquals ( code , [ <NUM_LIT> , <NUM_LIT> ] ) <EOL> def test_inc_zpx ( self ) : <EOL> tokens = list ( lexical ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( <NUM_LIT:4> , len ( tokens ) ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:2> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:3> ] [ '<STR_LIT:type>' ] ) <EOL> ast = syntax ( tokens ) <EOL> self . assertEquals ( <NUM_LIT:1> , len ( ast ) ) <EOL> self . assertEquals ( '<STR_LIT>' , ast [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> code = semantic ( ast ) <EOL> self . assertEquals ( code , [ <NUM_LIT> , <NUM_LIT> ] ) <EOL> def test_inc_abs ( self ) : <EOL> tokens = list ( lexical ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( <NUM_LIT:2> , len ( tokens ) ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:value>' ] ) <EOL> ast = syntax ( tokens ) <EOL> self . assertEquals ( <NUM_LIT:1> , len ( ast ) ) <EOL> self . assertEquals ( '<STR_LIT>' , ast [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> code = semantic ( ast ) <EOL> self . assertEquals ( code , [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) <EOL> def test_inc_absx ( self ) : <EOL> tokens = list ( lexical ( '<STR_LIT>' ) ) <EOL> self . assertEquals ( <NUM_LIT:4> , len ( tokens ) ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:1> ] [ '<STR_LIT:value>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:2> ] [ '<STR_LIT:type>' ] ) <EOL> self . assertEquals ( '<STR_LIT>' , tokens [ <NUM_LIT:3> ] [ '<STR_LIT:type>' ] ) <EOL> ast = syntax ( tokens ) <EOL> self . assertEquals ( <NUM_LIT:1> , len ( ast ) ) <EOL> self . assertEquals ( '<STR_LIT>' , ast [ <NUM_LIT:0> ] [ '<STR_LIT:type>' ] ) <EOL> code = semantic ( ast ) <EOL> self . assertEquals ( code , [ <NUM_LIT> , <NUM_LIT> , <NUM_LIT> ] ) </s>
