Mercurial > lcfOS
comparison python/ppci/c3/parser.py @ 313:04cf4d26a3bc
Added constant function
author | Windel Bouwman |
---|---|
date | Wed, 18 Dec 2013 18:02:26 +0100 |
parents | ff665880a6b0 |
children | 084cccaa5deb |
comparison
equal
deleted
inserted
replaced
312:2c9768114877 | 313:04cf4d26a3bc |
---|---|
153 while True: | 153 while True: |
154 name = self.Consume('ID') | 154 name = self.Consume('ID') |
155 self.Consume('=') | 155 self.Consume('=') |
156 val = self.Expression() | 156 val = self.Expression() |
157 c = Constant(name.val, t, val) | 157 c = Constant(name.val, t, val) |
158 self.addDeclaration(c) | |
158 c.loc = name.loc | 159 c.loc = name.loc |
159 if not self.hasConsumed(','): | 160 if not self.hasConsumed(','): |
160 break | 161 break |
161 self.Consume(';') | 162 self.Consume(';') |
162 | 163 |