Skip to content

Add support for parsing dotted names into tags - #57

Open
kaushikcfd wants to merge 13 commits into
inducer:mainfrom
kaushikcfd:parse_tag
Open

Add support for parsing dotted names into tags#57
kaushikcfd wants to merge 13 commits into
inducer:mainfrom
kaushikcfd:parse_tag

Conversation

@kaushikcfd

Copy link
Copy Markdown
Collaborator

No description provided.

@inducerinducer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks for working on this. Some initial high-level feedback below.

Comment threadpytools/tag.py Outdated
Comment threadsetup.py Outdated
Comment threadtest/testlib.py
@kaushikcfd
kaushikcfdforce-pushed the parse_tag branch 2 times, most recently from 44f0ead to c2f9057CompareJanuary 4, 2021 20:34
- limit line columns length to 85
- install lark-parser for pylint,docs to resolve modules

@inducerinducer left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks! Some initial comments below.

Comment threadpytools/tag.py Outdated
Comment threadpytools/tag.py Outdated
Comment threadpytools/tag.py Outdated
Comment thread.gitlab-ci.yml
rm pytools/log.py

export EXTRA_INSTALL="numpy"
export EXTRA_INSTALL="numpy lark-parser"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Could you push a sister MR to Gitlab (add the link to the PR description) to ensure that passes, too?

Copy link
Copy Markdown
CollaboratorAuthor

Choose a reason for hiding this comment

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

Comment threadpytools/tag.py Outdated
Comment threadpytools/tag.py Outdated
Comment on lines +268 to +304
TAG_GRAMMAR = """
tag: tag_class "(" params ")" -> map_tag_from_python_class
| SHORTCUT -> map_tag_from_shortcut

params: -> map_empty_args_params
| args -> map_args_only_params
| kwargs -> map_kwargs_only_params
| args "," kwargs -> map_args_kwargs_params

?kwargs: kwarg
| kwargs "," kwarg -> map_kwargs

args: arg -> map_singleton_args
| args "," arg -> map_args

kwarg: name "=" arg -> map_kwarg

?arg: tag
| INT -> map_int
| ESCAPED_STRING -> map_string

tag_class: module "." name -> map_tag_class

module: name -> map_top_level_module
| module "." name -> map_nested_module

name: CNAME -> map_name
SHORTCUT: "." ("_"|LETTER) ("_"|LETTER|DIGIT|".")*

%import common.INT
%import common.ESCAPED_STRING
%import common.DIGIT
%import common.LETTER
%import common.CNAME
%import common.WS
%ignore WS
"""

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looked over the grammar, looks OK. (Please leave this for me to resolve at final review.)

@kaushikcfdkaushikcfd mentioned this pull request Mar 8, 2021
3 tasks
Base automatically changed from master to mainMarch 8, 2021 01:59
@kaushikcfd

kaushikcfd commented Mar 11, 2021

Copy link
Copy Markdown
CollaboratorAuthor

Probably I should rewrite this as pytools.resolve_name already contains most of the logic.

@inducer

Copy link
Copy Markdown
Owner

Unsubscribing... @-mention or request review once it's ready for a look or needs attention.

@inducer

Copy link
Copy Markdown
Owner

Probably I should rewrite this as pytools.resolve_name already contains most of the logic.

I actually don't think so. We'll be able to reuse this as we use more lark. Sorry I've been slow to review. Otherwise ready for another look from your end?

Sign up for freeto 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.

2 participants

@kaushikcfd@inducer