Skip to content

Commit

Permalink
Import statement and string representation fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
jonashaag committed Jul 15, 2010
1 parent c2c1feb commit 4475a50
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions hello.snow
@@ -0,0 +1,5 @@
import stdio

main as Function(argc as Int, argv as String*) -> Int:
printf("Hello, ☃!")
return 0
2 changes: 1 addition & 1 deletion snowman/backends/c/__init__.py
Expand Up @@ -72,7 +72,7 @@ def visit_Integer(self, node):
visit_Float = visit_Integer

def visit_String(self, node):
return '"%s"' % node.children['value']
return '"%s"' % repr(node.children['value'])[1:-1]

def visit_Declaration(self, node):
return fmt('{type} {name}',
Expand Down
2 changes: 1 addition & 1 deletion snowman/nodes.py
Expand Up @@ -180,7 +180,7 @@ class If(Statement):
attributes = ['expr', 'block', ('else_block', None)]

class ImportStatement(Statement):
attributes = ['name']
attributes = ['path']

class Loop(Statement):
abstract = True
Expand Down

0 comments on commit 4475a50

Please sign in to comment.