Skip to content

Commit

Permalink
Highlight two classes of Modelica keywords: medium weight and boldface
Browse files Browse the repository at this point in the history
  • Loading branch information
henrikt-ma committed Mar 28, 2021
1 parent 7ecf658 commit 5a7978c
Showing 1 changed file with 27 additions and 16 deletions.
43 changes: 27 additions & 16 deletions mlsshared.sty
Original file line number Diff line number Diff line change
Expand Up @@ -46,26 +46,37 @@
basicstyle=\upshape\ttfamily\smallifpdf, % Font size for displayed code listings.
alsoletter={},
% otherkeywords={-, =, +, [, ], (, ), \{, \}, :, *, !},%
morekeywords=[1]{}, % blue Keywords
morekeywords=[2]{% blue + bold keywords
annotation,assert,block,break,class,connect,connector,constant,constrainedby,discrete,%
each,encapsulated,enumeration,else,elseif,elsewhen,end,%
expandable,extends,external,final,flow,for,%
function,if,in,inner,initial,input,import,loop,model,operator,outer,%
output,package,parameter,partial,record,redeclare,replaceable,return,%
size,% Not a keyword, right?
stream,terminate,then,type,when,while,within,algorithm,equation,%
protected,public,and,false,not,or,true,pure,impure,%
transition,% Not a keyword
initialState% Not a keyword. What about all the other operators in statemachines.tex?
morekeywords=[1]{% Keywords not used to define code structure
der,connect,assert,terminate,break,return,%
false,true,and,not,or,%
final,each,%
flow,stream,%
input,output,%
discrete,parameter,constant,%
},
morekeywords=[2]{% Keywords used to define code structure
annotation,block,class,connector,constrainedby,%
encapsulated,enumeration,else,elseif,elsewhen,end,%
expandable,extends,external,for,%
function,if,in,inner,initial,import,loop,model,operator,outer,%
package,partial,record,redeclare,replaceable,%
then,type,when,while,within,algorithm,equation,%
protected,public,pure,impure,%
},%
% Note: initial is in both variants - depending on context, use first variant
morekeywords=[3]{% red keywords - only special functions and classes: 3.7.2 #derivative-and-special-purpose-operators-with-function-syntax
% 3.7.3 #event-related-operators-with-function-syntax (except initial) and 4.8 #predefined-types-and-classes
der,delay,cardinality,homotopy,semiLinear,inStream,actualStream,spatialDistribution,getInstanceName,%
morekeywords=[3]{% Selected recognized names that are not actual keywords, including:
% 3.7.2 #derivative-and-special-purpose-operators-with-function-syntax
delay,cardinality,homotopy,semiLinear,inStream,actualStream,spatialDistribution,getInstanceName,%
terminal,noEvent,smooth,sample,pre,edge,change,reinit,%
% 3.7.3 #event-related-operators-with-function-syntax (except initial)
previous,hold,subSample,superSample,shiftSample,backSample,noClock,firstTick,interval,%
Real,Integer,Boolean,String},%
% 4.8 #predefined-types-and-classes
Real,Integer,Boolean,String,%
% Highlights from #built-in-array-functions
promote,ndims,size,%
% Assorted things from #state-machines -- what about all the other operators in this chapter?
transition,initialState,%
},%
sensitive=true, % just in case
comment=[l]{//}, % comment lines
morecomment=[s]{/*}{*/}, % comment blocs
Expand Down

0 comments on commit 5a7978c

Please sign in to comment.