| 124 | |
| 125 | |
| 126 | class JSONPairContext(JSONBaseContext): |
| 127 | |
| 128 | def __init__(self, protocol): |
| 129 | super(JSONPairContext, self).__init__(protocol) |
| 130 | self.colon = True |
| 131 | |
| 132 | def doIO(self, function): |
| 133 | if self.first: |
| 134 | self.first = False |
| 135 | self.colon = True |
| 136 | else: |
| 137 | function(COLON if self.colon else COMMA) |
| 138 | self.colon = not self.colon |
| 139 | |
| 140 | def write(self): |
| 141 | self.doIO(self.protocol.trans.write) |
| 142 | |
| 143 | def read(self): |
| 144 | self.doIO(self.protocol.readJSONSyntaxChar) |
| 145 | |
| 146 | def escapeNum(self): |
| 147 | return self.colon |
| 148 | |
| 149 | def __str__(self): |
| 150 | return '%s, colon=%s' % (self.__class__.__name__, self.colon) |
| 151 | |
| 152 | |
| 153 | class LookaheadReader(): |
no outgoing calls
no test coverage detected