Skip to content

Commit

Permalink
Forgot to implement this original
Browse files Browse the repository at this point in the history
- Now when comments are added they are ignore properly
- Fixes #8
- Fixes multiline arrays and strings
  • Loading branch information
ieedan committed Mar 28, 2024
1 parent 5fe0043 commit d5a1bcd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
6 changes: 5 additions & 1 deletion .vnv
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
@startsWith("https://")
# Must be min 10 for name of domain and domain postfix Ex: (https://d.t)
@min(10)
ALLOWED_ORIGINS=["https://github.com", "https://aidanbleser.com"]
# ALLOWED_ORIGINS=["https://github.com", "http://aidanbleser.com"]
ALLOWED_ORIGINS=[
"https://github.com",
"https://aidanbleser.com"
]
@min(1000)
@public
POLLING_INTERVAL=5000
Expand Down
7 changes: 5 additions & 2 deletions src/parsing/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,9 @@ pub fn parse(content: &str) -> ParseResult {
is_array = true;
} else if c == ']' && is_value && is_array && !is_string {
is_array = false;
} else if !is_comment {
// no need to add comments to current
} else if c == '#' && !is_value && !is_array && !is_string {
is_comment = true;
} else if !is_comment && !(c == '\n' && !is_string) {
current.push_str(&c.to_string());
}

Expand Down Expand Up @@ -199,6 +200,8 @@ pub fn parse(content: &str) -> ParseResult {
current_key = (String::new(), FilePosition::new());
current_decorators = Vec::new();
is_value = false;
is_array = false;
is_string = false;
}

// clear no matter what
Expand Down

0 comments on commit d5a1bcd

Please sign in to comment.