Duet3D Logo Duet3D
    • Tags
    • Documentation
    • Order
    • Register
    • Login

    Syntax Highlighter for RepRap Gcode

    Scheduled Pinned Locked Moved
    Gcode meta commands
    1
    1
    500
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • garethkyundefined
      garethky
      last edited by

      I've started work on an syntax highlighter grammar for RepRap GCode. These are the results (of some absolute garbage code) in Sublime Text 3:

      Screen Shot 2021-01-08 at 12.37.13 AM.png

      So far it knows about G, M & T commands, expressions, language keywords, comments etc. Open source of course: https://github.com/garethky/RepRapGCodeSyntaxHighlighter/tree/development
      (I'm pointing you to the development branch because its not ready for a mainline release yet)

      I didn't want to do this for just my editor, so I found a tool called Iro. Iro uses a generic grammar and then generates the highlighter files for a slew of popular text editors. Its not perfect, its not open source and I have already found some bugs, but it got me 95% the way there for 1 editor so far (and apparently Sublime is the editor with the weakest support). If you are an editor guru and want to help out I would like your support:

      • You can generate the grammar for your editor using the .rion file on github and test your editor and tell me if it works or not
      • You can contribute the Scope mappings for Pygments & Rogue
      • You want to fix something or make something better, please submit a patch on github
      1 Reply Last reply Reply Quote 6
      • T3P3Tonyundefined T3P3Tony unpinned this topic
      • First post
        Last post
      Unless otherwise noted, all forum content is licensed under CC-BY-SA