Skip to content

Commit

Permalink
rename tuple and list
Browse files Browse the repository at this point in the history
  • Loading branch information
NTTVy03 committed Jan 6, 2025
1 parent ce223c8 commit e5a8c45
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 15 deletions.
8 changes: 4 additions & 4 deletions crates/parser/src/grammar/declaration.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use super::{expression::expression, list::{expression_tuple, identifier_tuple}};
use super::{expression::expression, list::{tuple_expression, tuple_identifier}};
use crate::{parser::Parser, token_kind::TokenKind::*};

// [N][M-1]
Expand Down Expand Up @@ -91,7 +91,7 @@ pub(super) fn var_declaration(p: &mut Parser) {
// tuple of variables
// eg: var (in1, in2, in3) = (1, 2, 3);
if p.at(LParen) {
identifier_tuple(p);
tuple_identifier(p);
if p.at_var_assign() {
p.advance();
expression(p);
Expand Down Expand Up @@ -129,7 +129,7 @@ pub(super) fn signal_declaration(p: &mut Parser) {
// tuple of signal
// eg: signal (in1, in2, in3) <== tuple_value;
if p.at(LParen) {
identifier_tuple(p);
tuple_identifier(p);
// can not assign for input signal
if assign_able && p.at_inline_assign_signal() {
p.advance();
Expand Down Expand Up @@ -184,7 +184,7 @@ pub(super) fn component_declaration(p: &mut Parser) {

// template params
let parameter_marker = p.open();
expression_tuple(p);
tuple_expression(p);
p.close(parameter_marker, Call);
}

Expand Down
4 changes: 2 additions & 2 deletions crates/parser/src/grammar/expression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use list::expression_tuple;
use list::tuple_expression;

use crate::parser::Marker;

Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn expression_rec(p: &mut Parser, pb: u16) -> Option<Marker> {
LParen => {
// function call
let open_marker = p.open_before(lhs);
expression_tuple(p);
tuple_expression(p);
lhs = p.close(open_marker, Call);
}
LBracket => {
Expand Down
4 changes: 2 additions & 2 deletions crates/parser/src/grammar/function.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use list::identifier_tuple;
use list::tuple_identifier;

use crate::grammar::*;

Expand All @@ -13,7 +13,7 @@ pub fn function_parse(p: &mut Parser) {
p.close(fn_name_marker, FunctionName);

let parameter_marker = p.open();
identifier_tuple(p);
tuple_identifier(p);
p.close(parameter_marker, ParameterList);

block::block(p);
Expand Down
6 changes: 3 additions & 3 deletions crates/parser/src/grammar/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use crate::grammar::{
* grammar: "(expression-1, expression-2,..., expression-n)"
* can be an empty ()
*/
pub(super) fn expression_tuple(p: &mut Parser) {
pub(super) fn tuple_expression(p: &mut Parser) {
// let m = p.open();
p.expect(LParen);

Expand All @@ -30,7 +30,7 @@ pub(super) fn expression_tuple(p: &mut Parser) {
* grammar: "(iden1, iden2,..., idenn)"
* can be an empty ()
*/
pub(super) fn identifier_tuple(p: &mut Parser) {
pub(super) fn tuple_identifier(p: &mut Parser) {
// let m = p.open();
p.expect(LParen);

Expand All @@ -51,7 +51,7 @@ pub(super) fn identifier_tuple(p: &mut Parser) {
* grammar: "[iden1, iden2,..., idenn]"
* can be an empty ()
*/
pub(super) fn identifier_list(p: &mut Parser) {
pub(super) fn list_identifier(p: &mut Parser) {
// let m = p.open();
p.expect(LBracket);

Expand Down
4 changes: 2 additions & 2 deletions crates/parser/src/grammar/main_component.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use list::identifier_list;
use list::list_identifier;

use super::*;

Expand All @@ -15,7 +15,7 @@ pub fn main_component(p: &mut Parser) {
p.expect(LCurly);
p.expect(PublicKw);
p.expect(LBracket);
identifier_list(p);
list_identifier(p);
p.expect(RBracket);
}

Expand Down
4 changes: 2 additions & 2 deletions crates/parser/src/grammar/template.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use list::identifier_tuple;
use list::tuple_identifier;

use crate::grammar::*;
/**
Expand All @@ -16,7 +16,7 @@ pub fn template(p: &mut Parser) {
p.close(name_marker, TemplateName);

let parameter_marker = p.open();
identifier_tuple(p);
tuple_identifier(p);
p.close(parameter_marker, ParameterList);

block::block(p);
Expand Down

0 comments on commit e5a8c45

Please sign in to comment.