Skip to content

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.

mapsmetest added 2 commits May 6, 2016 17:49
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