-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] Preprocessor #19
base: new-feline
Are you sure you want to change the base?
[DO NOT MERGE] Preprocessor #19
Conversation
Produces a representation of the parsed css, warns about duplicate variable declarations.
The second one splits the styles by tags with selectors and we get all styles for each tag (incl. selectors and subclasses), but for now we get a lot of duplicate styles. The current goal is to find out why we get so many duplicate styles and either prevent it or (anyway) filter them. After that the resulting css file/structure will be transformed into a tree.
Ты переписываешь всё с нуля? Может, в новом репозитории? |
|
||
string = "" | ||
|
||
if not filecmp.cmp("../testdata/initial.txt.txt", "../testdata/output.txt.txt"): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.txt.txt
replaced lists of tuples by dictionaries Added sorting and filtering of attributes disregarding their values.
…structure of our mapcss files.
|
||
class BlockSplitter: | ||
""" | ||
Should also be initializeable by a preprocessed file |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
В докстрингах хорошо писать документацию к классу, а это больше похоже на коммент.
VARIABLE = re.compile(r'^\s*(@(?!import).*?)\s*?:\s*?(.*?);', re.DOTALL | re.MULTILINE) | ||
BLOCK = re.compile(r'^\s*([^@{]*\{.*?\})', re.DOTALL | re.MULTILINE) | ||
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please do not use doc-string as a comment.
We have finally finished writing the tree, and it seems to work so far.
Removed some unnecessary classes.
Some refactoring and some preprocessing.
I did the refactoring to try and figure out how the original system works.
As far as preprocessing is concerned, I am trying to inflate the mapcss file iteratively spitting out intermediate inflated files to check whether they are correct or not. In the future it might be possible to start the process from one of the intermediate preprocessed files.