Hi,

When cleaning up my code to make it uploadable through the minicom
plugin as well I noted that commented #include's are not recognized by
the shell (though promised). Below is a patch that straightens things
up.

Also, I seek confirmation that amforth will not change it's single line
only ( comment ) behavior to make the following uploadable both by
amforth and by shell (which recognizes multiple line comments). Example:

(
\ PORTE
&46 constant PORTE                      \ Data Register, Port E
&45 constant DDRE                       \ Data Direction Register, Port E
&44 constant PINE                       \ Input Pins, Port E
)

Thank you, Enoch.

Index: tools/amforth-shell.py
===================================================================
--- tools/amforth-shell.py      (revision 1300)
+++ tools/amforth-shell.py      (working copy)
@@ -711,18 +711,20 @@
                 result[-1] += " " + w[:i+1]
                 result[-1] = result[-1][1:]  # remove extra initial space
                 w = w[i+1:]
+
             if in_delim_comment:
                 try:
-                   i = w.index(")")
+                    i = w.index(")")
                 except ValueError:
-                   continue
-                in_delim_comment = False
-                w = w[i+1:]
+                    pass
+                else:
+                    in_delim_comment = False
+                    w = w[i+1:]
 
             if not w:
                 continue
             if w in self._amforth_regs:
-              w = self._amforth_regs[w]
+                w = self._amforth_regs[w]
 
             if char_quote:
                 result.append(w)
@@ -739,7 +741,7 @@
             if not in_delim_comment and not in_line_comment:
                 if w == "\\":
                     in_line_comment = True
-                    break
+                    continue
 
                 elif w in self._config.current_behavior.start_string_words:
                     in_string = True


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel

Reply via email to