Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ install:
rerun-install:
rerun -watch . -ignore out -run sh -c 'go install .'

rerun:
rerun-1:
rerun -watch . -ignore out -run sh -c 'go run . -s _examples/e1.ridl'

rerun-2:
rerun -watch . -ignore out -run sh -c 'go run . -s _examples/e2.ridl'

test:
go test -v -coverprofile=coverage.txt -covermode=atomic ./...
2 changes: 1 addition & 1 deletion _examples/e1.ridl
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ service ExampleService # oof
@ auth : ApiKeyAuth @ who dsa : J W T ## dadsadadsa
- Ping()
- Status() => (status: bool)
@ internal @ public ## dsada s dsa
@ internal @ public @ stringo : " string with spaces" ## dsada s dsa
- Version() => (version: Version)
@public
- GetUser ( header : map < string , string > , userID : uint64 ) => ( code : uint32 , user : User )
Expand Down
7 changes: 6 additions & 1 deletion formatter/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,12 @@ func (f *form) formatLine(line string) (string, error) {
case 1:
as = fmt.Sprintf("%s@%s", as, removeSpaces(ap[0]))
case 2:
as = fmt.Sprintf("%s@%s:%s", as, removeSpaces(ap[0]), removeSpaces(ap[1]))
v := strings.TrimSpace(ap[1])
if !strings.HasPrefix(v, `"`) && !strings.HasSuffix(v, `"`) {
v = removeSpaces(v)
}

as = fmt.Sprintf("%s@%s:%s", as, removeSpaces(ap[0]), v)
default:
return "", fmt.Errorf("unexpected amount of parts for one anotation parts=(%d) %s", len(ap), line)
}
Expand Down
4 changes: 2 additions & 2 deletions main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ service ExampleService # oof
@ auth : ApiKeyAuth @ who dsa : J W T ## dadsadadsa
- Ping()
- Status() => (status: bool)
@ internal @ public ## dsada s dsa
@ internal @ public @ stringo : " string with spaces " ## dsada s dsa
- Version() => (version: Version)
@public
- GetUser ( header : map < string , string > , userID : uint64 ) => ( code : uint32 , user : User )
Expand Down Expand Up @@ -248,7 +248,7 @@ service ExampleService # oof
@auth:ApiKeyAuth @whodsa:JWT ## dadsadadsa
- Ping()
- Status() => (status: bool)
@internal @public ## dsada s dsa
@internal @public @stringo:" string with spaces " ## dsada s dsa
- Version() => (version: Version)
@public
- GetUser(header: map<string,string>, userID: uint64) => (code: uint32, user: User)
Expand Down