Skip to content

Commit b6c6446

Browse files
committed
Fix for more than 2 Alex startcodes
1 parent 3db56e0 commit b6c6446

File tree

2 files changed

+12
-18
lines changed

2 files changed

+12
-18
lines changed

syntaxes/alex.YAML-tmLanguage

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,21 +25,19 @@ repository:
2525
patterns:
2626
- name: variable.other.startcode.alex
2727
match: ([\p{Ll}\p{Lu}_][\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.']*)
28+
- name: punctuation.comma.startcode.alex
29+
match: ','
2830
blocks:
2931
patterns:
3032
- name: meta.block.startcode.alex
31-
begin: (<)\s*([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.']*)(?:\s*(,)\s*([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.']*))*\s*(>)\s*(\{)
33+
begin: (<)([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.'\s,]*)(>)\s*(\{)
3234
beginCaptures:
3335
"1": { name: punctuation.bracket.startcode.alex }
3436
"2":
3537
patterns:
3638
- include: '#startcode'
37-
"3": { name: punctuation.comma.startcode.alex }
38-
"4":
39-
patterns:
40-
- include: '#startcode'
41-
"5": { name: punctuation.bracket.startcode.alex }
42-
"6": { name: punctuation.block.startcode.begin.alex }
39+
"3": { name: punctuation.bracket.startcode.alex }
40+
"4": { name: punctuation.block.startcode.begin.alex }
4341
end: "}"
4442
endCaptures:
4543
"0": { name: punctuation.block.startcode.end.alex }
@@ -80,17 +78,13 @@ repository:
8078
- name: punctuation.semicolon.alex
8179
match: \;
8280
- name: meta.startcode.alex
83-
match: (<)\s*([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.']*)(?:\s*(,)\s*([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.']*))*\s*(>)
81+
match: (<)([\p{Ll}_\p{Lu}\p{Lt}\p{Nd}\.'\s,]*)(>)
8482
captures:
8583
"1": { name: punctuation.bracket.startcode.alex }
8684
"2":
8785
patterns:
8886
- include: '#startcode'
89-
"3": { name: punctuation.comma.startcode.alex }
90-
"4":
91-
patterns:
92-
- include: '#startcode'
93-
"5": { name: punctuation.bracket.startcode.alex }
87+
"3": { name: punctuation.bracket.startcode.alex }
9488
strings:
9589
patterns:
9690
- name: string.quoted.double.alex

test/tests/Alex.x

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ tokens :-
3838
-- ^ punctuation.block.end.alex
3939
<0,1> $alpha+ { IDENT }
4040
--^ punctuation.comma.startcode.alex
41-
<foo,bar> {
42-
-- <--------- meta.block.startcode.alex
41+
<foo,bar, baz , qu_ux > {
42+
-- <------------------------ meta.block.startcode.alex
4343
-- <- punctuation.bracket.startcode.alex
44-
-- ^ punctuation.bracket.startcode.alex
45-
-- ^^^ variable.other.startcode.alex
46-
-- ^ punctuation.block.startcode.begin.alex
44+
-- ^^^ ^^^ ^^^^^ variable.other.startcode.alex
45+
-- ^ punctuation.bracket.startcode.alex
46+
-- ^ punctuation.block.startcode.begin.alex
4747
\n ;
4848
-- ^ punctuation.semicolon.alex
4949
@foobar { FOO }

0 commit comments

Comments
 (0)