Sublime Forum

Whats wrong in this syntax definition

#1

Hello All, I am working on a very simple syntax highlighter for a software called “nonmem” which is a front end to fortran. I am not big into regex, so I used all the possible keywords and reserved words to come up with the syntax definition in .Json-tmLanguage. And - it does not seem to work. The only thing which works is the commenting part of the code which is the first match, nothing else works. Please advise. The Json code is pasted below. Thanks, VJ

{ “name”: “nm7”,
“scopeName”: “source.nm7”,
“fileTypes”: “mod”,“ctl”],
“patterns”:
{ “match”: “;.*\n”,
“name”: “comment.source.nm7”,
“comment”: “comment.line”
},

  { "match": "($TABLE|$TABL|$TAB|$THETA|$THET|$THE|$TOL|$WARNINGS|$WARNING|$WARNIN|$WARNI|$WARN|$WAR)",
    "name": "record_names.source.nm7",        
    "comment": "record_names"       
  },


  { "match": "(NPRED|NRES|RES|PREDI|RESI|WRESI|CPRED|CRES|CWRES|CPREDI|CRESI|CWRESI|EPRED|ERES|EWRES|NPDE|ECWRES|ESAMPLE|DEN_|CDEN_)",     
    "name": "record_parameters.source.nm7",
    "comment": "record_names"       
  },

  { "match": "(ADVAN1|ADVAN2|ADVAN3|ADVAN4|ADVAN5|ADVAN6|ADVAN7|ADVAN8|ADVAN9|ADVAN10|ADVAN11|ADVAN12|ADVAN13|TRANS1|TRANS2|TRANS3|TRANS4|TRANS5|TRANS6)",
    "name":"options_subroutines.source.nm7",
    "comment": "options +Subroutines"
  },


  { "match": "(YLO|YUP|ADVAN|AES|CCONTR|CCRIT|CONTR|DES|ERROR|INFN|INLETA|MIX|MODEL|OTHER|PK|PRED|PRIOR|SPTWO|SS|TOL|TRANS|USMETA)",
    "name":"reserved_pk_commons.source.nm7",
    "comment": "Reserved words, PKwords, Commons"
  },

  { "match": "(IBCHNG|IBCLR|IBSET|IEOR|IMAG|INT|INT1|INT2|INT4|INTC|INTERFACE|IOR|ISHA|ISHC|ISHFT|ISHL|JFIX|LACFAR|LOC|LOCKING|LOCNEAR|NOT|SETTIM)",
    "name":"abbreviated_f77.source.nm7",
    "comment": "Abbreviated code, FORTRAN 77 Code and NON-generic FORTAN 77 CODE (might work in NONMEM)"       
  }

],
“uuid”: “f82b6992-1a50-4246-8166-c80918d62b70”
}

0 Likes