(Free)Pascal implementation

18 views
Skip to first unread message

Dmitry Boyarintsev

unread,
Nov 27, 2018, 12:36:14 PM11/27/18
to EditorConfig
Hello,

i've implemented EditorConfig support for pascal (https://github.com/skalogryz/editorConfig), as well as Lazarus IDE plugin (http://www.lazarus-ide.org/).
It's not EditorConfig-Core library based, just a stand-alone implementation following the specs descibed at editorconfig.org.

Thanks,
Dmitry

Hong Xu

unread,
Nov 27, 2018, 9:58:28 PM11/27/18
to editor...@googlegroups.com, Dmitry Boyarintsev
Thanks, Dimitry! Actually, you can make your Pascal implementation a
legitimate EditorConfig core, by passing all tests at
https://github.com/editorconfig/editorconfig-core-test . The test cases
catch a lot of edge cases, which should give you more confident in the
correctness of your implementation.

Anyway, thanks again for your contribution! We will get your plugin listed.

Hong

signature.asc

Dmitry Boyarintsev

unread,
Nov 28, 2018, 4:52:34 PM11/28/18
to editor...@googlegroups.com
Hello,

I'm finding the following odd. 

Test cases:
#83 braces_numeric_range4
editorconfig.exe -f braces.in C:/test/editorconfig-test/glob/60
number=true

PASSED.

#87 braces_numeric_range8
editorconfig.exe -f braces.in C:/test/editorconfig-test/glob/060
number=true

FAILED.

The file name should match the pattern:
; numeric braces
[{3..120}]
number=true

But why? shouldn't integer comparison be applied? 
where 060 = 60 and falls into 3..120 range?
or should it be character comparison only?

thanks,
Dmitry

Hong Xu

unread,
Nov 29, 2018, 3:19:06 AM11/29/18
to editor...@googlegroups.com, Dmitry Boyarintsev
On 11/28/18 1:52 PM, Dmitry Boyarintsev wrote:
> Hello,
>
> I'm finding the following odd. 
>
> Test cases:
> #83 braces_numeric_range4
> editorconfig.exe -f braces.in <http://braces.in>
> C:/test/editorconfig-test/glob/60
> number=true
>
> PASSED.
>
> #87 braces_numeric_range8
> editorconfig.exe -f braces.in <http://braces.in>
> C:/test/editorconfig-test/glob/060
> number=true
>
> FAILED.
>
> The file name should match the pattern:
> ; numeric braces
> [{3..120}]
> number=true
>
> But why? shouldn't integer comparison be applied? 
> where 060 = 60 and falls into 3..120 range?
> or should it be character comparison only?

This is simply consistent with other major glob systems in shells, just
a rule that has already prevailed. Try `echo {3..120}` in bash, and you
won't see 060 in the list :)

Hong

signature.asc

Dmitry Boyarintsev

unread,
Nov 29, 2018, 8:54:41 AM11/29/18
to ho...@topbug.net, editor...@googlegroups.com
On Thu, Nov 29, 2018 at 3:19 AM Hong Xu <ho...@topbug.net> wrote:
This is simply consistent with other major glob systems in shells, just
a rule that has already prevailed. Try `echo {3..120}` in bash, and you
won't see 060 in the list :)
Numbers are treated as numbers, yet the final comparison is done via strings.
"Brace expansion is performed before any other expansions, and any characters special to other expansions are preserved in the result. It is strictly textual."

Plus, zeros in the set have a special meaning:
"When either x or y begins with a zero, the shell attempts to force all generated terms to contain the same number of digits, zero-padding where necessary"

thanks,
Dmitry
Reply all
Reply to author
Forward
0 new messages