Skip to content
This repository was archived by the owner on Jul 24, 2024. It is now read-only.

chore: improve json representation of ast #218

Merged
merged 1 commit into from
Dec 12, 2022
Merged

chore: improve json representation of ast #218

merged 1 commit into from
Dec 12, 2022

Conversation

azjezz
Copy link
Collaborator

@azjezz azjezz commented Dec 12, 2022

Signed-off-by: azjezz <azjezz@protonmail.com>
@azjezz azjezz self-assigned this Dec 12, 2022
Comment on lines +38 to +42
// declaration is terminated with `;` after a single expression.
Expression {
expression: Expression,
end: Span,
},
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

it seems weird that it's an expression not a statement, but that's how PHP does it 🤷‍♂️

@azjezz azjezz merged commit c16fc26 into main Dec 12, 2022
@azjezz azjezz deleted the json2 branch December 12, 2022 15:43
Comment on lines +12 to +14
pub key: SimpleIdentifier,
pub span: Span,
pub value: Expression,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

key -> strict_types
span -> =
value -> 1

Comment on lines +19 to +23
pub struct DeclareEntryGroup {
pub start: Span,
pub end: Span,
pub entries: Vec<DeclareEntry>,
}
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

start -> (
end -> )
entries -> list of k=v.

we still don't keep track of comma positions, but that is planned for later.

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

Successfully merging this pull request may close these issues.

1 participant