Browse Source

Added regex module option.

tags/gm/2021-09-23T00Z/github.com--lark-parser-lark/0.9.0
julienmalard 5 years ago
parent
commit
3fc9733188
5 changed files with 17 additions and 5 deletions
  1. +4
    -1
      lark/lexer.py
  2. +4
    -1
      lark/parser_frontends.py
  3. +4
    -1
      setup.py
  4. +1
    -1
      tests/test_nearley/nearley
  5. +4
    -1
      tests/test_parser.py

+ 4
- 1
lark/lexer.py View File

@@ -1,6 +1,9 @@
## Lexer Implementation

import re
try:
import regex as re
except ImportError:
import re

from .utils import Str, classify, get_regexp_width, Py36, Serialize
from .exceptions import UnexpectedCharacters, LexError, UnexpectedToken


+ 4
- 1
lark/parser_frontends.py View File

@@ -1,4 +1,7 @@
import re
try:
import regex as re
except ImportError:
import re
from functools import partial

from .utils import get_regexp_width, Serialize


+ 4
- 1
setup.py View File

@@ -1,4 +1,7 @@
import re
try:
import regex as re
except ImportError:
import re
from setuptools import find_packages, setup

__version__ ,= re.findall('__version__ = "(.*)"', open('lark/__init__.py').read())


+ 1
- 1
tests/test_nearley/nearley

@@ -1 +1 @@
Subproject commit a46b37471db486db0f6e1ce6a2934fb238346b44
Subproject commit cf8925f729bde741a3076c5856c0c0862bc7f5de

+ 4
- 1
tests/test_parser.py View File

@@ -1,7 +1,10 @@
# -*- coding: utf-8 -*-
from __future__ import absolute_import

import re
try:
import regex as re
except ImportError:
import re
import unittest
import logging
import os


Loading…
Cancel
Save