def p_variable__IDENTIFIER(self, p): """ variable : IDENTIFIER """ #print 'variable : IDENTIFIER' #print p[1] p.slice[0].cursor_end = p.slice[-1].cursor_end p[0] = abjad_scheme.Scheme(p[1])
def p_list__L_PAREN__data__datum__PERIOD__datum__R_PAREN(self, p): """ list : L_PAREN data datum PERIOD datum R_PAREN """ p.slice[0].cursor_end = p.slice[-1].cursor_end result = p[2] + [p[3]] + [p[5]] if len(result) == 2: p[0] = abjad_scheme.SchemePair(tuple(result)) else: p[0] = abjad_scheme.Scheme(result) self.expression_depth -= 1
def p_expression__QUOTE__datum(self, p): """ expression : QUOTE datum """ #print 'expression : QUOTE datum' #print p[2] p.slice[0].cursor_end = p.slice[-1].cursor_end datum = p[2] if isinstance(datum, abjad_scheme.Scheme): if datum._quoting: datum._quoting = "'" + datum._quoting else: datum._quoting = "'" p[0] = datum else: p[0] = abjad_scheme.Scheme(datum, quoting="'")