On Mon, Jan 24, 2011 at 9:39 AM, Stephen Wille Padnos <[email protected]>wrote:
> I haven't looked at that particular file, but I can point out a few > things that were "interesting" when making the gedit hilighter. (I > didn't do it, but I did help out somewhat in the form of IRC > conversations with the person who did the actual work) > > 1) Whitespace is irrelevant to the G-code parser. "X12.34" is identical > to "X1 2. 3 4" in EMC. > Yes, I'm thinking about this. I doubt it's worth the effort of parsing numbers that have embedded spaces. Do people actually do this? Spaces after the axis letters should be handled though. > 2) G-code is case insensitive. I noticed in the lisp snippet that you > have various keywords in all caps and all lower case, but not mixed > case, which is also legal in EMC. So any of "and", "anD", "aNd", "aND", > "And", "AnD", "ANd", and "AND" are valid G-code. > Yes, it's not pretty. I could write a function that would expand a keyword into all possible combinations of upper and lower case, but that's probably going too far. Maybe I should just add a version where the first letter is capitalized. My personal opinion is that if someone writes 'aNd' they probably didn't intend it, so it would be helpful if it showed up in a different color. But I don't know much about how G-Code is normally written and used, so I'm prepared to be corrected. > 3) My opinion is that the numbers should be colored differently than the > words they go with. so in G0X12.34, G should be one color, the two > numbers "0" and "12.34" should be another color, and "X", being an axis > word, should be a different color. I don't know if the code is capable > of doing that, since the screenshot shows codes and numbers as having > one style (like "g0") > This can be fixed, I'm looking at it. Also, I'm going to recognize line numbers separately, and make them light grey so they don't stand out so much, based on the files Jack sent, which have thousands of line numbers and appear very cluttered. This is exactly what syntax highlighting is supposed to help with. ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ Emc-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/emc-users
