Skip to content

Commit c766d69

Browse files
committed
Handle greek letters in identifiers
Refs atom/language-python#281
1 parent 06f1d02 commit c766d69

File tree

4 files changed

+6225
-6121
lines changed

4 files changed

+6225
-6121
lines changed

corpus/expressions.txt

+13
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
=====================================
2+
Identifiers with Greek letters
3+
=====================================
4+
5+
ψ1 = β_γ + Ψ_5
6+
7+
---
8+
9+
(module
10+
(expression_statement (assignment
11+
(expression_list (identifier))
12+
(expression_list (binary_operator (identifier) (identifier))))))
13+
114
=====================================
215
Subscript expressions
316
=====================================

grammar.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,7 @@ module.exports = grammar({
787787
)
788788
),
789789

790-
identifier: $ => /[a-zA-Z_]\w*/,
790+
identifier: $ => /[a-zA-Zα-ωΑ-Ω_][a-zA-Zα-ωΑ-Ω_0-9]*/,
791791

792792
keyword_identifier: $ => alias(choice('print', 'exec'), $.identifier),
793793

src/grammar.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3927,7 +3927,7 @@
39273927
},
39283928
"identifier": {
39293929
"type": "PATTERN",
3930-
"value": "[a-zA-Z_]\\w*"
3930+
"value": "[a-zA-Zα-ωΑ-Ω_][a-zA-Zα-ωΑ-Ω_0-9]*"
39313931
},
39323932
"keyword_identifier": {
39333933
"type": "ALIAS",

0 commit comments

Comments
 (0)