Skip to content

Compile service method annotation - #194

Merged
kanghyojun merged 4 commits into
nirum-lang:masterfrom
kanghyojun:compile-method-annotation
Nov 15, 2017
Merged

kanghyojun merged 4 commits into
nirum-lang:masterfrom
kanghyojun:compile-method-annotation

Conversation

@kanghyojun

@kanghyojun kanghyojun commented Nov 10, 2017 •

Copy link
Copy Markdown
Member

Since we need metadata of annotations on service class to route HTTP paths, i added __nirum_method_annotations__ property.

__nirum_method_annotations__ contain metadata of method annotations as nirum.datastaructures.Map type because it have to be immutable data.

@kanghyojun kanghyojun changed the title WIP (WIP) Compile service method annotation Nov 10, 2017
Comment thread src/Nirum/Targets/Python.hs Outdated
# FIXME Give annotations.
service_annotations=\{\},
method_annotations=\{\},
method_annotations=\{\}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

?!?!?!??!!

@kanghyojun
kanghyojun force-pushed the compile-method-annotation branch from fba3b8a to 85371f9 Compare November 12, 2017 09:11
@kanghyojun kanghyojun changed the title (WIP) Compile service method annotation Compile service method annotation Nov 12, 2017
@kanghyojun

Copy link
Copy Markdown
Member Author

@dahlia @Kroisse @AiOO Please review this.

@kanghyojun kanghyojun self-assigned this Nov 12, 2017
@kanghyojun kanghyojun added cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python typ:enhance Type: Enhancement/new feature labels Nov 12, 2017
dahlia
dahlia previously approved these changes Nov 12, 2017

@dahlia dahlia left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

리뷰로 남긴 제안들은 지금 당장 안 해도 되긴 합니다.

]
methodAnnotations' :: T.Text
methodAnnotations' = wrapMap $ commaNl $ map compileMethodAnnotation
methodList

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

결국 나중에 레코드나 유니온 클래스도 이런 애너테이션 메타데이터를 생성해줘야 하기 때문에, 이 코드들이 조만간 일반화되어서 where절 바깥으로 나가야 할 것 같네요. 미리 그렇게 해둘 필요는 없긴 합니다.

아예 Nirum.Targets.Python.Annotation, Nirum.Targets.Python.Name 뭐 이런 식으로 파이썬 타겟 내부에서 쓰이는 유틸리티 함수를 하위 모듈로 보내는 것도 한 방법일 것 같네요. 줄 자체가 너무 길어져서…

dahlia
dahlia previously approved these changes Nov 12, 2017
@kanghyojun

Copy link
Copy Markdown
Member Author

@dahlia 리베이스했습니다. 한번만더 리뷰 부탁드려요.

@kanghyojun
kanghyojun merged commit 74817f3 into nirum-lang:master Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmp:compiler Component: Compiler backend (e.g., annotation processors, code generators) target:python typ:enhance Type: Enhancement/new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants