daviis / PyDucker

A static ducking tool for python 3 source code
2 stars 2 forks source link

DocParser and Strings/Tuples/Dicts #26

Closed JakeAlbee closed 9 years ago

JakeAlbee commented 9 years ago

Doc parser is going to need a partial overhaul to handle all the different dicts, lists and tuples.

Need to handle lists of the inhomogeneous variety, dictionaries somehow, both known item types and unknown, i.e.

x = {1,unkownType}

Tuples will be handled the same way dictionaries are where if both items are the same thing it will be denoted as ^int:int or int:int^ and if its unknown what will be in there just ^.

Lists are already handled type or type, if its just a * it is assumed inhomogeneous.

I'll leave a comment later denoting exactly how to write the dict, list and tuple doc strings after I have a version working.

JakeAlbee commented 9 years ago

Added the ability to input the type of the lists, tuples and dictionaries. For dictionaries it is @varName:[]keyType:itemType[], for Tuples it is @varName:[^]tupleType[^] for lists it is @varName:[]listType[].

This iteration also adds the homo and compType variables to VarBean. These were added to aid in the typing from the doc string parser. They default to False for homo and None for compType if not manually set.

This is primarily handled in the pull request #27.

JakeAlbee commented 9 years ago

This is done and will be closed.

daviis commented 9 years ago

What about multiple dimensional arrays?

JakeAlbee commented 9 years ago

Nested lists?

daviis commented 9 years ago

Yes, that sort of thing. But it could be any iterable.

On Mon, Nov 24, 2014 at 3:35 PM, Jake Albee notifications@github.com wrote:

Nested lists?

— Reply to this email directly or view it on GitHub https://github.com/daviis/PyDucker/issues/26#issuecomment-64268833.

JakeAlbee commented 9 years ago

I'm not entirely sure how it would be handled. It could throw an error for now, not sure

daviis commented 9 years ago

Situations for the future then. We can revisit it later, with an issue all itself because it will mean changing varbeans too.