First but not optimized version of AstFormatDict
This commit is contained in:
+10
-1
@@ -2,11 +2,11 @@ import ast
|
||||
import importlib
|
||||
import inspect
|
||||
import pkgutil
|
||||
import re
|
||||
|
||||
from cache.Cache import Cache
|
||||
from core.ast_helpers import ast_to_props
|
||||
from core.tokenizer import TokenKind, Tokenizer
|
||||
from pyparsing import *
|
||||
|
||||
default_debug_name = "*default*"
|
||||
debug_activated = set()
|
||||
@@ -38,6 +38,15 @@ PRIMITIVES_TYPES = (str, bool, type(None), int, float, list, dict, set, bytes, t
|
||||
|
||||
expressions_cache = Cache()
|
||||
|
||||
ESC = Literal('\x1b')
|
||||
integer = Word(nums)
|
||||
escapeSeq = Combine(ESC + '[' + Optional(delimitedList(integer, ';')) +
|
||||
oneOf(list(alphas)))
|
||||
|
||||
|
||||
def no_color_str(text):
|
||||
return Suppress(escapeSeq).transformString(str(text))
|
||||
|
||||
|
||||
def my_debug(*args, check_started=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user