Skip to content
This repository has been archived by the owner on Jun 17, 2022. It is now read-only.

Feature: type args support #34

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Conversation

Arcimiendar
Copy link

@Arcimiendar Arcimiendar commented Jun 21, 2021

add Number args to entity field types.
Example:

entity asdf {
someField: String(256),
someOtherField: Decimal(10, 3)
}

@codecov-commenter
Copy link

codecov-commenter commented Jun 21, 2021

Codecov Report

Merging #34 (5e121db) into main (4d3b394) will decrease coverage by 0.51%.
The diff coverage is 88.88%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #34      +/-   ##
==========================================
- Coverage   93.26%   92.75%   -0.52%     
==========================================
  Files          12       13       +1     
  Lines         193      207      +14     
==========================================
+ Hits          180      192      +12     
- Misses         13       15       +2     
Impacted Files Coverage Δ
src/parser/ast/field_term.rs 88.88% <84.61%> (-11.12%) ⬇️
src/parser/ast/type_argument_term.rs 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d3b394...5e121db. Read the comment docs.

@Arcimiendar Arcimiendar changed the title Feature/type args support Feature: type args support Jun 21, 2021
@Arcimiendar Arcimiendar requested a review from zkud June 21, 2021 13:50
use crate::ir::ir_component::IRComponent;
use crate::parser::ast::traits::ast_term::ASTTerm;

pub struct TypeArgumentTerm {
Copy link
Member

Choose a reason for hiding this comment

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

Could we use a word dimension instead argument to describe the sense of this term?

Comment on lines -11 to +20
let fields = vec![
let mut fields = vec![
("name", self.name.generate_ir()),
("type", self.type_name.generate_ir()),
("hasDefault", Box::new(IRComponent::new_bool(false))),
];

if self.type_arguments.len() > 0 {
fields.push(("typeArguments", self.generate_type_arguments_ir()))
}
Copy link
Member

Choose a reason for hiding this comment

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

Could we extract fields building to a separate method, for instance, build_fields to make generate_ir do only one thing?

@zkud
Copy link
Member

zkud commented Jun 21, 2021

Hi @Arcimiendar, thank you for a pr, please check my comments.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants