Skip to content
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

Open
wants to merge 13 commits into
base: new-feline
Choose a base branch
from

Conversation

therearesomewhocallmetim

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.

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.
@Zverik
Copy link

Zverik commented Apr 15, 2016

Ты переписываешь всё с нуля? Может, в новом репозитории?


string = ""

if not filecmp.cmp("../testdata/initial.txt.txt", "../testdata/output.txt.txt"):
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.txt.txt

+ tracing which file a particular style description was imported
+ warnings if we have several identical style descriptions in one block
    + in several blocks
    + in different files
+ filtering duplicate style descriptions
     replaced lists of tuples by dictionaries
Added sorting and filtering of attributes disregarding their values.

class BlockSplitter:
"""
Should also be initializeable by a preprocessed file
Copy link

@mgsergio mgsergio May 6, 2016

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)

"""
Copy link

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants