Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: GitHub noreply@github.com Date: Tue, 26 Nov 2024 15:31:24 UTC Commit: 32ef42eb9e41029e89e52a9cee78afd06706aa7a https://github.com/geany/geany/commit/32ef42eb9e41029e89e52a9cee78afd06706aa...
Log Message: ----------- Merge pull request #4073 from techee/optlib_tests
Re-enable Forth ctags parser and add unit test for it
Modified Paths: -------------- src/filetypes.c tests/ctags/Makefile.am tests/ctags/simple.fth tests/ctags/simple.fth.tags tests/meson.build
Modified: src/filetypes.c 2 lines changed, 1 insertions(+), 1 deletions(-) =================================================================== @@ -196,7 +196,7 @@ static void init_builtin_filetypes(void) FT_INIT( CMAKE, NONE, "CMake", NULL ); FT_INIT( NSIS, NSIS, "NSIS", NULL ); FT_INIT( ADA, ADA, "Ada", NULL ); - FT_INIT( FORTH, NONE, "Forth", NULL ); + FT_INIT( FORTH, FORTH, "Forth", NULL ); FT_INIT( ASCIIDOC, ASCIIDOC, "Asciidoc", NULL ); FT_INIT( ABAQUS, ABAQUS, "Abaqus", NULL ); FT_INIT( BATCH, BATCH, "Batch", NULL );
Modified: tests/ctags/Makefile.am 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -307,6 +307,7 @@ test_sources = \ simple.d \ simple.diff \ simple.docbook \ + simple.fth \ simple.hs \ simple.hx \ simple.html \
Modified: tests/ctags/simple.fth 31 lines changed, 31 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,31 @@ + +( https://rosettacode.org/wiki/FizzBuzz#Forth / https://skilldrick.github.io/easyforth/ ) + +\ Works in gforth and other ANS forth. Other Forth may differ. + +10 constant DUMMY1 +12 CONSTANT DUMMY2 + +variable dummy3 +variable dummy4 +VARIABLE dummy5 + +11 dummy3 ! +13 dummy4 ! + +: fizz? \ a simple comment +3 mod 0 = dup if ." Fizz" then ; +: buzz? +5 mod 0 = dup if ." Buzz" then ; + +: fizz-buzz? +dup fizz? swap buzz? or invert ; + +: do-fizz-buzz +25 1 do cr i fizz-buzz? if i . then loop ; + +do-fizz-buzz +cr + +quit +\ bye
Modified: tests/ctags/simple.fth.tags 18 lines changed, 18 insertions(+), 0 deletions(-) =================================================================== @@ -0,0 +1,18 @@ +DUMMY1�65536�0 +macro: DUMMY1 +DUMMY2�65536�0 +macro: DUMMY2 +buzz?�16�0 +function: buzz? +do-fizz-buzz�16�0 +function: do-fizz-buzz +dummy3�16384�0 +variable: dummy3 +dummy4�16384�0 +variable: dummy4 +dummy5�16384�0 +variable: dummy5 +fizz-buzz?�16�0 +function: fizz-buzz? +fizz?�16�0 +function: fizz?
Modified: tests/meson.build 1 lines changed, 1 insertions(+), 0 deletions(-) =================================================================== @@ -304,6 +304,7 @@ ctags_tests = [ 'ctags/simple.d.tags', 'ctags/simple.diff.tags', 'ctags/simple.docbook.tags', + 'ctags/simple.fth.tags', 'ctags/simple.hs.tags', 'ctags/simple.hx.tags', 'ctags/simple.html.tags',
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).