Sublime Forum

Can I parse a line of text (main file) for use in build system?

#1

Sorry if I made the wrong subject, but I’m very new to Sublime Text, but for so far it fits my needs perfectly, but I want a little more. :slight_smile:

I want to use Sublime text (build 4200) for programming Microchip processors, I already have a package for highlighting PIC assembler code in Sublime Text, one of the reasons I choose for Sublime Text.

I also made a (bash) script as a wrapper for mpasmx, calling this script from Build System works perfectly!

This my Build systems entry;
{
“shell_cmd”: “compile_bw “$file””,

// Dit voorkomt TERM environment variable not set.
// Alleen bij scherm aansturing zoals clear en \e[93m]
"env": {"TERM": "xterm-256color"}

}

compile_bw is my bash script to compile PIC assemble code (this works fine from Sublime Text) but I can send a second parameter to my script with the processor type, and this is what I would like to use.

In my assembler source file I have a directive like this;

#include <p16f628a.inc> This I would like to parse down to 16f628a and send this as a second parameter to call my compile script in Build Sytems.

I searched for many hours but could not find anything on this topic, and I don’t know JSON format very well, maybe somebody here can help me.

Best regards Mark

0 Likes

#2

Parsing the input file to extract information and pass them somewhere would be best implemented in your compile_bw script or another wrapper script.

0 Likes