Skip to content

Commit 768b5e6

Browse files
committed
semver parse multispace -> space
1 parent b89a5b0 commit 768b5e6

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/model/formats/stof/tests/lang/fields/mod.stof

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,11 @@ ParseFieldBeforeComment: {
135135
* This is a block comment, also failed before without a ';'.
136136
*/
137137
fn another_func() {}
138+
139+
first: 1.2.3
140+
141+
/// Comment after semver on a field
142+
second: 'hi'
138143
}
139144

140145

src/parser/semver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
//
1616

1717
use arcstr::ArcStr;
18-
use nom::{branch::alt, bytes::complete::take_while, character::complete::{char, digit1, multispace0}, combinator::{all_consuming, map_res, map}, sequence::{delimited, preceded}, AsChar, IResult, Parser};
18+
use nom::{branch::alt, bytes::complete::take_while, character::complete::{char, digit1, space0}, combinator::{all_consuming, map_res, map}, sequence::{delimited, preceded}, AsChar, IResult, Parser};
1919
use crate::{parser::doc::StofParseError, runtime::Val};
2020

2121

@@ -37,7 +37,7 @@ fn semver_complete(input: &str) -> IResult<&str, Val, StofParseError> {
3737
/// Parse a Semantic Version value.
3838
pub fn parse_semver(input: &str) -> IResult<&str, Val, StofParseError> {
3939
delimited(
40-
multispace0,
40+
space0,
4141
alt(
4242
(
4343
parse_semver_full,
@@ -46,7 +46,7 @@ pub fn parse_semver(input: &str) -> IResult<&str, Val, StofParseError> {
4646
parse_semver_basic
4747
)
4848
),
49-
multispace0
49+
space0
5050
).parse(input)
5151
}
5252
pub fn parse_semver_basic(input: &str) -> IResult<&str, Val, StofParseError> {

0 commit comments

Comments
 (0)