Skip to content

Commit

Permalink
Add Russian symbols to identifiers regex
Browse files Browse the repository at this point in the history
  • Loading branch information
a-gorbunov committed Sep 15, 2020
1 parent b053ca3 commit 8bc1f6e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/Lexer.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
*/

const numericRegex = /^-?(?:(?:[0-9]*\.[0-9]+)|[0-9]+)$/
const identRegex = /^[a-zA-Z_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/
const identRegex = /^[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][a-zA-Zа-яА-Я0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*$/
const escEscRegex = /\\\\/
const whitespaceRegex = /^\s*$/
const preOpRegexElems = [
Expand All @@ -19,7 +19,7 @@ const preOpRegexElems = [
]
const postOpRegexElems = [
// Identifiers
'[a-zA-Z_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\\$][a-zA-Z0-9_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\\$]*',
'[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\\$][a-zA-Z0-9а-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF\\$]*',
// Numerics (without negative symbol)
'(?:(?:[0-9]*\\.[0-9]+)|[0-9]+)'
]
Expand Down

0 comments on commit 8bc1f6e

Please sign in to comment.