How to use the chameleon.core.types.definitions function in Chameleon

To help you get started, we’ve selected a few Chameleon examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github malthe / chameleon / src / chameleon / zpt / expressions.py View on Github external
expr = self.tales(string[i:j], ';')
                except SyntaxError:
                    if string.rfind(';', i, j) > 0:
                        continue
                    raise

                break

            defines.append((var, expr))

            if j < 0:
                break

            i = j + 1

        return types.definitions(defines)
github malthe / chameleon / src / chameleon / genshi / expressions.py View on Github external
expr = self.expression(string[i:j])
                except SyntaxError, e:
                    if string.rfind(';', i, j) > 0:
                        continue
                    raise e
                
                break
                
            defines.append((var, expr))

            if j < 0:
                break
            
            i = j + 1

        return types.definitions(defines)
github malthe / chameleon / src / chameleon / zpt / language.py View on Github external
def assign(self):
            content = self._content
            if content is not None:
                definition = (
                    types.declaration((self.content_symbol,)),
                    content)
                return types.definitions((definition,))