From 483fe86716bfb9c60e477020db2fff591952feec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sedl=C3=A1=C4=8Dek?= Date: Wed, 26 Mar 2025 08:12:36 +0100 Subject: [PATCH 1/4] example --- _examples/e1.ridl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_examples/e1.ridl b/_examples/e1.ridl index 69d90ff..5e18a09 100755 --- a/_examples/e1.ridl +++ b/_examples/e1.ridl @@ -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 ) From 18c6d420e044f86c8f99200c7b86ea51d4908ff3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sedl=C3=A1=C4=8Dek?= Date: Wed, 26 Mar 2025 08:12:59 +0100 Subject: [PATCH 2/4] formatter --- formatter/processor.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/formatter/processor.go b/formatter/processor.go index 93521dd..9c6e5f7 100644 --- a/formatter/processor.go +++ b/formatter/processor.go @@ -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) } From 10f383f7153dfa83c866b7e14fbf7826e4c50c45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sedl=C3=A1=C4=8Dek?= Date: Wed, 26 Mar 2025 08:13:08 +0100 Subject: [PATCH 3/4] makefile --- Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 7c730e1..763f0cc 100644 --- a/Makefile +++ b/Makefile @@ -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 ./... From eb12f9fe24124c6b884e8b8db3144c64fc339406 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Sedl=C3=A1=C4=8Dek?= Date: Wed, 26 Mar 2025 08:20:55 +0100 Subject: [PATCH 4/4] tests --- main_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main_test.go b/main_test.go index a63edb9..aa57d7f 100644 --- a/main_test.go +++ b/main_test.go @@ -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 ) @@ -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, userID: uint64) => (code: uint32, user: User)