Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMarion <marion.zepf@gmail.com>2013-08-30 09:05:20 (GMT)
committer Marion <marion.zepf@gmail.com>2013-08-30 09:05:20 (GMT)
commitfab6f98e251a6ef0e290a550060da6dadaed5a73 (patch)
treee9dea14799c86834436303ae75ecfc51c5972f28 /plugins
parent40fae3be9951049e919a9583a64aad8cfac154f8 (diff)
Primitive for 'comment' block and Comment AST class to make it exportable
- Primitive object for the 'comment' block using the new Primitive.comment function. - Special handling of Primitives using Primitive.comment during export. - New util.ast_extensions module containing extensions to the built-in `ast` module. Currently it contains the Comment class for inline comments. - New visit_Comment method in util.codegen to serialize inline comments.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/turtle_blocks_extras/turtle_blocks_extras.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/turtle_blocks_extras/turtle_blocks_extras.py b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
index d6d4b29..d3865c7 100644
--- a/plugins/turtle_blocks_extras/turtle_blocks_extras.py
+++ b/plugins/turtle_blocks_extras/turtle_blocks_extras.py
@@ -38,7 +38,8 @@ from TurtleArt.tautils import (round_int, debug_output, get_path,
data_to_string, find_group, image_to_base64,
hat_on_top, listify, data_from_file)
from TurtleArt.tajail import (myfunc, myfunc_import)
-from TurtleArt.taprimitive import Primitive
+from TurtleArt.taprimitive import (ArgSlot, ConstantArg, Primitive)
+from TurtleArt.tatype import TYPE_STRING
def _num_type(x):
@@ -533,8 +534,7 @@ make "tmp first :taheap\nmake "taheap butfirst :taheap\noutput :tmp\nend\n')
string_or_number=True,
help_string=_('places a comment in your code'))
self.tw.lc.def_prim('comment', 1,
- lambda self, x:
- primitive_dictionary['print'](x, True))
+ Primitive(Primitive.comment, arg_descs=[ArgSlot(TYPE_STRING)]))
palette.add_block('print',
style='basic-style-1arg',