Skip to content

Commit eb47752

Browse files
authored
Add lexer for Promela (#906)
1 parent 3f395c9 commit eb47752

22 files changed

+2251
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ translators for Pygments lexers and styles.
5353
| M | Makefile, Mako, markdown, Mason, Materialize SQL dialect, Mathematica, Matlab, mcfunction, Meson, Metal, MiniZinc, MLIR, Modula-2, MonkeyC, MorrowindScript, Myghty, MySQL |
5454
| N | NASM, Natural, Newspeak, Nginx configuration file, Nim, Nix |
5555
| O | Objective-C, OCaml, Octave, Odin, OnesEnterprise, OpenEdge ABL, OpenSCAD, Org Mode |
56-
| P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, properties, Protocol Buffer, PRQL, PSL, Puppet, Python, Python 2 |
56+
| P | PacmanConf, Perl, PHP, PHTML, Pig, PkgConfig, PL/pgSQL, plaintext, Plutus Core, Pony, PostgreSQL SQL dialect, PostScript, POVRay, PowerQuery, PowerShell, Prolog, PromQL, Promela, properties, Protocol Buffer, PRQL, PSL, Puppet, Python, Python 2 |
5757
| Q | QBasic, QML |
5858
| R | R, Racket, Ragel, Raku, react, ReasonML, reg, reStructuredText, Rexx, Ruby, Rust |
5959
| S | SAS, Sass, Scala, Scheme, Scilab, SCSS, Sed, Sieve, Smali, Smalltalk, Smarty, Snobol, Solidity, SourcePawn, SPARQL, SQL, SquidConf, Standard ML, stas, Stylus, Svelte, Swift, SYSTEMD, systemverilog |

lexers/embedded/promela.xml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
2+
<lexer>
3+
<config>
4+
<name>Promela</name>
5+
<alias>promela</alias>
6+
<filename>*.pml</filename>
7+
<filename>*.prom</filename>
8+
<filename>*.prm</filename>
9+
<filename>*.promela</filename>
10+
<filename>*pr</filename>
11+
<filename>*.pm</filename>
12+
<mime_type>text/x-promela</mime_type>
13+
</config>
14+
<rules>
15+
<state name="statements">
16+
<rule pattern="(\[\]|&lt;&gt;|/\\|\\/)|(U|W|V)\b"><token type="Operator"/></rule>
17+
<rule pattern="[@]"><token type="Punctuation"/></rule>
18+
<rule pattern="(\.)([a-zA-Z_]\w*)"><bygroups><token type="Operator"/><token type="NameAttribute"/></bygroups></rule>
19+
<rule><include state="keywords"/></rule>
20+
<rule><include state="types"/></rule>
21+
<rule pattern="([LuU]|u8)?(&quot;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralString"/></bygroups><push state="string"/></rule>
22+
<rule pattern="([LuU]|u8)?(&#x27;)(\\.|\\[0-7]{1,3}|\\x[a-fA-F0-9]{1,2}|[^\\\&#x27;\n])(&#x27;)"><bygroups><token type="LiteralStringAffix"/><token type="LiteralStringChar"/><token type="LiteralStringChar"/><token type="LiteralStringChar"/></bygroups></rule>
23+
<rule pattern="0[xX]([0-9a-fA-F](\&#x27;?[0-9a-fA-F])*\.[0-9a-fA-F](\&#x27;?[0-9a-fA-F])*|\.[0-9a-fA-F](\&#x27;?[0-9a-fA-F])*|[0-9a-fA-F](\&#x27;?[0-9a-fA-F])*)[pP][+-]?[0-9a-fA-F](\&#x27;?[0-9a-fA-F])*[lL]?"><token type="LiteralNumberFloat"/></rule>
24+
<rule pattern="(-)?(\d(\&#x27;?\d)*\.\d(\&#x27;?\d)*|\.\d(\&#x27;?\d)*|\d(\&#x27;?\d)*)[eE][+-]?\d(\&#x27;?\d)*[fFlL]?"><token type="LiteralNumberFloat"/></rule>
25+
<rule pattern="(-)?((\d(\&#x27;?\d)*\.(\d(\&#x27;?\d)*)?|\.\d(\&#x27;?\d)*)[fFlL]?)|(\d(\&#x27;?\d)*[fFlL])"><token type="LiteralNumberFloat"/></rule>
26+
<rule pattern="(-)?0[xX][0-9a-fA-F](\&#x27;?[0-9a-fA-F])*(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?"><token type="LiteralNumberHex"/></rule>
27+
<rule pattern="(-)?0[bB][01](\&#x27;?[01])*(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?"><token type="LiteralNumberBin"/></rule>
28+
<rule pattern="(-)?0(\&#x27;?[0-7])+(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?"><token type="LiteralNumberOct"/></rule>
29+
<rule pattern="(-)?\d(\&#x27;?\d)*(([uU][lL]{0,2})|[lL]{1,2}[uU]?)?"><token type="LiteralNumberInteger"/></rule>
30+
<rule pattern="[~!%^&amp;*+=|?:&lt;&gt;/-]"><token type="Operator"/></rule>
31+
<rule pattern="[()\[\],.]"><token type="Punctuation"/></rule>
32+
<rule pattern="(true|false|NULL)\b"><token type="NameBuiltin"/></rule>
33+
<rule pattern="(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+"><token type="Name"/></rule>
34+
</state>
35+
<state name="types">
36+
<rule pattern="(bit|bool|byte|pid|short|int|unsigned)\b"><token type="KeywordType"/></rule>
37+
</state>
38+
<state name="keywords">
39+
<rule pattern="(atomic|break|d_step|do|od|for|in|goto|if|fi|unless)\b"><token type="Keyword"/></rule>
40+
<rule pattern="(assert|get_priority|printf|printm|set_priority)\b"><token type="NameFunction"/></rule>
41+
<rule pattern="(c_code|c_decl|c_expr|c_state|c_track)\b"><token type="Keyword"/></rule>
42+
<rule pattern="(_|_last|_nr_pr|_pid|_priority|else|np_|STDIN)\b"><token type="NameBuiltin"/></rule>
43+
<rule pattern="(empty|enabled|eval|full|len|nempty|nfull|pc_value)\b"><token type="NameFunction"/></rule>
44+
<rule pattern="(run)\b"><token type="OperatorWord"/></rule>
45+
<rule pattern="(active|chan|D_proctype|hidden|init|local|mtype|never|notrace|proctype|show|trace|typedef|xr|xs)\b"><token type="KeywordDeclaration"/></rule>
46+
<rule pattern="(priority|provided)\b"><token type="Keyword"/></rule>
47+
<rule pattern="(inline|ltl|select)\b"><token type="KeywordDeclaration"/></rule>
48+
<rule pattern="(skip)\b"><token type="Keyword"/></rule>
49+
</state>
50+
<state name="whitespace">
51+
<rule pattern="^#if\s+0"><token type="CommentPreproc"/><push state="if0"/></rule>
52+
<rule pattern="^#"><token type="CommentPreproc"/><push state="macro"/></rule>
53+
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#if\s+0)"><bygroups><usingself state="root"/><token type="CommentPreproc"/></bygroups><push state="if0"/></rule>
54+
<rule pattern="^(\s*(?:/[*].*?[*]/\s*)?)(#)"><bygroups><usingself state="root"/><token type="CommentPreproc"/></bygroups><push state="macro"/></rule>
55+
<rule pattern="(^[ \t]*)(?!(?:public|private|protected|default)\b)((?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+)(\s*)(:)(?!:)"><bygroups><token type="TextWhitespace"/><token type="NameLabel"/><token type="TextWhitespace"/><token type="Punctuation"/></bygroups></rule>
56+
<rule pattern="\n"><token type="TextWhitespace"/></rule>
57+
<rule pattern="[^\S\n]+"><token type="TextWhitespace"/></rule>
58+
<rule pattern="\\\n"><token type="Text"/></rule>
59+
<rule pattern="//(?:.|(?&lt;=\\)\n)*\n"><token type="CommentSingle"/></rule>
60+
<rule pattern="/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/"><token type="CommentMultiline"/></rule>
61+
<rule pattern="/(\\\n)?[*][\w\W]*"><token type="CommentMultiline"/></rule>
62+
</state>
63+
<state name="root">
64+
<rule><include state="whitespace"/></rule>
65+
<rule><include state="keywords"/></rule>
66+
<rule pattern="((?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+(?:[&amp;*\s])+)(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)((?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+)(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)(\([^;&quot;\&#x27;)]*?\))(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)([^;{/&quot;\&#x27;]*)(\{)"><bygroups><usingself state="root"/><usingself state="whitespace"/><token type="NameFunction"/><usingself state="whitespace"/><usingself state="root"/><usingself state="whitespace"/><usingself state="root"/><token type="Punctuation"/></bygroups><push state="function"/></rule>
67+
<rule pattern="((?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+(?:[&amp;*\s])+)(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)((?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}|::)+)(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)(\([^;&quot;\&#x27;)]*?\))(\s*(?:(?:(?://(?:.|(?&lt;=\\)\n)*\n)|(?:/(?:\\\n)?[*](?:[^*]|[*](?!(?:\\\n)?/))*[*](?:\\\n)?/))\s*)*)([^;/&quot;\&#x27;]*)(;)"><bygroups><usingself state="root"/><usingself state="whitespace"/><token type="NameFunction"/><usingself state="whitespace"/><usingself state="root"/><usingself state="whitespace"/><usingself state="root"/><token type="Punctuation"/></bygroups></rule>
68+
<rule><include state="types"/></rule>
69+
<rule><push state="statement"/></rule>
70+
</state>
71+
<state name="statement">
72+
<rule><include state="whitespace"/></rule>
73+
<rule><include state="statements"/></rule>
74+
<rule pattern="\}"><token type="Punctuation"/></rule>
75+
<rule pattern="[{;]"><token type="Punctuation"/><pop depth="1"/></rule>
76+
</state>
77+
<state name="function">
78+
<rule><include state="whitespace"/></rule>
79+
<rule><include state="statements"/></rule>
80+
<rule pattern=";"><token type="Punctuation"/></rule>
81+
<rule pattern="\{"><token type="Punctuation"/><push/></rule>
82+
<rule pattern="\}"><token type="Punctuation"/><pop depth="1"/></rule>
83+
</state>
84+
<state name="string">
85+
<rule pattern="&quot;"><token type="LiteralString"/><pop depth="1"/></rule>
86+
<rule pattern="\\([\\abfnrtv&quot;\&#x27;]|x[a-fA-F0-9]{2,4}|u[a-fA-F0-9]{4}|U[a-fA-F0-9]{8}|[0-7]{1,3})"><token type="LiteralStringEscape"/></rule>
87+
<rule pattern="[^\\&quot;\n]+"><token type="LiteralString"/></rule>
88+
<rule pattern="\\\n"><token type="LiteralString"/></rule>
89+
<rule pattern="\\"><token type="LiteralString"/></rule>
90+
</state>
91+
<state name="macro">
92+
<rule pattern="(\s*(?:/[*].*?[*]/\s*)?)(include)(\s*(?:/[*].*?[*]/\s*)?)(&quot;[^&quot;]+&quot;)([^\n]*)"><bygroups><usingself state="root"/><token type="CommentPreproc"/><usingself state="root"/><token type="CommentPreprocFile"/><token type="CommentSingle"/></bygroups></rule>
93+
<rule pattern="(\s*(?:/[*].*?[*]/\s*)?)(include)(\s*(?:/[*].*?[*]/\s*)?)(&lt;[^&gt;]+&gt;)([^\n]*)"><bygroups><usingself state="root"/><token type="CommentPreproc"/><usingself state="root"/><token type="CommentPreprocFile"/><token type="CommentSingle"/></bygroups></rule>
94+
<rule pattern="[^/\n]+"><token type="CommentPreproc"/></rule>
95+
<rule pattern="/[*](.|\n)*?[*]/"><token type="CommentMultiline"/></rule>
96+
<rule pattern="//.*?\n"><token type="CommentSingle"/><pop depth="1"/></rule>
97+
<rule pattern="/"><token type="CommentPreproc"/></rule>
98+
<rule pattern="(?&lt;=\\)\n"><token type="CommentPreproc"/></rule>
99+
<rule pattern="\n"><token type="CommentPreproc"/><pop depth="1"/></rule>
100+
</state>
101+
<state name="if0">
102+
<rule pattern="^\s*#if.*?(?&lt;!\\)\n"><token type="CommentPreproc"/><push/></rule>
103+
<rule pattern="^\s*#el(?:se|if).*\n"><token type="CommentPreproc"/><pop depth="1"/></rule>
104+
<rule pattern="^\s*#endif.*?(?&lt;!\\)\n"><token type="CommentPreproc"/><pop depth="1"/></rule>
105+
<rule pattern=".*?\n"><token type="Comment"/></rule>
106+
</state>
107+
<state name="classname">
108+
<rule pattern="(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+"><token type="NameClass"/><pop depth="1"/></rule>
109+
<rule pattern="\s*(?=&gt;)"><token type="Text"/><pop depth="1"/></rule>
110+
<rule><pop depth="1"/></rule>
111+
</state>
112+
<state name="case-value">
113+
<rule pattern="(?&lt;!:)(:)(?!:)"><token type="Punctuation"/><pop depth="1"/></rule>
114+
<rule pattern="(?!\d)(?:[\w$]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8})+"><token type="NameConstant"/></rule>
115+
<rule><include state="whitespace"/></rule>
116+
<rule><include state="statements"/></rule>
117+
</state>
118+
</rules>
119+
</lexer>
120+
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// reverse polish
2+
3+
mtype = { operator, value }
4+
5+
chan f = [12] of { mtype, int }
6+
7+
proctype calc(chan you)
8+
{ int s, lft, rgt
9+
chan me = [0] of { int }
10+
11+
if
12+
:: f?operator(s)
13+
run calc(me); me?lft
14+
run calc(me); me?rgt
15+
if
16+
:: s == '+' -> you!(lft+rgt)
17+
fi
18+
:: f?value(s) -> you!s
19+
fi
20+
}
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
[
2+
{"type":"CommentSingle","value":"// reverse polish\n"},
3+
{"type":"TextWhitespace","value":"\n"},
4+
{"type":"KeywordDeclaration","value":"mtype"},
5+
{"type":"TextWhitespace","value":" "},
6+
{"type":"Operator","value":"="},
7+
{"type":"TextWhitespace","value":" "},
8+
{"type":"Punctuation","value":"{"},
9+
{"type":"TextWhitespace","value":" "},
10+
{"type":"Name","value":"operator"},
11+
{"type":"Punctuation","value":","},
12+
{"type":"TextWhitespace","value":" "},
13+
{"type":"Name","value":"value"},
14+
{"type":"TextWhitespace","value":" "},
15+
{"type":"Punctuation","value":"}"},
16+
{"type":"TextWhitespace","value":"\n\n"},
17+
{"type":"KeywordDeclaration","value":"chan"},
18+
{"type":"TextWhitespace","value":" "},
19+
{"type":"Name","value":"f"},
20+
{"type":"TextWhitespace","value":" "},
21+
{"type":"Operator","value":"="},
22+
{"type":"TextWhitespace","value":" "},
23+
{"type":"Punctuation","value":"["},
24+
{"type":"LiteralNumberInteger","value":"12"},
25+
{"type":"Punctuation","value":"]"},
26+
{"type":"TextWhitespace","value":" "},
27+
{"type":"Name","value":"of"},
28+
{"type":"TextWhitespace","value":" "},
29+
{"type":"Punctuation","value":"{"},
30+
{"type":"TextWhitespace","value":" "},
31+
{"type":"KeywordDeclaration","value":"mtype"},
32+
{"type":"Punctuation","value":","},
33+
{"type":"TextWhitespace","value":" "},
34+
{"type":"KeywordType","value":"int"},
35+
{"type":"TextWhitespace","value":" "},
36+
{"type":"Punctuation","value":"}"},
37+
{"type":"TextWhitespace","value":"\n\n"},
38+
{"type":"KeywordDeclaration","value":"proctype"},
39+
{"type":"TextWhitespace","value":" "},
40+
{"type":"Name","value":"calc"},
41+
{"type":"Punctuation","value":"("},
42+
{"type":"KeywordDeclaration","value":"chan"},
43+
{"type":"TextWhitespace","value":" "},
44+
{"type":"Name","value":"you"},
45+
{"type":"Punctuation","value":")"},
46+
{"type":"TextWhitespace","value":"\n"},
47+
{"type":"Punctuation","value":"{"},
48+
{"type":"TextWhitespace","value":"\t"},
49+
{"type":"KeywordType","value":"int"},
50+
{"type":"TextWhitespace","value":" "},
51+
{"type":"Name","value":"s"},
52+
{"type":"Punctuation","value":","},
53+
{"type":"TextWhitespace","value":" "},
54+
{"type":"Name","value":"lft"},
55+
{"type":"Punctuation","value":","},
56+
{"type":"TextWhitespace","value":" "},
57+
{"type":"Name","value":"rgt"},
58+
{"type":"TextWhitespace","value":"\n\t"},
59+
{"type":"KeywordDeclaration","value":"chan"},
60+
{"type":"TextWhitespace","value":" "},
61+
{"type":"Name","value":"me"},
62+
{"type":"TextWhitespace","value":" "},
63+
{"type":"Operator","value":"="},
64+
{"type":"TextWhitespace","value":" "},
65+
{"type":"Punctuation","value":"["},
66+
{"type":"LiteralNumberInteger","value":"0"},
67+
{"type":"Punctuation","value":"]"},
68+
{"type":"TextWhitespace","value":" "},
69+
{"type":"Name","value":"of"},
70+
{"type":"TextWhitespace","value":" "},
71+
{"type":"Punctuation","value":"{"},
72+
{"type":"TextWhitespace","value":" "},
73+
{"type":"KeywordType","value":"int"},
74+
{"type":"TextWhitespace","value":" "},
75+
{"type":"Punctuation","value":"}"},
76+
{"type":"TextWhitespace","value":"\n\n\t"},
77+
{"type":"Keyword","value":"if"},
78+
{"type":"TextWhitespace","value":"\n\t"},
79+
{"type":"Operator","value":"::"},
80+
{"type":"TextWhitespace","value":" "},
81+
{"type":"Name","value":"f"},
82+
{"type":"Operator","value":"?"},
83+
{"type":"Name","value":"operator"},
84+
{"type":"Punctuation","value":"("},
85+
{"type":"Name","value":"s"},
86+
{"type":"Punctuation","value":")"},
87+
{"type":"TextWhitespace","value":"\n\t\t"},
88+
{"type":"OperatorWord","value":"run"},
89+
{"type":"TextWhitespace","value":" "},
90+
{"type":"Name","value":"calc"},
91+
{"type":"Punctuation","value":"("},
92+
{"type":"Name","value":"me"},
93+
{"type":"Punctuation","value":");"},
94+
{"type":"TextWhitespace","value":" "},
95+
{"type":"Name","value":"me"},
96+
{"type":"Operator","value":"?"},
97+
{"type":"Name","value":"lft"},
98+
{"type":"TextWhitespace","value":"\n\t\t"},
99+
{"type":"OperatorWord","value":"run"},
100+
{"type":"TextWhitespace","value":" "},
101+
{"type":"Name","value":"calc"},
102+
{"type":"Punctuation","value":"("},
103+
{"type":"Name","value":"me"},
104+
{"type":"Punctuation","value":");"},
105+
{"type":"TextWhitespace","value":" "},
106+
{"type":"Name","value":"me"},
107+
{"type":"Operator","value":"?"},
108+
{"type":"Name","value":"rgt"},
109+
{"type":"TextWhitespace","value":"\n\t\t"},
110+
{"type":"Keyword","value":"if"},
111+
{"type":"TextWhitespace","value":"\n\t\t"},
112+
{"type":"Operator","value":"::"},
113+
{"type":"TextWhitespace","value":" "},
114+
{"type":"Name","value":"s"},
115+
{"type":"TextWhitespace","value":" "},
116+
{"type":"Operator","value":"=="},
117+
{"type":"TextWhitespace","value":" "},
118+
{"type":"LiteralStringChar","value":"'+'"},
119+
{"type":"TextWhitespace","value":" "},
120+
{"type":"Operator","value":"-\u003e"},
121+
{"type":"TextWhitespace","value":" "},
122+
{"type":"Name","value":"you"},
123+
{"type":"Operator","value":"!"},
124+
{"type":"Punctuation","value":"("},
125+
{"type":"Name","value":"lft"},
126+
{"type":"Operator","value":"+"},
127+
{"type":"Name","value":"rgt"},
128+
{"type":"Punctuation","value":")"},
129+
{"type":"TextWhitespace","value":"\n\t\t"},
130+
{"type":"Keyword","value":"fi"},
131+
{"type":"TextWhitespace","value":"\n\t"},
132+
{"type":"Operator","value":"::"},
133+
{"type":"TextWhitespace","value":" "},
134+
{"type":"Name","value":"f"},
135+
{"type":"Operator","value":"?"},
136+
{"type":"Name","value":"value"},
137+
{"type":"Punctuation","value":"("},
138+
{"type":"Name","value":"s"},
139+
{"type":"Punctuation","value":")"},
140+
{"type":"TextWhitespace","value":" "},
141+
{"type":"Operator","value":"-\u003e"},
142+
{"type":"TextWhitespace","value":" "},
143+
{"type":"Name","value":"you"},
144+
{"type":"Operator","value":"!"},
145+
{"type":"Name","value":"s"},
146+
{"type":"TextWhitespace","value":"\n\t"},
147+
{"type":"Keyword","value":"fi"},
148+
{"type":"TextWhitespace","value":"\n"},
149+
{"type":"Punctuation","value":"}"},
150+
{"type":"TextWhitespace","value":"\n"}
151+
]

lexers/testdata/promela/do.actual

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
init {
2+
a ? b -> a ! b;
3+
}
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
[
2+
{"type":"KeywordDeclaration","value":"init"},
3+
{"type":"TextWhitespace","value":" "},
4+
{"type":"Punctuation","value":"{"},
5+
{"type":"TextWhitespace","value":"\n "},
6+
{"type":"Name","value":"a"},
7+
{"type":"TextWhitespace","value":" "},
8+
{"type":"Operator","value":"?"},
9+
{"type":"TextWhitespace","value":" "},
10+
{"type":"Name","value":"b"},
11+
{"type":"TextWhitespace","value":" "},
12+
{"type":"Operator","value":"-\u003e"},
13+
{"type":"TextWhitespace","value":" "},
14+
{"type":"Name","value":"a"},
15+
{"type":"TextWhitespace","value":" "},
16+
{"type":"Operator","value":"!"},
17+
{"type":"TextWhitespace","value":" "},
18+
{"type":"Name","value":"b"},
19+
{"type":"Punctuation","value":";"},
20+
{"type":"TextWhitespace","value":"\n"},
21+
{"type":"Punctuation","value":"}"},
22+
{"type":"TextWhitespace","value":"\n"}
23+
]
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
init {
2+
intercepted.key = data.key
3+
r.b[a] = a * 4 + 7;
4+
}

0 commit comments

Comments
 (0)