├── .github └── workflows │ ├── ci.yml │ └── coverity.yml ├── .gitignore ├── .travis.yml ├── COPYING ├── Dockerfile ├── README.md ├── Rakefile ├── build ├── doc ├── Doxyfile ├── examples │ ├── parser_doc_1 │ ├── parser_doc_2 │ ├── parser_doc_3 │ ├── parser_doc_4 │ ├── parser_doc_5 │ ├── parser_doc_6 │ ├── parser_doc_7 │ ├── parser_doc_8 │ └── parser_doc_9 └── html │ ├── annotated.html │ ├── classes.html │ ├── detector_8h.html │ ├── detector_8h_source.html │ ├── detector_doc.html │ ├── diff_8h.html │ ├── diff_8h_source.html │ ├── doxygen.css │ ├── doxygen.png │ ├── files.html │ ├── functions.html │ ├── functions_vars.html │ ├── globals.html │ ├── globals_0x62.html │ ├── globals_0x63.html │ ├── globals_0x64.html │ ├── globals_0x65.html │ ├── globals_0x66.html │ ├── globals_0x69.html │ ├── globals_0x6c.html │ ├── globals_0x6e.html │ ├── globals_0x6f.html │ ├── globals_0x70.html │ ├── globals_0x73.html │ ├── globals_0x74.html │ ├── globals_0x77.html │ ├── globals_defs.html │ ├── globals_func.html │ ├── globals_type.html │ ├── globals_vars.html │ ├── index.html │ ├── languages_8h.html │ ├── languages_8h_source.html │ ├── license_doc.html │ ├── licenses_8h.html │ ├── licenses_8h_source.html │ ├── loc_8h.html │ ├── loc_8h_source.html │ ├── log_8h.html │ ├── log_8h_source.html │ ├── ohcount_8h.html │ ├── ohcount_8h_source.html │ ├── pages.html │ ├── parsed__language_8h.html │ ├── parsed__language_8h_source.html │ ├── parser_8h.html │ ├── parser_8h_source.html │ ├── parser__macros_8h.html │ ├── parser__macros_8h_source.html │ ├── parser_doc.html │ ├── sourcefile_8h.html │ ├── sourcefile_8h_source.html │ ├── structCallbackItem.html │ ├── structLanguageMap.html │ ├── structLicense.html │ ├── structLicenseListItem.html │ ├── structLoc.html │ ├── structLocDelta.html │ ├── structLocDeltaListItem.html │ ├── structLocListItem.html │ ├── structParsedLanguage.html │ ├── structParsedLanguageListItem.html │ ├── structSourceFile.html │ ├── structSourceFileListItem.html │ ├── structs_8h.html │ ├── structs_8h_source.html │ ├── tab_b.gif │ ├── tab_l.gif │ ├── tab_r.gif │ └── tabs.css ├── python ├── __init__.py ├── mingw_setup.py └── setup.py ├── ruby ├── gestalt.rb ├── gestalt │ ├── base.rb │ ├── definition.rb │ ├── definitions.rb │ ├── dot_net_definitions.rb │ ├── gestalt_engine.rb │ ├── gestalt_facts.rb │ ├── jasper_definitions.rb │ ├── java_definitions.rb │ ├── rules │ │ ├── and_rule.rb │ │ ├── c_header_rule.rb │ │ ├── c_keyword_rule.rb │ │ ├── csharp_using_rule.rb │ │ ├── csproj_parser.rb │ │ ├── csproj_rule.rb │ │ ├── file_rule.rb │ │ ├── filename_rule.rb │ │ ├── find_filenames_rule.rb │ │ ├── gestalt_rule.rb │ │ ├── java_import_rule.rb │ │ ├── keyword_rule.rb │ │ ├── language_rule.rb │ │ ├── logical_rule.rb │ │ ├── maven_parser.rb │ │ ├── maven_rule.rb │ │ ├── not_rule.rb │ │ ├── or_rule.rb │ │ ├── rule.rb │ │ └── xml_keyword_rule.rb │ └── trigger.rb ├── ohcount.i ├── ohcount.rb ├── print_arch └── x86_64-linux_ubuntu │ └── ohcount.so ├── security.md ├── src ├── detector.c ├── detector.h ├── diff.c ├── diff.h ├── hash │ ├── cppheaders.gperf │ ├── disambiguatefuncs.gperf │ ├── extensions.gperf │ ├── filenames.gperf │ ├── generate_headers │ ├── languages.gperf │ ├── options.gperf │ └── parsers.gperf ├── languages.h ├── licenses.c ├── licenses.h ├── loc.c ├── loc.h ├── log.c ├── log.h ├── ohcount.c ├── ohcount.h ├── parsed_language.c ├── parsed_language.h ├── parser.c ├── parser.h ├── parser_macros.h ├── parsers │ ├── actionscript.rl │ ├── ada.rl │ ├── ampl.rl │ ├── assembler.rl │ ├── augeas.rl │ ├── autoconf.rl │ ├── automake.rl │ ├── awk.rl │ ├── bat.rl │ ├── bfpp.rl │ ├── blitzmax.rl │ ├── boo.rl │ ├── brainfuck.rl │ ├── c.rl │ ├── chaiscript.rl │ ├── classic_basic.rl │ ├── clearsilver.rl │ ├── clearsilverhtml.rl │ ├── cmake.rl │ ├── coffeescript.rl │ ├── common.rl │ ├── compile │ ├── coq.rl │ ├── crystal.rl │ ├── cs_aspx.rl │ ├── css.rl │ ├── d.rl │ ├── dart.rl │ ├── dcl.rl │ ├── dylan.rl │ ├── ebuild.rl │ ├── eiffel.rl │ ├── elm.rl │ ├── erlang.rl │ ├── exheres.rl │ ├── factor.rl │ ├── forth.rl │ ├── fortranfixed.rl │ ├── fortranfree.rl │ ├── fsharp.rl │ ├── glsl.rl │ ├── golang.rl │ ├── grace.rl │ ├── groovy.rl │ ├── haml.rl │ ├── haskell.rl │ ├── haxe.rl │ ├── html.rl │ ├── idl_pvwave.rl │ ├── jam.rl │ ├── java.rl │ ├── javascript.rl │ ├── jsp.rl │ ├── julia.rl │ ├── kotlin.rl │ ├── limbo.rl │ ├── lisp.rl │ ├── livecode.rl │ ├── logtalk.rl │ ├── lua.rl │ ├── makefile.rl │ ├── mathematica.rl │ ├── matlab.rl │ ├── metafont.rl │ ├── metapost.rl │ ├── metapost_with_tex.rl │ ├── modelica.rl │ ├── modula2.rl │ ├── modula3.rl │ ├── mxml.rl │ ├── nix.rl │ ├── nsis.rl │ ├── oberon.rl │ ├── objective_c.rl │ ├── objective_j.rl │ ├── ocaml.rl │ ├── octave.rl │ ├── pascal.rl │ ├── perl.rl │ ├── php.rl │ ├── phphtml.rl │ ├── pike.rl │ ├── postscript.rl │ ├── powershell.rl │ ├── prolog.rl │ ├── puppet.rl │ ├── python.rl │ ├── r.rl │ ├── rebol.rl │ ├── rexx.rl │ ├── rhtml.rl │ ├── ruby.rl │ ├── rust.rl │ ├── scala.rl │ ├── scilab.rl │ ├── shell.rl │ ├── smalltalk.rl │ ├── sql.rl │ ├── stratego.rl │ ├── structured_basic.rl │ ├── swift.rl │ ├── tcl.rl │ ├── tex.rl │ ├── tex_dtx.rl │ ├── umple.rl │ ├── unrealscript.rl │ ├── vb_aspx.rl │ ├── vhdl.rl │ ├── vim.rl │ ├── visual_basic.rl │ ├── xaml.rl │ ├── xml.rl │ ├── xmlschema.rl │ └── xslt.rl ├── sourcefile.c ├── sourcefile.h └── structs.h └── test ├── .gitignore ├── detect_files ├── ActionscriptFile.as ├── AdvancedStreamRedirector.asx ├── CMakeLists.txt ├── Makefile ├── Makefile.am ├── TCPSocket.m ├── ampl.dat ├── ampl.mod ├── assembler6502.asx ├── bash_script ├── basic │ └── structured_basic.bas ├── binary.dat ├── blitzmax.bmx ├── bourne_again_script ├── classic_basic.b ├── clearsilver_template1.cs ├── client-osx.gs ├── configure ├── configure.ac ├── configure.in ├── coq.v ├── core.lisp ├── cs1.cs ├── d_script ├── eiffel.e ├── emacs_mode_c ├── empty.in ├── empty.inc ├── english.st ├── example.st ├── example.xsl ├── foo.bf ├── foo.bfpp ├── foo.c ├── foo.chai ├── foo.cmake ├── foo.coffee ├── foo.d ├── foo.dart ├── foo.dtx ├── foo.ebuild ├── foo.ec ├── foo.eclass ├── foo.eh ├── foo.exheres-0 ├── foo.exlib ├── foo.glsl ├── foo.in.in ├── foo.lgt ├── foo.mk ├── foo.nsh ├── foo.nsi ├── foo.pro ├── foo.qml ├── foo.rb ├── foo.run ├── foo.sci ├── foo.swift ├── foo.tex ├── foo.uc ├── foo.vala ├── foo.vim ├── foo.z80 ├── foo_glsl.frag ├── foo_glsl.vert ├── foo_mathematica.m ├── foo_matlab.m ├── foo_objective_c.h ├── foo_objective_c.m ├── foo_octave.m ├── foo_perl1.pl ├── foo_perl2.pl ├── foo_prolog1.pl ├── foo_r.R ├── foo_rebol_lower.r ├── foo_rebol_upper.r ├── foo_upper_case.C ├── foo_upper_case.RB ├── forth.4th ├── forth.fr ├── forth.fs ├── fortranfixed.f ├── fortranfree.f ├── frx1.frx ├── fs1.fs ├── grace1.grace ├── grace2.grc ├── java_emac.rb ├── javascript_emacs.js ├── m4.m4 ├── modula2.mod ├── module-definition.def ├── ocaml.ml ├── perl_shebang_prolog_body.pl ├── perl_w ├── perl_with_smiley.pl ├── php.inc ├── puppet_import.pp ├── puppet_import_annotated.pp ├── puppet_test.pp ├── puppet_test_annotated.pp ├── py_script ├── python.data ├── python2.data ├── qmake.pro ├── renderscript.rs ├── ruby_script ├── rust.rs ├── sampleDef.def ├── stratego.str ├── structured_basic.b ├── t1.m ├── t2.m ├── tcl_script ├── upper_case_php ├── uses_cpp_headers.h ├── uses_cpp_keywords.h ├── uses_cpp_modeline ├── uses_cpp_stdlib_headers.h ├── uses_no_cpp.h ├── visual_basic.bas └── xml.custom_ext ├── expected_dir ├── Makefile ├── Makefile.am ├── abstract_crystal.cr ├── ada1.ada ├── ada1.adb ├── ampl.mod ├── as1.as ├── assembler1.asm ├── assembler2.S ├── assembler6502.as8 ├── assembler6502.asx ├── augeas.aug ├── awk1.awk ├── b.bfpp ├── bat1.bat ├── blitzmax.bmx ├── boo1.boo ├── brainfuck.bf ├── c1.c ├── c2.h.in ├── c_binding_crystal.cr ├── c_str.c ├── chaiscript.chai ├── classic_basic.b ├── classic_basic.bas ├── clearsilver_template1.cs ├── click_me.xaml ├── clj1.clj ├── cmake1.cmake ├── cobol1.cbl ├── components.cu ├── configure.ac ├── coq.v ├── cs.aspx ├── cs1.cs ├── css1.css ├── d1.d ├── dcl.com ├── diff1_new.html ├── diff1_old.html ├── diff2_new.c ├── diff2_old.c ├── diff3_new.xml ├── diff3_old.xml ├── dylan1.dylan ├── eiffel.e ├── el1.el ├── elm.elm ├── english.st ├── erl1.erl ├── example.R ├── example.qml ├── example.rkt ├── example.xsl ├── factor1.factor ├── fb.js ├── foo.coffee ├── foo.dart ├── foo.dtx ├── foo.ebuild ├── foo.exheres-0 ├── foo.glsl ├── foo.lc ├── foo.nsh ├── foo.nsi ├── foo.swift ├── foo.tex ├── foo.vim ├── foo_glsl.vert ├── forth.4th ├── forth.fs ├── fortranfixed.f ├── fortranfree.f ├── frx1.frx ├── fs1.fs ├── grace.grace ├── groovy1.groovy ├── haml.haml ├── haskell1.hs ├── haskell2.hs ├── haskell3.hs ├── haxe1.hx ├── html1.html ├── idl_pvwave.pro ├── java1.java ├── java2.java ├── js1.js ├── js2.js ├── js3.js ├── jsp1.jsp ├── julia.jl ├── kotlin.kt ├── limbo.b ├── limbo.m ├── logtalk.lgt ├── lsp1.lsp ├── lua1.lua ├── macro_crystal.cr ├── mathematica1.m ├── matlab1.m ├── metafont.mf ├── metapost.mp ├── modelica.mo ├── mxml1.mxml ├── nix.nix ├── objj.j ├── ocaml.ml ├── octave1.m ├── optimer ├── pascal1.pas ├── pascal2.pp ├── perl.cgi ├── perl1.pl ├── perl_module.pm ├── perl_pod_to_eof.pl ├── php1.php ├── pike1.pike ├── pike2.pmod ├── postscipt.ps ├── prolog.pl ├── puppet1.pp ├── puppet_empty_class_1.pp ├── puppet_empty_class_2.pp ├── puppet_with_include_only.pp ├── py1.py ├── rebol.r ├── rexx1.rex ├── rhtml1.rhtml ├── ruby1.rb ├── rust.rs ├── sample.i3 ├── sample.m3 ├── sample.mod ├── sample.ob2 ├── sample.obn ├── sampleDef.def ├── sampleImp.mod ├── scala1.scala ├── schema.xsd ├── scheme.scm ├── scilab.sci ├── sh1.sh ├── sh2.sh ├── smalltalk1.st ├── sql1.sql ├── standard_crystal.cr ├── stratego.str ├── structured_basic.b ├── structured_basic.bas ├── tcl1.tcl ├── ts1.ts ├── umple.umple ├── unrealscript.uc ├── vala1.vala ├── vb.aspx ├── vb1.vb ├── vbs1.vbs ├── vhdl1.vhd ├── vhdl1.vhdl ├── visual_basic.bas └── xml1.xml ├── expected_licenses ├── academic_t1 ├── adaptive_t1 ├── affero_1 ├── apache_2_t1 ├── apache_2_t2 ├── apache_2_t3 ├── apache_ish_t1 ├── apache_ish_t2 ├── apache_t1 ├── apache_t2 ├── apache_t3 ├── apple_open_source_t1 ├── artistic_t1 ├── attribution_assurance_t1 ├── avr-drv ├── boost_t1 ├── boost_t2 ├── bsd_2clause_ish_t1 ├── bsd_ish_t1 ├── bsd_ish_t2 ├── bsd_ish_t3 ├── bsd_t1 ├── cecill ├── cecill-b ├── cecill-c ├── common_development_and_distribution_t1 ├── common_public_t1 ├── computer_associates_trusted_t1 ├── cua_office_t1 ├── eclipse_t1 ├── educational_t1 ├── eiffel_2_t1 ├── eiffel_t1 ├── entessa_t1 ├── eu_datagrid_t1 ├── fair_t1 ├── frameworx_t1 ├── gpl3_or_later_t1 ├── gpl3_or_later_t2 ├── gpl3_or_later_t3 ├── gpl3_t1 ├── gpl3_t2 ├── gpl_line_wrap_1 ├── gpl_t1 ├── gpl_t2 ├── gpl_t3 ├── gpl_t4 ├── historical_t1 ├── i9_license_t1 ├── i9_license_t2 ├── ibm_public_t1 ├── intel_open_source_t1 ├── jabber_open_source_t1 ├── lgpl3_t1 ├── lgpl3_t2 ├── lgpl_t1 ├── lgpl_t2 ├── lgpl_t3 ├── lgpl_t4 ├── lgpl_t5 ├── lucent_plan9_t1 ├── lucent_public_t1 ├── mit_t1 ├── mit_t2 ├── mitre_t1 ├── motosoto_t1 ├── mozilla_public_1_1_t1 ├── mozilla_public_1_t1 ├── nasa_open_t1 ├── naumen_t1 ├── nethack_t1 ├── nokia_open_source_t1 ├── oclc_research_t1 ├── open_group_test_t1 ├── open_software_t1 ├── php_license_t1 ├── python_license_t1 ├── python_software_foundation_t1 ├── qt_public_t1 ├── realnetworks_public_source_t1 ├── reciprocal_public_t1 ├── ricoh_source_t1 ├── sleepycat_t1 ├── sugarcrm_1_1_3_t1 ├── sun_industry_standards_t1 ├── sun_public_t1 ├── sybase_open_watcom_t1 ├── u_of_i_ncsa_t1 ├── vovida_software_t1 ├── w3c_t1 ├── wtfpl ├── wx_windows_t1 ├── x_net_t1 ├── zlib_libpng_t1 └── zope_t1 ├── gestalt_files ├── asp_net │ └── test.aspx ├── cakephp │ └── foo.php ├── drupal │ └── bar.php ├── eclipse │ └── .project ├── eclipse_platform │ └── main.java ├── gtk │ └── simple.c ├── jquery │ └── jquery-1.2.6.min.js ├── kde │ └── foo.c ├── mac │ └── foo.c ├── moodle │ └── moodle.php ├── msdos │ ├── bar.c │ └── foo.c ├── netbeans │ └── nbplatform │ │ ├── foo │ │ └── project.xml ├── pear │ ├── Sample.class.php │ └── package.xml ├── php │ └── main.php ├── plist │ └── Info.plist.in ├── posix │ ├── configure.in │ ├── foo.c │ └── foo.rb ├── python │ └── hello_world.py ├── rails │ └── foo.rb ├── ruby_just_enough │ ├── foo.c │ └── foo.rb ├── ruby_not_enough │ ├── foo.c │ └── foo.rb ├── spring_framework │ ├── main.java │ └── spring.jar ├── symfony │ └── config.php ├── vs_1 │ └── sample.sln ├── weblogic_descriptor │ ├── foo.java │ └── weblogic-application.xml ├── weblogic_maven │ ├── foo.java │ └── pom.xml ├── websphere │ ├── foo.java │ └── ibm-webservices-bnd.xmi ├── win32_enough │ ├── bar.c │ └── foo.c ├── win32_not_enough │ └── foo.c ├── wpf │ └── wpf.xaml ├── wx_widgets │ └── main.h ├── xwindows │ └── foo.c └── zend_framework │ └── application │ └── controllers │ └── ZendWildfirePluginFirePhpController.php ├── src_dir ├── Makefile ├── Makefile.am ├── abstract_crystal.cr ├── ada1.ada ├── ada1.adb ├── ampl.mod ├── as1.as ├── assembler1.asm ├── assembler2.S ├── assembler6502.as8 ├── assembler6502.asx ├── augeas.aug ├── awk1.awk ├── b.bfpp ├── bat1.bat ├── blitzmax.bmx ├── boo1.boo ├── brainfuck.bf ├── c1.c ├── c2.h.in ├── c_binding_crystal.cr ├── c_str.c ├── chaiscript.chai ├── classic_basic.b ├── classic_basic.bas ├── classic_basic1.classic_basic ├── clearsilver_template1.cs ├── click_me.xaml ├── clj1.clj ├── cmake1.cmake ├── cobol1.cbl ├── components.cu ├── configure.ac ├── coq.v ├── cs.aspx ├── cs1.cs ├── css1.css ├── d1.d ├── dcl.com ├── diff1_new.html ├── diff1_old.html ├── diff2_new.c ├── diff2_old.c ├── diff3_new.xml ├── diff3_old.xml ├── dylan1.dylan ├── eiffel.e ├── el1.el ├── elm.elm ├── english.st ├── erl1.erl ├── example.R ├── example.qml ├── example.rkt ├── example.xsl ├── factor1.factor ├── fb.js ├── foo.coffee ├── foo.dart ├── foo.dtx ├── foo.ebuild ├── foo.exheres-0 ├── foo.glsl ├── foo.lc ├── foo.nsh ├── foo.nsi ├── foo.swift ├── foo.tex ├── foo.vim ├── foo_glsl.vert ├── forth.4th ├── forth.fs ├── fortranfixed.f ├── fortranfree.f ├── frx1.frx ├── fs1.fs ├── grace.grace ├── groovy1.groovy ├── haml.haml ├── haskell1.hs ├── haskell2.hs ├── haskell3.hs ├── haxe1.hx ├── html.cgi ├── html1.html ├── idl_pvwave.pro ├── java1.java ├── java2.java ├── js1.js ├── js2.js ├── js3.js ├── jsp1.jsp ├── julia.jl ├── kotlin.kt ├── limbo.b ├── limbo.m ├── logtalk.lgt ├── lsp1.lsp ├── lua1.lua ├── macro_crystal.cr ├── mathematica1.m ├── matlab1.m ├── metafont.mf ├── metapost.mp ├── modelica.mo ├── mxml1.mxml ├── mysql-stale-table-sniper ├── nix.nix ├── objj.j ├── ocaml.ml ├── octave1.m ├── optimer ├── pascal1.pas ├── pascal2.pp ├── perl1.pl ├── perl_module.pm ├── perl_pod_to_eof.pl ├── php1.php ├── pike1.pike ├── pike2.pmod ├── postscript.ps ├── prolog.pl ├── puppet1.pp ├── puppet_empty_class_1.pp ├── puppet_empty_class_2.pp ├── puppet_with_include_only.pp ├── py1.py ├── rebol.r ├── rexx1.rex ├── rhtml1.rhtml ├── ruby1.rb ├── rust.rs ├── sample.i3 ├── sample.m3 ├── sample.mod ├── sample.ob2 ├── sample.obn ├── sampleDef.def ├── sampleImp.mod ├── scala1.scala ├── schema.xsd ├── scheme.scm ├── scilab.sci ├── sh1.sh ├── sh2.sh ├── smalltalk1.st ├── sql1.sql ├── standard_crystal.cr ├── stratego.str ├── structured_basic.b ├── structured_basic.bas ├── tcl1.tcl ├── ts1.ts ├── umple.umple ├── unrealscript.uc ├── vala1.vala ├── vb.aspx ├── vb1.vb ├── vbs1.vbs ├── vhdl1.vhd ├── vhdl1.vhdl ├── visual_basic.bas └── xml1.xml ├── src_licenses ├── academic_t1.c ├── adaptive_t1.rb ├── affero_1.rb ├── apache_2_t1.cpp ├── apache_2_t2.rb ├── apache_2_t3.java ├── apache_ish_t1.sql ├── apache_ish_t2.sql ├── apache_t1.c ├── apache_t2.rb ├── apache_t3.rb ├── apple_open_source_t1.rb ├── artistic_t1.d ├── attribution_assurance_t1.c ├── avr-drv.c ├── boost_t1.c ├── boost_t2.c ├── bsd_2clause_ish_t1.c ├── bsd_ish_t1.c ├── bsd_ish_t2.c ├── bsd_ish_t3.c ├── bsd_t1.rb ├── cecill-b.c ├── cecill-c.c ├── cecill.c ├── common_development_and_distribution_t1.c ├── common_public_t1.c ├── computer_associates_trusted_t1.c ├── cua_office_t1.c ├── eclipse_t1.java ├── educational_t1.c ├── eiffel_2_t1.c ├── eiffel_t1.c ├── entessa_t1.c ├── eu_datagrid_t1.c ├── fair_t1.c ├── frameworx_t1.c ├── gpl3_or_later_t1.cs ├── gpl3_or_later_t2.c ├── gpl3_or_later_t3.cpp ├── gpl3_t1.c ├── gpl3_t2.cs ├── gpl_line_wrap_1.c ├── gpl_t1.c ├── gpl_t2.c ├── gpl_t3.c ├── gpl_t4.c ├── historical_t1.c ├── i9_license_t1.sh ├── i9_license_t2.sh ├── ibm_public_t1.c ├── intel_open_source_t1.c ├── jabber_open_source_t1.c ├── lgpl3_t1.java ├── lgpl3_t2.C ├── lgpl_t1.c ├── lgpl_t2.c ├── lgpl_t3.c ├── lgpl_t4.c ├── lgpl_t5.c ├── lucent_plan9_t1.c ├── lucent_public_t1.c ├── mit_t1.c ├── mit_t2.c ├── mitre_t1.c ├── motosoto_t1.c ├── mozilla_public_1_1_t1.c ├── mozilla_public_1_t1.c ├── nasa_open_t1.c ├── naumen_t1.c ├── nethack_t1.c ├── nokia_open_source_t1.c ├── oclc_research_t1.c ├── open_group_test_t1.c ├── open_software_t1.c ├── php_license_t1.php ├── python_license_t1.py ├── python_software_foundation_t1.py ├── qt_public_t1.c ├── realnetworks_public_source_t1.c ├── reciprocal_public_t1.c ├── ricoh_source_t1.c ├── sleepycat_t1.c ├── sugarcrm_1_1_3_t1.c ├── sun_industry_standards_t1.c ├── sun_public_t1.c ├── sybase_open_watcom_t1.c ├── u_of_i_ncsa_t1.c ├── vovida_software_t1.c ├── w3c_t1.c ├── wtfpl.c ├── wx_windows_t1.c ├── x_net_t1.c ├── zlib_libpng_t1.c └── zope_t1.c ├── symlink_test_dir └── symlink_test_dir_target ├── symlink_test_dir_target └── from_symlink_foo.c └── unit ├── all_tests.c ├── detector_test.h ├── license_test.h ├── loc_test.h ├── parser_test.h ├── parsers ├── test_actionscript.h ├── test_ada.h ├── test_ampl.h ├── test_assembler.h ├── test_augeas.h ├── test_autoconf.h ├── test_automake.h ├── test_awk.h ├── test_basic.h ├── test_bat.h ├── test_bfpp.h ├── test_blitzmax.h ├── test_boo.h ├── test_brainfuck.h ├── test_c.h ├── test_chaiscript.h ├── test_clearsilver.h ├── test_clearsilvertemplate.h ├── test_clojure.h ├── test_cmake.h ├── test_coq.h ├── test_crystal.h ├── test_cs_aspx.h ├── test_csharp.h ├── test_css.h ├── test_d.h ├── test_dart.h ├── test_dcl.h ├── test_dylan.h ├── test_ebuild.h ├── test_eiffel.h ├── test_elm.h ├── test_emacs_lisp.h ├── test_erlang.h ├── test_exheres.h ├── test_factor.h ├── test_forth.h ├── test_fortran.h ├── test_fsharp.h ├── test_glsl.h ├── test_golang.h ├── test_groovy.h ├── test_haml.h ├── test_haskell.h ├── test_haxe.h ├── test_html.h ├── test_idl_pvwave.h ├── test_jam.h ├── test_java.h ├── test_javascript.h ├── test_jsp.h ├── test_julia.h ├── test_lisp.h ├── test_livecode.h ├── test_logtalk.h ├── test_lua.h ├── test_make.h ├── test_mathematica.h ├── test_matlab.h ├── test_metafont.h ├── test_metapost.h ├── test_mxml.h ├── test_nix.h ├── test_nsis.h ├── test_objective_j.h ├── test_ocaml.h ├── test_octave.h ├── test_pascal.h ├── test_perl.h ├── test_pike.h ├── test_postscript.h ├── test_powershell.h ├── test_puppet.h ├── test_python.h ├── test_qml.h ├── test_r.h ├── test_racket.h ├── test_rebol.h ├── test_rexx.h ├── test_rhtml.h ├── test_ruby.h ├── test_scala.h ├── test_scheme.h ├── test_scilab.h ├── test_shell.h ├── test_smalltalk.h ├── test_sql.h ├── test_stratego.h ├── test_swift.h ├── test_tcl.h ├── test_tex.h ├── test_typescript.h ├── test_umple.h ├── test_unrealscript.h ├── test_vala.h ├── test_vb_aspx.h ├── test_vhdl.h ├── test_visualbasic.h ├── test_xaml.h ├── test_xml.h ├── test_xmlschema.h └── test_xslt.h ├── python └── python_test.py ├── ruby ├── gestalt │ ├── csharp_using_rule_test.rb │ ├── definitions_test.rb │ ├── dot_net_definitions_test.rb │ ├── file_rule_test.rb │ ├── filename_rule_test.rb │ ├── gestalt_test.rb │ ├── jasper_definitions_test.rb │ ├── java_definitions_test.rb │ ├── keyword_rule_test.rb │ ├── maven_dependency_rule_test.rb │ └── rule_test.rb ├── ruby_test.rb ├── source_file_list_test.rb ├── source_file_test.rb └── test_helper.rb └── sourcefile_test.h /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | name: CI Pipeline 2 | 3 | on: 4 | pull_request: 5 | types: 6 | - opened 7 | - synchronize 8 | push: 9 | branches: [main] 10 | 11 | jobs: 12 | test: 13 | runs-on: ubuntu-22.04 14 | steps: 15 | - uses: actions/checkout@v3 16 | - uses: ruby/setup-ruby@v1 17 | with: 18 | ruby-version: '2.6' 19 | - name: Install dependencies 20 | run: | 21 | sudo apt-get install libpcre3 libpcre3-dev libmagic-dev gperf gcc ragel swig 22 | gem install test-unit 23 | - name: Run tests 24 | run: '${{github.workspace}}/build tests' 25 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | pkg 2 | lib/i[3-9]86* 3 | lib/x86* 4 | *.swp 5 | tags 6 | .DS_Store 7 | src/hash/*_hash.h 8 | src/hash/language_hash.c 9 | src/parsers/*.h 10 | src/parser.o 11 | test/unit/run_tests 12 | bin/ 13 | ruby/ohcount.so 14 | ruby/ohcount_wrap.c 15 | test/unit/run_tests.dSYM/ 16 | build-python/ 17 | python/ohcount.py 18 | .rvmrc 19 | .ruby-version 20 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | arch: 2 | - amd64 3 | - ppc64le 4 | language: ruby 5 | install: 6 | - sudo apt-get install libpcre3 libpcre3-dev libmagic-dev gperf gcc ragel swig 7 | - gem install test-unit 8 | -------------------------------------------------------------------------------- /Rakefile: -------------------------------------------------------------------------------- 1 | task :default => [:build_all] 2 | 3 | task :build_all => [:build, :build_ruby] 4 | 5 | task :build do 6 | system "./build" 7 | end 8 | 9 | task :build_ruby do 10 | system "./build ruby" 11 | end 12 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_3: -------------------------------------------------------------------------------- 1 | %%{ 2 | machine c; 3 | write data; 4 | include common "common.rl"; 5 | 6 | ... 7 | }%% 8 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_4: -------------------------------------------------------------------------------- 1 | [lang]_line := |* 2 | entity1 ${ entity = ENTITY1; } => [lang]_ccallback; 3 | entity2 ${ entity = ENTITY2; } => [lang]_ccallback; 4 | ... 5 | entityn ${ entity = ENTITYN; } => [lang]_ccallback; 6 | *|; 7 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_5: -------------------------------------------------------------------------------- 1 | action [lang]_ccallback { 2 | switch(entity) { 3 | when ENTITY1: 4 | ... 5 | break; 6 | when ENTITY2: 7 | ... 8 | break; 9 | ... 10 | when ENTITYN: 11 | ... 12 | break; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_6: -------------------------------------------------------------------------------- 1 | [lang]_[elang]_entry @{ entity = CHECK_BLANK_ENTRY; } @[lang]_callback 2 | @{ saw([elang]_LANG)} => { fcall [lang]_[elang]_line; }; 3 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_7: -------------------------------------------------------------------------------- 1 | @{ p = ts; fret; }; 2 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_8: -------------------------------------------------------------------------------- 1 | [lang]_entity := |* 2 | entity1 ${ entity = ENTITY1; } => [lang]_ecallback; 3 | entity2 ${ entity = ENTITY2; } => [lang]_ecallback; 4 | ... 5 | entityn ${ entity = ENTITYN; } => [lang]_ecallback; 6 | *|; 7 | -------------------------------------------------------------------------------- /doc/examples/parser_doc_9: -------------------------------------------------------------------------------- 1 | action [lang]_ecallback { 2 | callback([lang]_LANG, [lang]_entities[entity], cint(ts), cint(te), 3 | userdata); 4 | } 5 | -------------------------------------------------------------------------------- /doc/html/doxygen.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/doc/html/doxygen.png -------------------------------------------------------------------------------- /doc/html/tab_b.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/doc/html/tab_b.gif -------------------------------------------------------------------------------- /doc/html/tab_l.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/doc/html/tab_l.gif -------------------------------------------------------------------------------- /doc/html/tab_r.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/doc/html/tab_r.gif -------------------------------------------------------------------------------- /ruby/gestalt/rules/and_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | # Will trigger if all sub-rules do 4 | class AndRule < LogicalRule 5 | 6 | def triggers(gestalt_engine) 7 | rules.each do |r| 8 | return [] if r.triggers(gestalt_engine).empty? 9 | end 10 | [Trigger.new] 11 | end 12 | end 13 | end 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/c_keyword_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | class CKeywordRule < KeywordRule 4 | 5 | def initialize(*keywords) 6 | super('c',*keywords) 7 | end 8 | 9 | def process_source_file(source_file) 10 | if source_file.language_breakdown('c') 11 | @count += source_file.language_breakdown('c').code.scan(regexp).size 12 | elsif source_file.language_breakdown('cpp') 13 | @count += source_file.language_breakdown('cpp').code.scan(regexp).size 14 | end 15 | end 16 | end 17 | end 18 | end 19 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/filename_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | # rule based a the name of the file 4 | class FilenameRule < FileRule 5 | attr_reader :filenames 6 | 7 | def initialize(*args) 8 | options = args.pop if args.last.is_a?(Hash) 9 | @filenames = args 10 | super(options) 11 | end 12 | 13 | def process_source_file(source_file) 14 | @count += 1 if regex.match(source_file.filepath) 15 | end 16 | 17 | def regex 18 | @regex ||= begin 19 | r = filenames.collect { |f| "(" + f + ")"}.join("|") 20 | Regexp.new(r) 21 | end 22 | end 23 | end 24 | end 25 | end 26 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/gestalt_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | 4 | # states that a certain gestalt is required. 5 | class GestaltRule < Rule 6 | attr_reader :type, :name 7 | 8 | def initialize(type, name) 9 | @type = type 10 | @name = name 11 | end 12 | 13 | def triggers(gestalt_engine) 14 | if gestalt_engine.has_gestalt?(type,name) 15 | [Trigger.new] 16 | else 17 | [] 18 | end 19 | end 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/not_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | class NotRule < LogicalRule 4 | def triggers(gestalt_engine) 5 | rules.first && rules.first.triggers(gestalt_engine).any? ? [] : [Trigger.new] 6 | end 7 | 8 | def new_rule(r_class, *args, &block) 9 | raise ArgumentError.new("_not() accepts only a single rule") unless rules.empty? 10 | super(r_class, *args, &block) 11 | end 12 | 13 | end 14 | end 15 | end 16 | 17 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/or_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | # Will trigger if any sub-rule does 4 | class OrRule < LogicalRule 5 | def triggers(gestalt_engine) 6 | rules.each do |r| 7 | triggers = r.triggers(gestalt_engine) 8 | return triggers if triggers.any? 9 | end 10 | [] 11 | end 12 | end 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /ruby/gestalt/rules/xml_keyword_rule.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | class XmlKeywordRule < KeywordRule 4 | 5 | def initialize(*keywords) 6 | super('xml',*keywords) 7 | end 8 | 9 | def trigger_file?(source_file) 10 | return false unless source_file.polyglot = 'xml' 11 | regexp.match(source_file.language_breakdowns('xml').code) 12 | end 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /ruby/gestalt/trigger.rb: -------------------------------------------------------------------------------- 1 | module Ohcount 2 | module Gestalt 3 | class Trigger 4 | attr_reader :name, :count 5 | 6 | def initialize(args = {}) 7 | @name = args[:name] 8 | @count = args[:count] || 1 9 | end 10 | 11 | end 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /ruby/print_arch: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | require 'mkmf' 3 | 4 | arch = RbConfig::expand(CONFIG["arch"]) 5 | 6 | distro = if File.exist?("/etc/os-release") 7 | # this is "", "CentOS" or "Ubuntu" 8 | `egrep "^ID=.*" /etc/os-release`.split("=")[1].downcase 9 | end 10 | 11 | unless %w[centos ubuntu fedora].include?(distro.to_s.chomp) 12 | STDERR.puts "unhandled /etc/os-release result: #{distro}" 13 | end 14 | 15 | # either or _ if distro is non-null 16 | puts [arch, distro].compact.join("_") 17 | -------------------------------------------------------------------------------- /ruby/x86_64-linux_ubuntu/ohcount.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/ruby/x86_64-linux_ubuntu/ohcount.so -------------------------------------------------------------------------------- /src/hash/filenames.gperf: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "../languages.h" 3 | %} 4 | struct FilenameMap { const char *key; const char *value; }; 5 | %% 6 | CMakeLists.txt, LANG_CMAKE 7 | Jamfile, LANG_JAM 8 | Jamrules, LANG_JAM 9 | GNUmakefile, LANG_MAKE 10 | Makefile, LANG_MAKE 11 | Makefile.am, LANG_AUTOMAKE 12 | configure, LANG_AUTOCONF 13 | configure.ac, LANG_AUTOCONF 14 | configure.in, LANG_AUTOCONF 15 | init.pp, LANG_PUPPET 16 | makefile, LANG_MAKE 17 | Rakefile, LANG_RUBY 18 | rakefile, LANG_RUBY 19 | Gemfile, LANG_RUBY 20 | Vagrantfile, LANG_RUBY 21 | PKGBUILD, LANG_SHELL 22 | script.utf8, LANG_LIVECODE 23 | -------------------------------------------------------------------------------- /src/hash/options.gperf: -------------------------------------------------------------------------------- 1 | %{ 2 | #include "../ohcount.h" 3 | %} 4 | struct OhcountOption { const char *key; int value; }; 5 | %% 6 | -a, COMMAND_ANNOTATE 7 | --annotate, COMMAND_ANNOTATE 8 | -d, COMMAND_DETECT 9 | --detect, COMMAND_DETECT 10 | -h, COMMAND_HELP 11 | --help, COMMAND_HELP 12 | -i, COMMAND_INDIVIDUAL 13 | --individual, COMMAND_INDIVIDUAL 14 | -l, COMMAND_LICENSES 15 | --license, COMMAND_LICENSES 16 | -re, COMMAND_RAWENTITIES 17 | -s, COMMAND_SUMMARY 18 | --summary, COMMAND_SUMMARY 19 | -------------------------------------------------------------------------------- /src/log.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #define LOG_FILE "/tmp/ohcount.log" 5 | void log_it(char *log) { 6 | FILE *f = fopen(LOG_FILE, "a"); 7 | fputs(log, f); 8 | fclose(f); 9 | } 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/log.h: -------------------------------------------------------------------------------- 1 | #define log_it(log) {} /* by default, do nothing, to use this to debug 2 | * uncomment the line below */ 3 | //void log_it(char *log); 4 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/.gitignore -------------------------------------------------------------------------------- /test/detect_files/ActionscriptFile.as: -------------------------------------------------------------------------------- 1 | package ohcount.test.detect_files 2 | { 3 | public class ActionscriptFile 4 | { 5 | public var actionscript:String; 6 | 7 | public function actionsciptMethod():void 8 | { 9 | 10 | } 11 | } 12 | } -------------------------------------------------------------------------------- /test/detect_files/AdvancedStreamRedirector.asx: -------------------------------------------------------------------------------- 1 | 2 | Example.com Live Stream 3 | 4 | Short Announcement to Play Before Main Stream 5 | 6 | 7 | 8 | Example radio 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/detect_files/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # A cmake build script. 2 | add_subdirectory("blah") 3 | -------------------------------------------------------------------------------- /test/detect_files/Makefile: -------------------------------------------------------------------------------- 1 | # This is a makefile. 2 | 3 | giant_space_monkey : giant_space_monkey.c 4 | $(CC) $(CFLAGS) -o $@ $? 5 | 6 | -------------------------------------------------------------------------------- /test/detect_files/Makefile.am: -------------------------------------------------------------------------------- 1 | # This is an automake file 2 | EXTRA_DIST = giant-space-monkey.txt 3 | 4 | -------------------------------------------------------------------------------- /test/detect_files/ampl.dat: -------------------------------------------------------------------------------- 1 | data; 2 | param p := 42; 3 | -------------------------------------------------------------------------------- /test/detect_files/ampl.mod: -------------------------------------------------------------------------------- 1 | # An AMPL model 2 | var x >= 42; 3 | minimize o: x; 4 | -------------------------------------------------------------------------------- /test/detect_files/assembler6502.asx: -------------------------------------------------------------------------------- 1 | ; "Hello world" in 6502 assembly language for 8-bit Atari. 2 | ; Assembler: http://xasm.atari.org/ or http://mads.atari8.info/ 3 | 4 | org $3000 5 | main lda #$21 6 | sta $22f 7 | lda #
dl 10 | sta $231 11 | jmp * 12 | 13 | text dta d' HELLO, ',d'WORLD! '* 14 | 15 | ; Display List 16 | dl dta b($70),b($70),b($70),b($47),a(text),b($41),a(dl) 17 | 18 | org $2e0 19 | dta a(main) 20 | 21 | end 22 | -------------------------------------------------------------------------------- /test/detect_files/basic/structured_basic.bas: -------------------------------------------------------------------------------- 1 | INPUT "What is your name: "; U$ 2 | PRINT "Hello "; U$ 3 | REM Test 4 | INPUT "How many stars do you want: "; N 5 | S$ = "" 6 | FOR I = 1 TO N 7 | S$ = S$ + "*" 8 | NEXT I 9 | PRINT S$ 10 | 11 | REM 12 | INPUT "Do you want more stars? "; A$ 13 | IF LEN(A$) = 0 THEN GOTO 110 14 | A$ = LEFT$(A$, 1) 15 | IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | PRINT "Goodbye "; 17 | FOR I = 1 TO 200 18 | PRINT U$; " "; 19 | NEXT I 20 | PRINT 21 | -------------------------------------------------------------------------------- /test/detect_files/binary.dat: -------------------------------------------------------------------------------- 1 | some data 2 | -------------------------------------------------------------------------------- /test/detect_files/blitzmax.bmx: -------------------------------------------------------------------------------- 1 | ' 2 | ' Comments 3 | ' 4 | SuperStrict 5 | 6 | Rem 7 | bbdoc: docs 8 | End Rem 9 | Module bah.fish 10 | 11 | Import BRL.StandardIO 12 | 13 | Import "test.bmx" ' comment 14 | 15 | rem 16 | some comments 17 | 18 | 19 | Type blah 20 | still in comments 21 | End Type 22 | 23 | endrem 24 | 25 | Type TABC 26 | 27 | Method hello() 28 | End Method 29 | 30 | End Type 31 | 32 | print "hello rem fish ' " 33 | -------------------------------------------------------------------------------- /test/detect_files/bourne_again_script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # This is a bash script 4 | Usage() { 5 | ProgName=`basename "$0"` 6 | echo "sample script 7 | Usage: $ProgName [-h] ..." 8 | exit 9 | } 10 | 11 | for arg 12 | do 13 | case "$arg" in 14 | -h|--help|-help) 15 | Usage ;; 16 | esac 17 | done 18 | -------------------------------------------------------------------------------- /test/detect_files/classic_basic.b: -------------------------------------------------------------------------------- 1 | 10 INPUT "What is your name: "; U$ 2 | 20 PRINT "Hello "; U$ 3 | 30 REM Test 4 | 40 INPUT "How many stars do you want: "; N 5 | 50 S$ = "" 6 | 60 FOR I = 1 TO N 7 | 70 S$ = S$ + "*" 8 | 80 NEXT I 9 | 90 PRINT S$ 10 | 100 REM 11 | 110 INPUT "Do you want more stars? "; A$ 12 | 120 IF LEN(A$) = 0 THEN GOTO 110 13 | 130 A$ = LEFT$(A$, 1) 14 | 140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 15 | 150 PRINT "Goodbye "; 16 | 160 FOR I = 1 TO 200 17 | 170 PRINT U$; " "; 18 | 180 NEXT I 19 | 190 PRINT 20 | -------------------------------------------------------------------------------- /test/detect_files/clearsilver_template1.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 |

5 | 6 | 7 | -------------------------------------------------------------------------------- /test/detect_files/configure.ac: -------------------------------------------------------------------------------- 1 | dnl This is an autoconf file. 2 | 3 | AC_INIT([giant-space-monkey], [0.0]) 4 | AC_PREREQ(2.5) 5 | -------------------------------------------------------------------------------- /test/detect_files/configure.in: -------------------------------------------------------------------------------- 1 | dnl This is an autoconf file using the old name. 2 | 3 | AC_INIT([giant-space-monkey], [0.0]) 4 | AC_PREREQ(2.5) 5 | -------------------------------------------------------------------------------- /test/detect_files/coq.v: -------------------------------------------------------------------------------- 1 | Require Import String. 2 | (* comment *) 3 | Check "multiline 4 | string"%string. 5 | 6 | (* multiline 7 | comment *) 8 | 9 | (* recursion in (* a 10 | comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/detect_files/core.lisp: -------------------------------------------------------------------------------- 1 | ;; This file is part of testlib. 2 | (in-package :testlib) 3 | -------------------------------------------------------------------------------- /test/detect_files/cs1.cs: -------------------------------------------------------------------------------- 1 | // Class to test it all 2 | public class SomeClass 3 | { 4 | public static void Main () { 5 | SomeClass x = new SomeClass (); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/detect_files/d_script: -------------------------------------------------------------------------------- 1 | #!/usr/bin/dmd 2 | -------------------------------------------------------------------------------- /test/detect_files/eiffel.e: -------------------------------------------------------------------------------- 1 | class 2 | HELLO_WORLD 3 | create 4 | make 5 | feature 6 | make 7 | do 8 | -- prints "Hello world!" and starts new line 9 | 10 | print ("Hello, world!%N") 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/detect_files/emacs_mode_c: -------------------------------------------------------------------------------- 1 | /* -*- mode: C; -*- 2 | * The upper-case "C" mode should be interpreted as straight C, not C++ */ 3 | -------------------------------------------------------------------------------- /test/detect_files/empty.in: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/empty.in -------------------------------------------------------------------------------- /test/detect_files/empty.inc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/empty.inc -------------------------------------------------------------------------------- /test/detect_files/english.st: -------------------------------------------------------------------------------- 1 | a 2 | aa 3 | aardvark 4 | abacus 5 | apple 6 | zebra 7 | -------------------------------------------------------------------------------- /test/detect_files/example.xsl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/example.xsl -------------------------------------------------------------------------------- /test/detect_files/foo.bf: -------------------------------------------------------------------------------- 1 | >++++++[>+++[<<++++>>-]<-]<. 2 | >+++++[<++++++>-]<-. 3 | +++++++. 4 | . 5 | +++. 6 | >>++++[<++++++>-]<++[<--->-]<-. 7 | >>++[<+++++>-]<+[<+++++>-]<. 8 | >++++[<++++++>-]<. 9 | +++. 10 | ------. 11 | >++[<---->-]<. 12 | >>++[<+++++>-]<+[<------>-]<-. 13 | . 14 | . 15 | . 16 | . 17 | -------------------------------------------------------------------------------- /test/detect_files/foo.c: -------------------------------------------------------------------------------- 1 | // c file 2 | int function_a(void) { 3 | int x; 4 | } 5 | -------------------------------------------------------------------------------- /test/detect_files/foo.chai: -------------------------------------------------------------------------------- 1 | //ChaiScript file 2 | def dosomething() 3 | { 4 | } 5 | -------------------------------------------------------------------------------- /test/detect_files/foo.cmake: -------------------------------------------------------------------------------- 1 | # This is a cmake file. 2 | 3 | project(something) 4 | -------------------------------------------------------------------------------- /test/detect_files/foo.coffee: -------------------------------------------------------------------------------- 1 | # CoffeeScript sample 2 | square = (x) -> x * x 3 | -------------------------------------------------------------------------------- /test/detect_files/foo.d: -------------------------------------------------------------------------------- 1 | // d file 2 | int function_a(void) { 3 | int x; 4 | } 5 | -------------------------------------------------------------------------------- /test/detect_files/foo.dart: -------------------------------------------------------------------------------- 1 | // Example Dart code 2 | void main() { 3 | print("Hello, World!"); 4 | } -------------------------------------------------------------------------------- /test/detect_files/foo.dtx: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | \texbf Hello world 3 | 4 | 5 | % \acommand 6 | % \anothercommand 7 | %% sample comment 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /test/detect_files/foo.ebuild: -------------------------------------------------------------------------------- 1 | # This is an ebuild. 2 | # Distributed under the terms of the GNU General Public License v2 3 | # $Header: $ 4 | 5 | DESCRIPTION="An ebuild" 6 | HOMEPAGE="" 7 | SRC_URI="" 8 | 9 | LICENSE="" 10 | SLOT="0" 11 | KEYWORDS="~x86" 12 | IUSE="" 13 | 14 | DEPEND="" 15 | RDEPEND="" 16 | 17 | pkg_setup() { 18 | # This is foo 19 | einfo "This is foo" 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test/detect_files/foo.ec: -------------------------------------------------------------------------------- 1 | import "ecere" 2 | 3 | class HelloForm : Window 4 | { 5 | text = "My First eC Application"; 6 | borderStyle = sizable; 7 | size = { 280, 100 }; 8 | hasClose = true; 9 | 10 | Label label 11 | { 12 | this, position = { 10, 10 }, font = { "Arial", 30 }, 13 | text = "Hello, World!!" 14 | }; 15 | }; 16 | 17 | HelloForm hello { }; 18 | -------------------------------------------------------------------------------- /test/detect_files/foo.eclass: -------------------------------------------------------------------------------- 1 | # 2 | # This is an eclass. It should show up as type 'ebuild'. 3 | # 4 | 5 | EXPORT_FUNCTIONS pkg_postinst 6 | 7 | foo_pkg_postinst() { 8 | einfo "Welcome to foo" 9 | } 10 | 11 | -------------------------------------------------------------------------------- /test/detect_files/foo.exheres-0: -------------------------------------------------------------------------------- 1 | # This is an exheres. 2 | 3 | require subversion bash-completion eutils flag-o-matic 4 | 5 | DESCRIPTION="An exheres" 6 | HOMEPAGE="http://example.org/" 7 | SRC_URI="" 8 | 9 | MYOPTIONS="monkey" 10 | LICENSE="GPL-2" 11 | SLOT="0" 12 | PLATFORMS="~amd64 ~ia64 ~x86" 13 | 14 | DEPENDENCIES="" 15 | 16 | src_prepare() { 17 | default 18 | ./autogen.bash || die "autogen.bash failed" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/detect_files/foo.exlib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/foo.exlib -------------------------------------------------------------------------------- /test/detect_files/foo.glsl: -------------------------------------------------------------------------------- 1 | // GLSL fragment shader 2 | uniform sampler2D tex; 3 | 4 | void main() { 5 | gl_FragColor = gl_Color * texture2D(tex, gl_TexCoord[0].xy); 6 | } -------------------------------------------------------------------------------- /test/detect_files/foo.in.in: -------------------------------------------------------------------------------- 1 | [Foo] 2 | Foo=Bar 3 | -------------------------------------------------------------------------------- /test/detect_files/foo.lgt: -------------------------------------------------------------------------------- 1 | % this is a Logtalk source file 2 | 3 | :- object(hello_world). 4 | 5 | % the initialization/1 directive argument is automatically executed 6 | % when the object is loaded into memory: 7 | :- initialization((nl, write('********** Hello World! **********'), nl)). 8 | 9 | :- end_object. 10 | -------------------------------------------------------------------------------- /test/detect_files/foo.mk: -------------------------------------------------------------------------------- 1 | # This is a makefile. 2 | 3 | giant_space_monkey : giant_space_monkey.c 4 | $(CC) $(CFLAGS) -o $@ $? 5 | 6 | -------------------------------------------------------------------------------- /test/detect_files/foo.nsh: -------------------------------------------------------------------------------- 1 | ; No need for special content in here, detected by extension 2 | -------------------------------------------------------------------------------- /test/detect_files/foo.nsi: -------------------------------------------------------------------------------- 1 | ; No need for special content in here, detected by extension 2 | -------------------------------------------------------------------------------- /test/detect_files/foo.pro: -------------------------------------------------------------------------------- 1 | pro foo 2 | 3 | print, 'hello world!' 4 | 5 | end 6 | -------------------------------------------------------------------------------- /test/detect_files/foo.qml: -------------------------------------------------------------------------------- 1 | import QtQuick 2.0 2 | 3 | Rectangle { 4 | width: 200 5 | height: 200 6 | color: "crimson" 7 | } 8 | -------------------------------------------------------------------------------- /test/detect_files/foo.rb: -------------------------------------------------------------------------------- 1 | # a ruby script 2 | File.open("blah") do |io| 3 | a = io.read 4 | end 5 | -------------------------------------------------------------------------------- /test/detect_files/foo.run: -------------------------------------------------------------------------------- 1 | # An AMPL script 2 | print 42; 3 | -------------------------------------------------------------------------------- /test/detect_files/foo.swift: -------------------------------------------------------------------------------- 1 | class Person { 2 | func sayHelloWorld() { // Code appended with line comment 3 | print("Hello World") /* Code appended with block comment */ 4 | } 5 | } 6 | -------------------------------------------------------------------------------- /test/detect_files/foo.tex: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | \texbf Hello world 3 | 4 | 5 | % ... 6 | % sample comment 7 | 8 | \end{document} 9 | -------------------------------------------------------------------------------- /test/detect_files/foo.uc: -------------------------------------------------------------------------------- 1 | class foo extends Actor; 2 | 3 | /** An UnrealScript 3 styled comment. */ 4 | var bool bFoo; 5 | 6 | simulated function PostBeginPlay() 7 | { 8 | // Comment 9 | log(self@"Hello World! Foo is"@bFoo); // Another comment 10 | /* A 11 | block 12 | comment */ 13 | Super.PostBeginPlay(); 14 | } 15 | 16 | defaultproperties 17 | { 18 | bFoo = true 19 | } 20 | -------------------------------------------------------------------------------- /test/detect_files/foo.vala: -------------------------------------------------------------------------------- 1 | // Class to test it all 2 | public class SomeClass 3 | { 4 | public static void Main () { 5 | SomeClass x = new SomeClass (); 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /test/detect_files/foo.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Test file for ohcount 3 | " Author: Ciaran McCreesh 4 | " 5 | " This is a test vim syntax file for ohcount. 6 | " 7 | 8 | if &compatible || v:version < 700 9 | finish 10 | endif 11 | -------------------------------------------------------------------------------- /test/detect_files/foo.z80: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/foo.z80 -------------------------------------------------------------------------------- /test/detect_files/foo_glsl.frag: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/detect_files/foo_glsl.frag -------------------------------------------------------------------------------- /test/detect_files/foo_glsl.vert: -------------------------------------------------------------------------------- 1 | // GLSL vertex shader 2 | void main() { 3 | gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; 4 | } -------------------------------------------------------------------------------- /test/detect_files/foo_mathematica.m: -------------------------------------------------------------------------------- 1 | foo[x_] := b 2 | (* a comment *) 3 | -------------------------------------------------------------------------------- /test/detect_files/foo_matlab.m: -------------------------------------------------------------------------------- 1 | function foo = b 2 | % a comment 3 | end 4 | -------------------------------------------------------------------------------- /test/detect_files/foo_objective_c.h: -------------------------------------------------------------------------------- 1 | @interface 2 | @end 3 | 4 | -------------------------------------------------------------------------------- /test/detect_files/foo_objective_c.m: -------------------------------------------------------------------------------- 1 | // c_comment 2 | i = 2; 3 | -------------------------------------------------------------------------------- /test/detect_files/foo_octave.m: -------------------------------------------------------------------------------- 1 | function foo 2 | ## a comment 3 | endfunction 4 | -------------------------------------------------------------------------------- /test/detect_files/foo_perl1.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl 2 | print "Hello, world!\n"; 3 | -------------------------------------------------------------------------------- /test/detect_files/foo_perl2.pl: -------------------------------------------------------------------------------- 1 | 2 | # Also a Perl file but without the shebang line 3 | print "Hello, world!\n"; -------------------------------------------------------------------------------- /test/detect_files/foo_prolog1.pl: -------------------------------------------------------------------------------- 1 | 2 | % select(Element, List, Remaining) 3 | 4 | select(H, [H| T], T). 5 | select(H, [X| R], [X| T]) :- 6 | select(H, R, T). -------------------------------------------------------------------------------- /test/detect_files/foo_r.R: -------------------------------------------------------------------------------- 1 | dummy<-function() { 2 | # A dummy function to test the R language parser. 3 | 1.0 4 | } 5 | 6 | -------------------------------------------------------------------------------- /test/detect_files/foo_rebol_lower.r: -------------------------------------------------------------------------------- 1 | ; a rebol script 2 | rebol [] 3 | 4 | ; A dummy function to test the REBOL language parser. 5 | dummy: func [] [ 6 | read %blah 7 | ] 8 | -------------------------------------------------------------------------------- /test/detect_files/foo_rebol_upper.r: -------------------------------------------------------------------------------- 1 | ; a rebol script 2 | REBOL [] 3 | 4 | ; A dummy function to test the REBOL language parser. 5 | dummy: func [] [ 6 | read %blah 7 | ] 8 | -------------------------------------------------------------------------------- /test/detect_files/foo_upper_case.C: -------------------------------------------------------------------------------- 1 | // c file 2 | int function_a(void) { 3 | int x; 4 | } 5 | -------------------------------------------------------------------------------- /test/detect_files/foo_upper_case.RB: -------------------------------------------------------------------------------- 1 | # a ruby script 2 | File.open("blah") do |io| 3 | a = io.read 4 | end 5 | -------------------------------------------------------------------------------- /test/detect_files/forth.4th: -------------------------------------------------------------------------------- 1 | \ Sample Forth code 2 | 3 | ( This is a comment 4 | spanning multiple lines ) 5 | 6 | : somedefinition ; 7 | 8 | -------------------------------------------------------------------------------- /test/detect_files/forth.fr: -------------------------------------------------------------------------------- 1 | \ Sample Forth code 2 | 3 | ( This is a comment 4 | spanning multiple lines ) 5 | 6 | : somedefinition ; 7 | 8 | -------------------------------------------------------------------------------- /test/detect_files/forth.fs: -------------------------------------------------------------------------------- 1 | \ Sample Forth code 2 | 3 | ( This is a comment 4 | spanning multiple lines ) 5 | 6 | : somedefinition ; 7 | 8 | -------------------------------------------------------------------------------- /test/detect_files/fortranfixed.f: -------------------------------------------------------------------------------- 1 | PROGRAM fortranfixedcheck 2 | ! Simple check. Not valid free-form because of the continuation. 3 | WRITE(*,*) 4 | + 'foo' 5 | GOTO 22 6 | 22 WRITE(*,*) 'bar' 7 | END 8 | -------------------------------------------------------------------------------- /test/detect_files/fortranfree.f: -------------------------------------------------------------------------------- 1 | ! -*- F90 -*- 2 | program fortranfreecheck 3 | ! Simple check. Not valid fixed form thanks to code starting in first column. 4 | write(*,*) 2 + & 5 | & 2 6 | goto 22 7 | 22 write(*,*) 'bar' 8 | end program fortranfreecheck 9 | -------------------------------------------------------------------------------- /test/detect_files/fs1.fs: -------------------------------------------------------------------------------- 1 | // a F# file 2 | type FilterNode(provider, token, filter: FilterExpression, node_list) = 3 | inherit TagNode(provider, token) 4 | -------------------------------------------------------------------------------- /test/detect_files/grace1.grace: -------------------------------------------------------------------------------- 1 | // Sample Grace code 2 | 3 | import "parsers-test" as parsers 4 | 5 | class exports { 6 | def program = rule {codeSequence ~ rep(ws) ~ end} 7 | } 8 | -------------------------------------------------------------------------------- /test/detect_files/grace2.grc: -------------------------------------------------------------------------------- 1 | // Sample Grace code 2 | print "OK" 3 | -------------------------------------------------------------------------------- /test/detect_files/java_emac.rb: -------------------------------------------------------------------------------- 1 | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | # a ruby script 3 | File.open("blah") do |io| 4 | a = io.read 5 | end 6 | -------------------------------------------------------------------------------- /test/detect_files/javascript_emacs.js: -------------------------------------------------------------------------------- 1 | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 2 | 'use strict'; 3 | 4 | require('./external/shelljs/make'); 5 | var builder = require('./external/builder/builder.js'); 6 | var crlfchecker = require('./external/crlfchecker/crlfchecker.js'); 7 | var path = require('path'); 8 | -------------------------------------------------------------------------------- /test/detect_files/m4.m4: -------------------------------------------------------------------------------- 1 | # Sample M4 file 2 | 3 | AC_DEFUN([SAMPLE],[ 4 | AC_REQUIRE([ANOTHER_SAMPLE]) 5 | printf "$2" >> "$1" 6 | ]) 7 | -------------------------------------------------------------------------------- /test/detect_files/modula2.mod: -------------------------------------------------------------------------------- 1 | (* Modula-2 module *) 2 | MODULE Hello; 3 | FROM STextIO IMPORT WriteString; 4 | BEGIN 5 | WriteString("Hello World!"); 6 | END Hello. 7 | -------------------------------------------------------------------------------- /test/detect_files/module-definition.def: -------------------------------------------------------------------------------- 1 | EXPORTS 2 | DllCanUnloadNow PRIVATE 3 | DllGetClassObject PRIVATE 4 | DllRegisterServer PRIVATE 5 | DllUnregisterServer PRIVATE 6 | -------------------------------------------------------------------------------- /test/detect_files/ocaml.ml: -------------------------------------------------------------------------------- 1 | (** documentation *) 2 | print_string "Hello world!\n";; 3 | (**/**) 4 | (* extra comment *) 5 | 6 | (* multiline 7 | comment*) 8 | 9 | (* recursion in (* a 10 | comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/detect_files/perl_shebang_prolog_body.pl: -------------------------------------------------------------------------------- 1 | #!%PERL% 2 | % This is prolog code, but the shebang says perl, so we respect the shebang and choose perl. 3 | Head :- Body. 4 | -------------------------------------------------------------------------------- /test/detect_files/perl_w: -------------------------------------------------------------------------------- 1 | #! perl -w 2 | # 3 | 4 | use strict; 5 | use warnings; 6 | use diagnostics; 7 | -------------------------------------------------------------------------------- /test/detect_files/perl_with_smiley.pl: -------------------------------------------------------------------------------- 1 | # This is not prolog. Do not be confused by the smiley, which looks like a Prolog rule. 2 | print "Hello, world :-)\n" 3 | -------------------------------------------------------------------------------- /test/detect_files/php.inc: -------------------------------------------------------------------------------- 1 | 4 | -------------------------------------------------------------------------------- /test/detect_files/puppet_import.pp: -------------------------------------------------------------------------------- 1 | import "classes/*.pp" 2 | import "definitions/*.pp" 3 | -------------------------------------------------------------------------------- /test/detect_files/puppet_import_annotated.pp: -------------------------------------------------------------------------------- 1 | puppet lcode import "classes/*.pp" 2 | puppet lcode import "definitions/*.pp" 3 | -------------------------------------------------------------------------------- /test/detect_files/puppet_test.pp: -------------------------------------------------------------------------------- 1 | class main::sub { 2 | include substuff 3 | } 4 | -------------------------------------------------------------------------------- /test/detect_files/puppet_test_annotated.pp: -------------------------------------------------------------------------------- 1 | puppet lcode class main::sub { 2 | puppet lcode include substuff 3 | puppet lcode } 4 | -------------------------------------------------------------------------------- /test/detect_files/qmake.pro: -------------------------------------------------------------------------------- 1 | CONFIG += qt debug 2 | HEADERS += hello.h 3 | SOURCES += hello.cpp 4 | SOURCES += main.cpp 5 | win32 { 6 | SOURCES += hellowin.cpp 7 | } 8 | unix { 9 | SOURCES += hellounix.cpp 10 | } 11 | !exists( main.cpp ) { 12 | error( "No main.cpp file found" ) 13 | } 14 | win32:debug { 15 | CONFIG += console 16 | } 17 | -------------------------------------------------------------------------------- /test/detect_files/ruby_script: -------------------------------------------------------------------------------- 1 | #!/usr/local/bin/ruby 2 | require File.dirname(__FILE__) + '/../lib/slave/slave' 3 | Slave.daemonize 4 | -------------------------------------------------------------------------------- /test/detect_files/rust.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the example given by www.rust-lang.org 3 | */ 4 | // Line comments work too 5 | fn main() { 6 | let nums = [1, 2]; 7 | let noms = ["Tim", "Eston", "Aaron", "Ben"]; 8 | 9 | let mut odds = nums.iter().map(|&x| x * 2 - 1); 10 | 11 | for num in odds { 12 | do spawn { 13 | println!("{:s} says hello from a lightweight thread!", noms[num]); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/detect_files/sampleDef.def: -------------------------------------------------------------------------------- 1 | DEFINITION MODULE Sample; (* in Modula-2 *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...'; 10 | dqString = "this is a string within 'a string' ..."; 11 | 12 | END Sample. 13 | -------------------------------------------------------------------------------- /test/detect_files/stratego.str: -------------------------------------------------------------------------------- 1 | /** 2 | * Sample code from Stratego XT Manual 3 | */ 4 | 5 | rules 6 | InlineF : 7 | |[ let f(xs) = e in e'[f(es)] ]| -> 8 | |[ let f(xs) = e in e'[e[es/xs]] ]| 9 | 10 | InlineV : 11 | |[ let x = e in e'[x] ]| -> |[ let x = e in e'[e] ]| 12 | 13 | Dead : 14 | |[ let x = e in e' ]| -> |[ e' ]| 15 | where (x,e') 16 | 17 | Extract(f,xs) : 18 | |[ e ]| -> |[ let f(xs) = e in f(xs) ]| 19 | 20 | Hoist : 21 | |[ let x = e1 in let f(xs) = e2 in e3 ]| -> 22 | |[ let f(xs) = e2 in let x = e1 in e3 ]| 23 | where (x, e2) 24 | -------------------------------------------------------------------------------- /test/detect_files/structured_basic.b: -------------------------------------------------------------------------------- 1 | INPUT "What is your name: "; U$ 2 | PRINT "Hello "; U$ 3 | REM Test 4 | INPUT "How many stars do you want: "; N 5 | S$ = "" 6 | FOR I = 1 TO N 7 | S$ = S$ + "*" 8 | NEXT I 9 | PRINT S$ 10 | 11 | REM 12 | INPUT "Do you want more stars? "; A$ 13 | IF LEN(A$) = 0 THEN GOTO 110 14 | A$ = LEFT$(A$, 1) 15 | IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | PRINT "Goodbye "; 17 | FOR I = 1 TO 200 18 | PRINT U$; " "; 19 | NEXT I 20 | PRINT 21 | -------------------------------------------------------------------------------- /test/detect_files/t1.m: -------------------------------------------------------------------------------- 1 | #include 2 | #include "Test.h" 3 | 4 | @implementation Test : Object 5 | { 6 | int x; 7 | } 8 | 9 | - init: (int)n 10 | { 11 | [super init]; 12 | x = n; 13 | return self; 14 | } 15 | 16 | + test: (int)n 17 | { 18 | return [[self alloc] init: n]; 19 | } 20 | 21 | - (int)x 22 | { 23 | return x; 24 | } 25 | 26 | @end 27 | 28 | 29 | int main (int argc, char **argv) 30 | { 31 | printf ("%d!\n", [[Test test: 17231] x]); 32 | } 33 | -------------------------------------------------------------------------------- /test/detect_files/tcl_script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # -*-Mode: TCL;-*- 3 | # the next line restarts using wish \ 4 | exec wish "$0" "$@" 5 | 6 | button .hello -text Hello \ 7 | -command {puts stdout "Hello, World!"} 8 | pack .hello -padx 20 -pady 10 9 | -------------------------------------------------------------------------------- /test/detect_files/upper_case_php: -------------------------------------------------------------------------------- 1 | 3 | -------------------------------------------------------------------------------- /test/detect_files/uses_cpp_headers.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | foo::Foo get_foo(); 4 | 5 | -------------------------------------------------------------------------------- /test/detect_files/uses_cpp_keywords.h: -------------------------------------------------------------------------------- 1 | namespace monkey { 2 | template struct Monkey; 3 | } 4 | 5 | -------------------------------------------------------------------------------- /test/detect_files/uses_cpp_modeline: -------------------------------------------------------------------------------- 1 | /* -*- C++ -*- */ 2 | 3 | -------------------------------------------------------------------------------- /test/detect_files/uses_cpp_stdlib_headers.h: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | std::string foo(); 4 | -------------------------------------------------------------------------------- /test/detect_files/uses_no_cpp.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int superstat(const char * path, struct stat * buf); 6 | -------------------------------------------------------------------------------- /test/detect_files/visual_basic.bas: -------------------------------------------------------------------------------- 1 | INPUT "What is your name: "; U$ 2 | PRINT "Hello "; U$ 3 | REM Test 4 | INPUT "How many stars do you want: "; N 5 | S$ = "" 6 | FOR I = 1 TO N 7 | S$ = S$ + "*" 8 | NEXT I 9 | PRINT S$ 10 | 11 | REM 12 | INPUT "Do you want more stars? "; A$ 13 | IF LEN(A$) = 0 THEN GOTO 110 14 | A$ = LEFT$(A$, 1) 15 | IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | PRINT "Goodbye "; 17 | FOR I = 1 TO 200 18 | PRINT U$; " "; 19 | NEXT I 20 | PRINT 21 | -------------------------------------------------------------------------------- /test/detect_files/xml.custom_ext: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/expected_dir/Makefile: -------------------------------------------------------------------------------- 1 | make comment # This is a makefile. 2 | make blank 3 | make code giant_space_monkey : giant_space_monkey.c 4 | make code $(CC) $(CFLAGS) -o $@ $? 5 | make blank 6 | -------------------------------------------------------------------------------- /test/expected_dir/Makefile.am: -------------------------------------------------------------------------------- 1 | automake comment # This is an automake file 2 | automake code EXTRA_DIST = giant-space-monkey.txt 3 | automake blank 4 | -------------------------------------------------------------------------------- /test/expected_dir/abstract_crystal.cr: -------------------------------------------------------------------------------- 1 | crystal code abstract class Animal 2 | crystal code abstract def talk 3 | crystal code end 4 | crystal code end 5 | -------------------------------------------------------------------------------- /test/expected_dir/ada1.ada: -------------------------------------------------------------------------------- 1 | ada code with Ada.Text_IO; use Ada.Text_IO; 2 | ada blank 3 | ada code procedure Get_Name is 4 | ada blank 5 | ada code Name : String (1..80); 6 | ada code Length : Integer; 7 | ada blank 8 | ada code begin 9 | ada comment -- no variables needed here :) 10 | ada blank 11 | ada code Put ("Enter your first name> "); 12 | ada code Get_Line (Name, Length); 13 | ada code New_Line; 14 | ada code Put ("Hello "); 15 | ada code Put (Name (1..Length)); 16 | ada code Put (", we hope that you enjoy learning Ada!"); 17 | ada blank 18 | ada code end Get_Name; 19 | -------------------------------------------------------------------------------- /test/expected_dir/ada1.adb: -------------------------------------------------------------------------------- 1 | ada code with Ada.Text_IO; use Ada.Text_IO; 2 | ada blank 3 | ada code procedure Get_Name is 4 | ada blank 5 | ada code Name : String (1..80); 6 | ada code Length : Integer; 7 | ada blank 8 | ada code begin 9 | ada comment -- no variables needed here :) 10 | ada blank 11 | ada code Put ("Enter your first name> "); 12 | ada code Get_Line (Name, Length); 13 | ada code New_Line; 14 | ada code Put ("Hello "); 15 | ada code Put (Name (1..Length)); 16 | ada code Put (", we hope that you enjoy learning Ada!"); 17 | ada blank 18 | ada code end Get_Name; 19 | -------------------------------------------------------------------------------- /test/expected_dir/ampl.mod: -------------------------------------------------------------------------------- 1 | ampl comment /* This is a test file for AMPL 2 | ampl comment * This is a multiline comment 3 | ampl comment */ 4 | ampl blank 5 | ampl comment # An AMPL model 6 | ampl code var x >= 42; # variable definition. 7 | ampl code minimize o: x; 8 | -------------------------------------------------------------------------------- /test/expected_dir/assembler2.S: -------------------------------------------------------------------------------- 1 | assembler comment /******************************************************** 2 | assembler comment Made up assembler file, in the style of linux kernel 3 | assembler comment ********************************************************/ 4 | assembler blank 5 | assembler code #define FOO 43 // they even use whack-whack comments 6 | assembler blank 7 | assembler code mov eax, ecx 8 | -------------------------------------------------------------------------------- /test/expected_dir/augeas.aug: -------------------------------------------------------------------------------- 1 | augeas comment (** documentation *) 2 | augeas code module Augeas = 3 | augeas code autoload xfm 4 | augeas comment (**/**) 5 | augeas comment (* extra comment *) 6 | augeas blank 7 | augeas comment (* multiline 8 | augeas comment comment*) 9 | augeas code let lns = Shellvars.lns 10 | augeas blank 11 | augeas comment (* recursion in (* a 12 | augeas comment comment *) to complicate things *) 13 | augeas code let filter = incl "/foo/bar" 14 | augeas code let xfm = transform lns filter 15 | -------------------------------------------------------------------------------- /test/expected_dir/bat1.bat: -------------------------------------------------------------------------------- 1 | bat comment REM comment 1 2 | bat comment rem comment 2 3 | bat comment rEm comment 3 4 | bat comment rEm.comment 4 5 | bat comment Rem=comment 5 6 | bat comment @Rem comment 6 7 | bat comment @reM=comment 7 8 | bat comment ::comment 8 9 | bat blank 10 | bat code echo not a rem comment! 11 | bat blank 12 | -------------------------------------------------------------------------------- /test/expected_dir/brainfuck.bf: -------------------------------------------------------------------------------- 1 | brainfuck comment Print "Hello World!!!!!" 2 | brainfuck blank 3 | brainfuck code Line that does nothing: >< 4 | brainfuck code >++++++[>+++[<<++++>>-]<-]<. 5 | brainfuck code >+++++[<++++++>-]<-. 6 | brainfuck code +++++++. 7 | brainfuck code . 8 | brainfuck code +++. 9 | brainfuck code >>++++[<++++++>-]<++[<--->-]<-. 10 | brainfuck code >>++[<+++++>-]<+[<+++++>-]<. 11 | brainfuck code >++++[<++++++>-]<. 12 | brainfuck code +++. 13 | brainfuck code ------. 14 | brainfuck code >++[<---->-]<. 15 | brainfuck code >>++[<+++++>-]<+[<------>-]<-. 16 | brainfuck code . 17 | brainfuck code . 18 | brainfuck code . 19 | brainfuck code . 20 | -------------------------------------------------------------------------------- /test/expected_dir/c2.h.in: -------------------------------------------------------------------------------- 1 | c comment /* c2.h.in. */ 2 | c blank 3 | c code #ifndef C2_H 4 | c code #define C2_H 5 | c blank 6 | c comment /* Define to 1 if you have the header file. */ 7 | c code #undef HAVE_INTTYPES_H 8 | c blank 9 | c comment /* Define to 1 if you have the `m' library (-lm). */ 10 | c code #undef HAVE_LIBM 11 | c blank 12 | c comment /* Define to 1 if you have the ANSI C header files. */ 13 | c code #undef STDC_HEADERS 14 | c blank 15 | c code #endif 16 | -------------------------------------------------------------------------------- /test/expected_dir/c_binding_crystal.cr: -------------------------------------------------------------------------------- 1 | crystal code @[Link(ldflags: "/home/alex/projects/fisbot/lib/ohcount/ohcount.so")] 2 | crystal blank 3 | crystal code lib OhcountC 4 | crystal code fun ohcount_sourcefile_new(filepath : LibC::Char*) : Int32* 5 | crystal code end 6 | -------------------------------------------------------------------------------- /test/expected_dir/c_str.c: -------------------------------------------------------------------------------- 1 | c code p = '"'; 2 | c comment /* this should be a comment */ 3 | -------------------------------------------------------------------------------- /test/expected_dir/chaiscript.chai: -------------------------------------------------------------------------------- 1 | chaiscript comment /* 2 | chaiscript comment Random Comments 3 | chaiscript comment Foo Foo Foo 4 | chaiscript comment */ 5 | chaiscript code var submenu=1; 6 | chaiscript comment // comment 7 | chaiscript comment // another comment 8 | chaiscript code submenu += 10 9 | chaiscript code var f = fun() { 5 }; 10 | chaiscript code def myFun(i) : i > 0 { 11 | chaiscript code return i + 10; 12 | chaiscript code } 13 | chaiscript blank 14 | chaiscript blank 15 | chaiscript comment // some comment 16 | chaiscript code var delay_hide=500 17 | chaiscript code b=0 18 | -------------------------------------------------------------------------------- /test/expected_dir/clearsilver_template1.cs: -------------------------------------------------------------------------------- 1 | html code 2 | html code 3 | clearsilver comment

4 | clearsilver code

5 | html code 6 | html code 7 | -------------------------------------------------------------------------------- /test/expected_dir/click_me.xaml: -------------------------------------------------------------------------------- 1 | xaml comment 2 | xaml code 6 | xaml code 7 | xaml code 8 | -------------------------------------------------------------------------------- /test/expected_dir/cobol1.cbl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/expected_dir/cobol1.cbl -------------------------------------------------------------------------------- /test/expected_dir/configure.ac: -------------------------------------------------------------------------------- 1 | autoconf comment dnl This is an autoconf file. 2 | autoconf blank 3 | autoconf code AC_INIT([giant-space-monkey], [0.0]) 4 | autoconf code AC_PREREQ(2.5) 5 | autoconf blank 6 | -------------------------------------------------------------------------------- /test/expected_dir/coq.v: -------------------------------------------------------------------------------- 1 | coq code Require Import String. 2 | coq comment (* comment *) 3 | coq code Check "multiline 4 | coq code string"%string. 5 | coq blank 6 | coq comment (* multiline 7 | coq comment comment *) 8 | coq blank 9 | coq comment (* recursion in (* a 10 | coq comment comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/expected_dir/css1.css: -------------------------------------------------------------------------------- 1 | css code .foo { 2 | css code padding: 10px; 3 | css code } 4 | -------------------------------------------------------------------------------- /test/expected_dir/dcl.com: -------------------------------------------------------------------------------- 1 | dcl comment $! Test file for DCL parser 2 | dcl comment $ ! Written by Camiel Vanderhoeven 3 | dcl blank 4 | dcl blank 5 | dcl code $ SET VERIFY 6 | dcl code $ WRITE SYS$SYSTEM 7 | dcl code This is some text 8 | dcl blank 9 | dcl code $ EXIT 10 | dcl comment $! This is comment again 11 | dcl comment $! 12 | dcl blank 13 | -------------------------------------------------------------------------------- /test/expected_dir/diff1_new.html: -------------------------------------------------------------------------------- 1 | html code 2 | html code 3 | html code 5 | html code 9 | html code 10 | html code new 11 | html code 12 | -------------------------------------------------------------------------------- /test/expected_dir/diff1_old.html: -------------------------------------------------------------------------------- 1 | html code 2 | html code 3 | html code 7 | html code 9 | html code 10 | html code old 11 | html code 12 | -------------------------------------------------------------------------------- /test/expected_dir/diff2_new.c: -------------------------------------------------------------------------------- 1 | c comment /* new */ 2 | c code #include 'foo.c' 3 | c comment /* common */ 4 | c code int do_stuff(old_code) { 5 | c code int common; 6 | c code int new_var; 7 | c code } 8 | -------------------------------------------------------------------------------- /test/expected_dir/diff2_old.c: -------------------------------------------------------------------------------- 1 | c comment /* old */ 2 | c code #include 'foo.c' 3 | c comment /* common */ 4 | c code int do_stuff(old_code) { 5 | c code int common; 6 | c code int old_var; 7 | c code } 8 | -------------------------------------------------------------------------------- /test/expected_dir/diff3_new.xml: -------------------------------------------------------------------------------- 1 | xml code 2 | xml code new 3 | xml code 4 | -------------------------------------------------------------------------------- /test/expected_dir/diff3_old.xml: -------------------------------------------------------------------------------- 1 | xml code 2 | xml code old 3 | xml code 4 | -------------------------------------------------------------------------------- /test/expected_dir/eiffel.e: -------------------------------------------------------------------------------- 1 | eiffel code class 2 | eiffel code HELLO_WORLD 3 | eiffel code create 4 | eiffel code make 5 | eiffel code feature 6 | eiffel code make 7 | eiffel code do 8 | eiffel comment -- prints "Hello world!" and starts new line 9 | eiffel blank 10 | eiffel code print ("Hello, world!%N") 11 | eiffel blank 12 | eiffel code end 13 | eiffel code end 14 | -------------------------------------------------------------------------------- /test/expected_dir/english.st: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/expected_dir/english.st -------------------------------------------------------------------------------- /test/expected_dir/example.qml: -------------------------------------------------------------------------------- 1 | qml comment // Just an example of QML file... 2 | qml blank 3 | qml code import QtQuick 2.0 4 | qml blank 5 | qml code Rectangle { 6 | qml code width: 200 7 | qml code height: 200 8 | qml code color: "crimson" 9 | qml blank 10 | qml code MouseArea { 11 | qml code anchors.fill: parent 12 | qml code onClicked: { 13 | qml comment // Was clicked 14 | qml code Qt.quit(); 15 | qml code } 16 | qml code } 17 | qml code } 18 | -------------------------------------------------------------------------------- /test/expected_dir/example.rkt: -------------------------------------------------------------------------------- 1 | racket comment ;; language declaration commented out until someone extends the 2 | racket comment ;; parser to support it: 3 | racket blank 4 | racket comment ;; #lang racket 5 | racket blank 6 | racket comment ;; Report each unique line from stdin 7 | racket code (let ([saw (make-hash)]) 8 | racket code (for ([line (in-lines)]) 9 | racket code (unless (hash-ref saw line #f) 10 | racket code (displayln line)) 11 | racket code (hash-set! saw line #t))) 12 | racket blank 13 | -------------------------------------------------------------------------------- /test/expected_dir/factor1.factor: -------------------------------------------------------------------------------- 1 | factor comment ! This is a comment 2 | factor comment ! Factor syntax is very simple, it just contains words separated by spaces 3 | factor comment ! '!' is a line comment word 4 | factor comment ! "whatever" is a string word 5 | factor code USING: kernel io ; ! This is a vocabulary inclusion word 6 | factor code IN: testing 7 | factor blank 8 | factor code : test-string ( -- ) 9 | factor code "this is a string" print ; 10 | factor blank 11 | factor code : test ( x -- y ) ! Parenthesis define a stack effect declaration 12 | factor code dup swap drop ; 13 | factor blank 14 | factor code MAIN: test 15 | -------------------------------------------------------------------------------- /test/expected_dir/fb.js: -------------------------------------------------------------------------------- 1 | javascript code function escapeHTML(value) 2 | javascript code { 3 | javascript code return String(value).replace(/[<>&"']/g, replaceChars); 4 | javascript code } 5 | javascript blank 6 | javascript code window.onerror = onError; 7 | javascript blank 8 | javascript code if (document.documentElement.getAttribute("debug") == "true") 9 | javascript code toggleConsole(true); 10 | -------------------------------------------------------------------------------- /test/expected_dir/foo.dart: -------------------------------------------------------------------------------- 1 | dart code void main() { 2 | dart comment // Line comment 3 | dart blank 4 | dart comment /* Block 5 | dart comment comment */ 6 | dart blank 7 | dart code print("Hello!"); // Code with line comment 8 | dart code print("World!"); /* Code with block comment */ 9 | dart code } 10 | -------------------------------------------------------------------------------- /test/expected_dir/foo.dtx: -------------------------------------------------------------------------------- 1 | tex_dtx code \begin{document} 2 | tex_dtx code \texbf Hello world 3 | tex_dtx blank 4 | tex_dtx blank 5 | tex_dtx code % \acommand 6 | tex_dtx code % \anothercommand 7 | tex_dtx comment %% sample comment 8 | tex_dtx blank 9 | tex_dtx code \end{document} 10 | -------------------------------------------------------------------------------- /test/expected_dir/foo.ebuild: -------------------------------------------------------------------------------- 1 | ebuild comment # This is an ebuild. 2 | ebuild comment # Distributed under the terms of the GNU General Public License v2 3 | ebuild comment # $Header: $ 4 | ebuild blank 5 | ebuild code DESCRIPTION="An ebuild" 6 | ebuild code HOMEPAGE="" 7 | ebuild code SRC_URI="" 8 | ebuild blank 9 | ebuild code LICENSE="" 10 | ebuild code SLOT="0" 11 | ebuild code KEYWORDS="~x86" 12 | ebuild code IUSE="" 13 | ebuild blank 14 | ebuild code DEPEND="" 15 | ebuild code RDEPEND="" 16 | ebuild blank 17 | ebuild code pkg_setup() { 18 | ebuild comment # This is foo 19 | ebuild code einfo "This is foo" 20 | ebuild code } 21 | ebuild blank 22 | -------------------------------------------------------------------------------- /test/expected_dir/foo.glsl: -------------------------------------------------------------------------------- 1 | glsl comment // GLSL vertex shader 2 | glsl code void main() { 3 | glsl code gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; 4 | glsl code } -------------------------------------------------------------------------------- /test/expected_dir/foo.lc: -------------------------------------------------------------------------------- 1 | livecode comment # Comment 2 | livecode comment -- Comment 3 | livecode comment // Comment 4 | livecode blank 5 | livecode comment /* 6 | livecode blank 7 | livecode comment Block Comment 8 | livecode blank 9 | livecode comment */ 10 | livecode blank 11 | livecode code on mouseUp 12 | livecode code doSomething 13 | livecode code end mouseUp 14 | -------------------------------------------------------------------------------- /test/expected_dir/foo.nsh: -------------------------------------------------------------------------------- 1 | nsis comment ; NSIS "header" libraries can be in .nsh files. 2 | nsis comment /* Copyright some time 3 | nsis comment * never 4 | nsis comment * and not much of that either 5 | nsis comment "still a comment" 6 | nsis comment */ 7 | nsis blank 8 | nsis code !macro SillyMacro Param1 9 | nsis comment ; ... Because we can ;-) 10 | nsis code !error "Why did you call this macro, ${Param1}? That was silly." 11 | nsis code !macroend 12 | nsis blank 13 | nsis code Function Die 14 | nsis comment # Likewise, because we can. 15 | nsis code DetailPrint "Aarrrrggghh! I died." 16 | nsis code Quit 17 | nsis code FunctionEnd 18 | -------------------------------------------------------------------------------- /test/expected_dir/foo.nsi: -------------------------------------------------------------------------------- 1 | nsis comment ; some nsis code 2 | nsis comment /* 3 | nsis comment * lorem 4 | nsis comment ipsum 5 | nsis comment dolor sit amet etcetera 6 | nsis comment */ 7 | nsis blank 8 | nsis code !include LogicLib.nsh 9 | nsis code OutFile foo.exe 10 | nsis blank 11 | nsis code Section 12 | nsis code IfFileExists ${__FILE__} 0 +2 ; comments can be inline 13 | nsis comment # Use of ; in a string on the next line 14 | nsis code MessageBox MB_OK "You moved this installer file; you shouldn't do that ;-)" 15 | nsis code SectionEnd 16 | -------------------------------------------------------------------------------- /test/expected_dir/foo.swift: -------------------------------------------------------------------------------- 1 | swift code class Person { 2 | swift code var age = 25 3 | swift blank 4 | swift code init() { 5 | swift code print(“A new instance of this class Person is created.”) 6 | swift code } 7 | swift blank 8 | swift blank 9 | swift comment /* Block 10 | swift comment comment */ 11 | swift code func sayHelloWorld() { // Code appended with line comment 12 | swift code print("Hello World") /* Code appended with block comment */ 13 | swift code } 14 | swift code } 15 | swift blank 16 | swift code let personObj = Person() 17 | swift code print(“This person age is \(personObj.age)”) 18 | -------------------------------------------------------------------------------- /test/expected_dir/foo.tex: -------------------------------------------------------------------------------- 1 | tex code \begin{document} 2 | tex code \texbf Hello world 3 | tex blank 4 | tex blank 5 | tex comment % 6 | tex comment % sample comment 7 | tex blank 8 | tex code \end{document} 9 | -------------------------------------------------------------------------------- /test/expected_dir/forth.4th: -------------------------------------------------------------------------------- 1 | forth comment \ Sample Forth code 2 | forth blank 3 | forth comment ( This is a comment 4 | forth comment spanning multiple lines ) 5 | forth blank 6 | forth code : somedefinition ; 7 | forth blank 8 | -------------------------------------------------------------------------------- /test/expected_dir/forth.fs: -------------------------------------------------------------------------------- 1 | forth comment \ Sample Forth code 2 | forth blank 3 | forth comment ( This is a comment 4 | forth comment spanning multiple lines ) 5 | forth blank 6 | forth code : somedefinition ; 7 | forth blank 8 | -------------------------------------------------------------------------------- /test/expected_dir/fortranfixed.f: -------------------------------------------------------------------------------- 1 | fortranfixed comment C Just a comment, whee. 2 | fortranfixed code program foo 3 | fortranfixed blank 4 | fortranfixed comment C Many languages seem to count split lines as multiple lines, 5 | fortranfixed comment C so we should, too. 6 | fortranfixed code write (*,*) 1 7 | fortranfixed code + + 1 8 | fortranfixed blank 9 | fortranfixed comment C And I've never seen Fortran code that wraps strings; I'm 10 | fortranfixed comment C not even sure fixed form allows it. 11 | fortranfixed code write (*,*) 'So we don''t bother testing odd string foo.' 12 | fortranfixed code end 13 | -------------------------------------------------------------------------------- /test/expected_dir/groovy1.groovy: -------------------------------------------------------------------------------- 1 | groovy comment //hello.groovy 2 | groovy code println "hello, world" 3 | groovy code for (arg in this.args ) { 4 | groovy code println "Argument:" + arg; 5 | groovy code } 6 | groovy comment // this is a comment 7 | groovy comment /* a block comment, commenting out an alternative to above: 8 | groovy comment this.args.each{ arg -> println "hello, ${arg}"} 9 | groovy comment */ 10 | -------------------------------------------------------------------------------- /test/expected_dir/haml.haml: -------------------------------------------------------------------------------- 1 | haml code %p 2 | ruby code %p= "stuff" 3 | haml comment / oneliner! 4 | haml code %p 5 | haml comment / 6 | haml comment %p this won't render 7 | haml comment %p it is a comment! 8 | ruby code %p= "stuff" 9 | haml code %p 10 | ruby code - code 11 | ruby code %p= "stuff" 12 | haml code %p 13 | haml blank 14 | haml code \- not script! 15 | haml comment -# silent comment 16 | haml code %p 17 | haml comment -# 18 | haml comment silent 19 | haml comment comment 20 | haml code %br/ 21 | -------------------------------------------------------------------------------- /test/expected_dir/haskell2.hs: -------------------------------------------------------------------------------- 1 | haskell comment {-| 2 | haskell blank 3 | haskell comment -} 4 | haskell blank 5 | -------------------------------------------------------------------------------- /test/expected_dir/haskell3.hs: -------------------------------------------------------------------------------- 1 | haskell comment {- 2 | haskell comment {- 3 lines of comments total! -} 3 | haskell blank 4 | haskell comment -} 5 | haskell blank 6 | -------------------------------------------------------------------------------- /test/expected_dir/java2.java: -------------------------------------------------------------------------------- 1 | java comment /** 2 | java comment */ 3 | java blank 4 | -------------------------------------------------------------------------------- /test/expected_dir/js2.js: -------------------------------------------------------------------------------- 1 | javascript code 14 | -------------------------------------------------------------------------------- /test/expected_dir/js3.js: -------------------------------------------------------------------------------- 1 | javascript code return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'"; 2 | javascript comment // comment 3 | -------------------------------------------------------------------------------- /test/expected_dir/jsp1.jsp: -------------------------------------------------------------------------------- 1 | html code 2 | html code 3 | html code JSP page 4 | html code 5 | html code 6 | java code <%@ page language="java" %> 7 | java code <% out.println("Hello World"); %> 8 | java comment <% // comment 9 | java comment /* 10 | java comment * more comment 11 | java comment */ 12 | html code %> 13 | html code 14 | html code 15 | -------------------------------------------------------------------------------- /test/expected_dir/limbo.m: -------------------------------------------------------------------------------- 1 | limbo code Htmlent: module { 2 | limbo code PATH: con "/dis/lib/htmlent.dis"; 3 | limbo code entities: array of (string, int); 4 | limbo blank 5 | limbo code init: fn(); 6 | limbo code lookup: fn(name: string): int; 7 | limbo code conv: fn(s: string): string; 8 | limbo code }; 9 | -------------------------------------------------------------------------------- /test/expected_dir/logtalk.lgt: -------------------------------------------------------------------------------- 1 | logtalk comment /* test file for Logtalk parsing */ 2 | logtalk blank 3 | logtalk comment % this is a Logtalk source file 4 | logtalk blank 5 | logtalk code :- object(hello_world). 6 | logtalk blank 7 | logtalk comment % the initialization/1 directive argument is automatically executed 8 | logtalk comment % when the object is loaded into memory: 9 | logtalk code :- initialization((nl, write('********** Hello World! **********'), nl)). 10 | logtalk blank 11 | logtalk code :- end_object. 12 | -------------------------------------------------------------------------------- /test/expected_dir/macro_crystal.cr: -------------------------------------------------------------------------------- 1 | crystal comment # This is a comment. 2 | crystal blank 3 | crystal code macro create_foo(name, &block) 4 | crystal code {% name.id = "bar" %} 5 | crystal code {{block}} 6 | -------------------------------------------------------------------------------- /test/expected_dir/ocaml.ml: -------------------------------------------------------------------------------- 1 | ocaml comment (** documentation *) 2 | ocaml code print_string "Hello world!\n";; 3 | ocaml comment (**/**) 4 | ocaml comment (* extra comment *) 5 | ocaml blank 6 | ocaml comment (* multiline 7 | ocaml comment comment*) 8 | ocaml blank 9 | ocaml comment (* recursion in (* a 10 | ocaml comment comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/expected_dir/pascal1.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/expected_dir/pascal1.pas -------------------------------------------------------------------------------- /test/expected_dir/pascal2.pp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/expected_dir/pascal2.pp -------------------------------------------------------------------------------- /test/expected_dir/perl_pod_to_eof.pl: -------------------------------------------------------------------------------- 1 | perl comment =head NAME 2 | -------------------------------------------------------------------------------- /test/expected_dir/pike1.pike: -------------------------------------------------------------------------------- 1 | pike code #!/bin/env pike 2 | pike comment /* Say hello. */ 3 | pike code int main(int argc, array(string) argv) 4 | pike code { 5 | pike code Stdio.stdout.write("Hello, world.\n"); 6 | pike code } 7 | -------------------------------------------------------------------------------- /test/expected_dir/postscipt.ps: -------------------------------------------------------------------------------- 1 | postscript comment %!PS 2 | postscript comment % Postscript Directive at the top. Just like its supposed to be. 3 | postscript code /Courier 4 | postscript blank 5 | postscript code 15 selectfont 6 | postscript code 72 500 moveto 7 | postscript blank 8 | postscript code (Hello world) show 9 | postscript code showpage 10 | -------------------------------------------------------------------------------- /test/expected_dir/prolog.pl: -------------------------------------------------------------------------------- 1 | prolog comment /* test file for Prolog parsing */ 2 | prolog blank 3 | prolog comment % this is a Prolog source file 4 | prolog blank 5 | prolog comment % select(Element, List, Remaining) 6 | prolog blank 7 | prolog code select(H, [H| T], T). 8 | prolog code select(H, [X| R], [X| T]) :- 9 | prolog code select(H, R, T). 10 | -------------------------------------------------------------------------------- /test/expected_dir/puppet_empty_class_1.pp: -------------------------------------------------------------------------------- 1 | puppet code class tester ( 2 | puppet code ) { 3 | puppet code "Some Content" 4 | puppet code } 5 | -------------------------------------------------------------------------------- /test/expected_dir/puppet_empty_class_2.pp: -------------------------------------------------------------------------------- 1 | puppet code class test::files { 2 | puppet code "Some Content" 3 | puppet code } 4 | -------------------------------------------------------------------------------- /test/expected_dir/puppet_with_include_only.pp: -------------------------------------------------------------------------------- 1 | puppet code include ::postfix 2 | -------------------------------------------------------------------------------- /test/expected_dir/py1.py: -------------------------------------------------------------------------------- 1 | python comment # some python code 2 | python comment # lorem 3 | python comment # ipsum 4 | python comment # foo 5 | python blank 6 | python code class Foo: 7 | python comment """ 8 | python comment This is a foo class 9 | python comment It doesn't do anything 10 | python comment Therefore this doc comment is pointless 11 | python comment """ 12 | python blank 13 | python code def __init__(self, bar): 14 | python comment """short doc comment""" 15 | python code print(bar) 16 | python blank 17 | python code def string(self): 18 | python code print('This is a string') 19 | -------------------------------------------------------------------------------- /test/expected_dir/rust.rs: -------------------------------------------------------------------------------- 1 | rust comment /* 2 | rust comment * This is the example given by www.rust-lang.org 3 | rust comment */ 4 | rust comment // Line comments work too 5 | rust code fn main() { 6 | rust code let nums = [1, 2]; 7 | rust code let noms = ["Tim", "Eston", "Aaron", "Ben"]; 8 | rust blank 9 | rust code let mut odds = nums.iter().map(|&x| x * 2 - 1); 10 | rust blank 11 | rust code for num in odds { 12 | rust code do spawn { 13 | rust code println!("{:s} says hello from a lightweight thread!", noms[num]); 14 | rust code } 15 | rust code } 16 | rust code } 17 | -------------------------------------------------------------------------------- /test/expected_dir/sample.i3: -------------------------------------------------------------------------------- 1 | modula3 code (* Modula-3 *) INTERFACE M3Sample; (* file extension ".i3" *) 2 | modula3 blank 3 | modula3 comment (* This is a comment *) 4 | modula3 blank 5 | modula3 comment (* This is a comment ... 6 | modula3 comment ... spanning more than one line *) 7 | modula3 blank 8 | modula3 code CONST 9 | modula3 code sqString = 'this is a string within "a string" ...\n'; 10 | modula3 code dqString = "this is a string within 'a string' ...\n"; 11 | modula3 blank 12 | modula3 code END M3Sample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sample.m3: -------------------------------------------------------------------------------- 1 | modula3 code (* Modula-3 *) MODULE M3Sample; (* file extension ".m3" *) 2 | modula3 blank 3 | modula3 comment (* This is a comment *) 4 | modula3 blank 5 | modula3 comment (* This is a comment ... 6 | modula3 comment ... spanning more than one line *) 7 | modula3 blank 8 | modula3 code CONST 9 | modula3 code sqString = 'this is a string within "a string" ...\n'; 10 | modula3 code dqString = "this is a string within 'a string' ...\n"; 11 | modula3 blank 12 | modula3 code END M3Sample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sample.mod: -------------------------------------------------------------------------------- 1 | modula2 code MODULE Sample; (* in Modula-2 *) 2 | modula2 blank 3 | modula2 comment (* This is a comment *) 4 | modula2 blank 5 | modula2 comment (* This is a comment ... 6 | modula2 comment ... spanning more than one line *) 7 | modula2 blank 8 | modula2 code CONST 9 | modula2 code sqString = 'this is a string within "a string" ...'; 10 | modula2 code dqString = "this is a string within 'a string' ..."; 11 | modula2 blank 12 | modula2 code END Sample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sample.ob2: -------------------------------------------------------------------------------- 1 | oberon code (* Oberon-2 *) MODULE OberonSample; (* file extension ".ob2" *) 2 | oberon blank 3 | oberon comment (* This is a comment *) 4 | oberon blank 5 | oberon comment (* This is a comment ... 6 | oberon comment ... spanning more than one line *) 7 | oberon blank 8 | oberon code CONST 9 | oberon code sqString* = 'this is a string within "a string" ...'; 10 | oberon code dqString* = "this is a string within 'a string' ..."; 11 | oberon blank 12 | oberon code END OberonSample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sample.obn: -------------------------------------------------------------------------------- 1 | oberon code (* Oberon *) MODULE OberonSample; (* file extension ".obn" *) 2 | oberon blank 3 | oberon comment (* This is a comment *) 4 | oberon blank 5 | oberon comment (* This is a comment ... 6 | oberon comment ... spanning more than one line *) 7 | oberon blank 8 | oberon code CONST 9 | oberon code sqString* = 'this is a string within "a string" ...'; 10 | oberon code dqString* = "this is a string within 'a string' ..."; 11 | oberon blank 12 | oberon code END OberonSample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sampleDef.def: -------------------------------------------------------------------------------- 1 | modula2 code DEFINITION MODULE Sample; (* in Modula-2 *) 2 | modula2 blank 3 | modula2 comment (* This is a comment *) 4 | modula2 blank 5 | modula2 comment (* This is a comment ... 6 | modula2 comment ... spanning more than one line *) 7 | modula2 blank 8 | modula2 code CONST 9 | modula2 code sqString = 'this is a string within "a string" ...'; 10 | modula2 code dqString = "this is a string within 'a string' ..."; 11 | modula2 blank 12 | modula2 code END Sample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sampleImp.mod: -------------------------------------------------------------------------------- 1 | modula2 code IMPLEMENTATION MODULE Sample; (* in Modula-2 *) 2 | modula2 blank 3 | modula2 comment (* This is a comment *) 4 | modula2 blank 5 | modula2 comment (* This is a comment ... 6 | modula2 comment ... spanning more than one line *) 7 | modula2 blank 8 | modula2 code CONST 9 | modula2 code sqString = 'this is a string within "a string" ...'; 10 | modula2 code dqString = "this is a string within 'a string' ..."; 11 | modula2 blank 12 | modula2 code END Sample. 13 | -------------------------------------------------------------------------------- /test/expected_dir/sh1.sh: -------------------------------------------------------------------------------- 1 | shell comment #!/bin/sh 2 | shell blank 3 | shell code ls -la 4 | shell comment # comment 5 | shell code echo hello #comment 6 | -------------------------------------------------------------------------------- /test/expected_dir/sh2.sh: -------------------------------------------------------------------------------- 1 | shell code var="\ 2 | shell code Some string" 3 | shell blank 4 | shell comment # Now a comment 5 | shell code var="some new string" 6 | -------------------------------------------------------------------------------- /test/expected_dir/standard_crystal.cr: -------------------------------------------------------------------------------- 1 | crystal comment #comment 2 | crystal comment # comment with "string" 3 | crystal blank 4 | crystal code class Rest 5 | crystal code def one 6 | crystal code two do |c| 7 | crystal code puts c 8 | crystal code end 9 | crystal code end 10 | crystal blank 11 | crystal code def two(&block : Int32 -> _) 12 | crystal code three { |x| yield x } # yield is faster than passing blocks. 13 | crystal code end 14 | crystal blank 15 | crystal code def three 16 | crystal code yield 3 17 | crystal code end 18 | crystal code end 19 | crystal blank 20 | crystal code Rest.new.one 21 | -------------------------------------------------------------------------------- /test/expected_dir/ts1.ts: -------------------------------------------------------------------------------- 1 | typescript comment /* 2 | typescript comment * This is a TypeScript File 3 | typescript comment */ 4 | typescript blank 5 | typescript comment // And a regular comment 6 | typescript blank 7 | typescript code export class SomeClass { 8 | typescript code public text: string; 9 | typescript blank 10 | typescript code public sayHello(name: string): string { 11 | typescript code return `Hello, ${name}`; 12 | typescript code } 13 | typescript code } 14 | typescript blank -------------------------------------------------------------------------------- /test/expected_dir/vbs1.vbs: -------------------------------------------------------------------------------- 1 | visualbasic blank 2 | visualbasic code require File.dirname(__FILE__) + '/../test_helper' 3 | visualbasic code include Lingo 4 | visualbasic blank 5 | visualbasic code class ShellTest < LingoTest 6 | visualbasic code def test_comment 7 | visualbasic code p = Languages::Shell.parse(" #comment") 8 | visualbasic code assert_equal({ 'shell' => { :comment => [" #comment"] } }, p.output_buffers) 9 | visualbasic code end 10 | visualbasic blank 11 | visualbasic code def test_comprehensive 12 | visualbasic code verify_parse("sh1.sh") 13 | visualbasic code end 14 | visualbasic code end 15 | -------------------------------------------------------------------------------- /test/expected_dir/xml1.xml: -------------------------------------------------------------------------------- 1 | xml code 2 | xml comment 6 | xml code 8 | xml code ]]> 9 | xml blank 10 | xml code 11 | xml comment 12 | xml code 13 | xml code 14 | xml blank 15 | -------------------------------------------------------------------------------- /test/expected_licenses/academic_t1: -------------------------------------------------------------------------------- 1 | academic 2 | -------------------------------------------------------------------------------- /test/expected_licenses/adaptive_t1: -------------------------------------------------------------------------------- 1 | adaptive 2 | -------------------------------------------------------------------------------- /test/expected_licenses/affero_1: -------------------------------------------------------------------------------- 1 | affero 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_2_t1: -------------------------------------------------------------------------------- 1 | apache_2 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_2_t2: -------------------------------------------------------------------------------- 1 | apache_2 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_2_t3: -------------------------------------------------------------------------------- 1 | apache_2 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_ish_t1: -------------------------------------------------------------------------------- 1 | apache_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_ish_t2: -------------------------------------------------------------------------------- 1 | apache_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_t1: -------------------------------------------------------------------------------- 1 | apache 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_t2: -------------------------------------------------------------------------------- 1 | apache 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apache_t3: -------------------------------------------------------------------------------- 1 | apache 2 | -------------------------------------------------------------------------------- /test/expected_licenses/apple_open_source_t1: -------------------------------------------------------------------------------- 1 | apple_open_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/artistic_t1: -------------------------------------------------------------------------------- 1 | artistic 2 | -------------------------------------------------------------------------------- /test/expected_licenses/attribution_assurance_t1: -------------------------------------------------------------------------------- 1 | attribution_assurance 2 | -------------------------------------------------------------------------------- /test/expected_licenses/avr-drv: -------------------------------------------------------------------------------- 1 | bsd_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/boost_t1: -------------------------------------------------------------------------------- 1 | boost 2 | -------------------------------------------------------------------------------- /test/expected_licenses/boost_t2: -------------------------------------------------------------------------------- 1 | boost 2 | -------------------------------------------------------------------------------- /test/expected_licenses/bsd_2clause_ish_t1: -------------------------------------------------------------------------------- 1 | bsd_2clause_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/bsd_ish_t1: -------------------------------------------------------------------------------- 1 | bsd_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/bsd_ish_t2: -------------------------------------------------------------------------------- 1 | bsd_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/bsd_ish_t3: -------------------------------------------------------------------------------- 1 | bsd_ish 2 | -------------------------------------------------------------------------------- /test/expected_licenses/bsd_t1: -------------------------------------------------------------------------------- 1 | bsd 2 | -------------------------------------------------------------------------------- /test/expected_licenses/cecill: -------------------------------------------------------------------------------- 1 | cecill 2 | -------------------------------------------------------------------------------- /test/expected_licenses/cecill-b: -------------------------------------------------------------------------------- 1 | cecill_b 2 | -------------------------------------------------------------------------------- /test/expected_licenses/cecill-c: -------------------------------------------------------------------------------- 1 | cecill_c 2 | -------------------------------------------------------------------------------- /test/expected_licenses/common_development_and_distribution_t1: -------------------------------------------------------------------------------- 1 | common_development_and_distribution 2 | -------------------------------------------------------------------------------- /test/expected_licenses/common_public_t1: -------------------------------------------------------------------------------- 1 | common_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/computer_associates_trusted_t1: -------------------------------------------------------------------------------- 1 | computer_associates_trusted 2 | -------------------------------------------------------------------------------- /test/expected_licenses/cua_office_t1: -------------------------------------------------------------------------------- 1 | cua_office 2 | -------------------------------------------------------------------------------- /test/expected_licenses/eclipse_t1: -------------------------------------------------------------------------------- 1 | eclipse 2 | -------------------------------------------------------------------------------- /test/expected_licenses/educational_t1: -------------------------------------------------------------------------------- 1 | educational 2 | -------------------------------------------------------------------------------- /test/expected_licenses/eiffel_2_t1: -------------------------------------------------------------------------------- 1 | eiffel_2 2 | -------------------------------------------------------------------------------- /test/expected_licenses/eiffel_t1: -------------------------------------------------------------------------------- 1 | eiffel 2 | -------------------------------------------------------------------------------- /test/expected_licenses/entessa_t1: -------------------------------------------------------------------------------- 1 | entessa 2 | -------------------------------------------------------------------------------- /test/expected_licenses/eu_datagrid_t1: -------------------------------------------------------------------------------- 1 | eu_datagrid 2 | -------------------------------------------------------------------------------- /test/expected_licenses/fair_t1: -------------------------------------------------------------------------------- 1 | fair 2 | -------------------------------------------------------------------------------- /test/expected_licenses/frameworx_t1: -------------------------------------------------------------------------------- 1 | frameworx 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl3_or_later_t1: -------------------------------------------------------------------------------- 1 | gpl3_or_later 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl3_or_later_t2: -------------------------------------------------------------------------------- 1 | gpl3_or_later 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl3_or_later_t3: -------------------------------------------------------------------------------- 1 | gpl3_or_later 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl3_t1: -------------------------------------------------------------------------------- 1 | gpl3 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl3_t2: -------------------------------------------------------------------------------- 1 | bsd 2 | gpl3 3 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl_line_wrap_1: -------------------------------------------------------------------------------- 1 | gpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl_t1: -------------------------------------------------------------------------------- 1 | gpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl_t2: -------------------------------------------------------------------------------- 1 | gpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl_t3: -------------------------------------------------------------------------------- 1 | gpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/gpl_t4: -------------------------------------------------------------------------------- 1 | gpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/historical_t1: -------------------------------------------------------------------------------- 1 | historical 2 | -------------------------------------------------------------------------------- /test/expected_licenses/i9_license_t1: -------------------------------------------------------------------------------- 1 | i9_license 2 | mit 3 | -------------------------------------------------------------------------------- /test/expected_licenses/i9_license_t2: -------------------------------------------------------------------------------- 1 | i9_license 2 | -------------------------------------------------------------------------------- /test/expected_licenses/ibm_public_t1: -------------------------------------------------------------------------------- 1 | ibm_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/intel_open_source_t1: -------------------------------------------------------------------------------- 1 | intel_open_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/jabber_open_source_t1: -------------------------------------------------------------------------------- 1 | jabber_open_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl3_t1: -------------------------------------------------------------------------------- 1 | lgpl3 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl3_t2: -------------------------------------------------------------------------------- 1 | lgpl3 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl_t1: -------------------------------------------------------------------------------- 1 | lgpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl_t2: -------------------------------------------------------------------------------- 1 | lgpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl_t3: -------------------------------------------------------------------------------- 1 | lgpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl_t4: -------------------------------------------------------------------------------- 1 | lgpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lgpl_t5: -------------------------------------------------------------------------------- 1 | lgpl 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lucent_plan9_t1: -------------------------------------------------------------------------------- 1 | lucent_plan9 2 | -------------------------------------------------------------------------------- /test/expected_licenses/lucent_public_t1: -------------------------------------------------------------------------------- 1 | lucent_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/mit_t1: -------------------------------------------------------------------------------- 1 | mit 2 | -------------------------------------------------------------------------------- /test/expected_licenses/mit_t2: -------------------------------------------------------------------------------- 1 | mit 2 | -------------------------------------------------------------------------------- /test/expected_licenses/mitre_t1: -------------------------------------------------------------------------------- 1 | mitre 2 | -------------------------------------------------------------------------------- /test/expected_licenses/motosoto_t1: -------------------------------------------------------------------------------- 1 | motosoto 2 | -------------------------------------------------------------------------------- /test/expected_licenses/mozilla_public_1_1_t1: -------------------------------------------------------------------------------- 1 | mozilla_public_1_1 2 | -------------------------------------------------------------------------------- /test/expected_licenses/mozilla_public_1_t1: -------------------------------------------------------------------------------- 1 | mozilla_public_1 2 | -------------------------------------------------------------------------------- /test/expected_licenses/nasa_open_t1: -------------------------------------------------------------------------------- 1 | nasa_open 2 | -------------------------------------------------------------------------------- /test/expected_licenses/naumen_t1: -------------------------------------------------------------------------------- 1 | naumen 2 | -------------------------------------------------------------------------------- /test/expected_licenses/nethack_t1: -------------------------------------------------------------------------------- 1 | nethack 2 | -------------------------------------------------------------------------------- /test/expected_licenses/nokia_open_source_t1: -------------------------------------------------------------------------------- 1 | nokia_open_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/oclc_research_t1: -------------------------------------------------------------------------------- 1 | oclc_research 2 | -------------------------------------------------------------------------------- /test/expected_licenses/open_group_test_t1: -------------------------------------------------------------------------------- 1 | open_group_test 2 | -------------------------------------------------------------------------------- /test/expected_licenses/open_software_t1: -------------------------------------------------------------------------------- 1 | open_software 2 | -------------------------------------------------------------------------------- /test/expected_licenses/php_license_t1: -------------------------------------------------------------------------------- 1 | php_license 2 | -------------------------------------------------------------------------------- /test/expected_licenses/python_license_t1: -------------------------------------------------------------------------------- 1 | python_license 2 | -------------------------------------------------------------------------------- /test/expected_licenses/python_software_foundation_t1: -------------------------------------------------------------------------------- 1 | python_software_foundation 2 | -------------------------------------------------------------------------------- /test/expected_licenses/qt_public_t1: -------------------------------------------------------------------------------- 1 | qt_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/realnetworks_public_source_t1: -------------------------------------------------------------------------------- 1 | realnetworks_public_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/reciprocal_public_t1: -------------------------------------------------------------------------------- 1 | reciprocal_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/ricoh_source_t1: -------------------------------------------------------------------------------- 1 | ricoh_source 2 | -------------------------------------------------------------------------------- /test/expected_licenses/sleepycat_t1: -------------------------------------------------------------------------------- 1 | sleepycat 2 | -------------------------------------------------------------------------------- /test/expected_licenses/sugarcrm_1_1_3_t1: -------------------------------------------------------------------------------- 1 | sugarcrm_1_1_3 2 | -------------------------------------------------------------------------------- /test/expected_licenses/sun_industry_standards_t1: -------------------------------------------------------------------------------- 1 | sun_industry_standards 2 | -------------------------------------------------------------------------------- /test/expected_licenses/sun_public_t1: -------------------------------------------------------------------------------- 1 | sun_public 2 | -------------------------------------------------------------------------------- /test/expected_licenses/sybase_open_watcom_t1: -------------------------------------------------------------------------------- 1 | sybase_open_watcom 2 | -------------------------------------------------------------------------------- /test/expected_licenses/u_of_i_ncsa_t1: -------------------------------------------------------------------------------- 1 | u_of_i_ncsa 2 | -------------------------------------------------------------------------------- /test/expected_licenses/vovida_software_t1: -------------------------------------------------------------------------------- 1 | vovida_software 2 | -------------------------------------------------------------------------------- /test/expected_licenses/w3c_t1: -------------------------------------------------------------------------------- 1 | w3c 2 | -------------------------------------------------------------------------------- /test/expected_licenses/wtfpl: -------------------------------------------------------------------------------- 1 | wtfpl_2 2 | -------------------------------------------------------------------------------- /test/expected_licenses/wx_windows_t1: -------------------------------------------------------------------------------- 1 | wx_windows 2 | -------------------------------------------------------------------------------- /test/expected_licenses/x_net_t1: -------------------------------------------------------------------------------- 1 | x_net 2 | -------------------------------------------------------------------------------- /test/expected_licenses/zlib_libpng_t1: -------------------------------------------------------------------------------- 1 | zlib_libpng 2 | -------------------------------------------------------------------------------- /test/expected_licenses/zope_t1: -------------------------------------------------------------------------------- 1 | zope 2 | -------------------------------------------------------------------------------- /test/gestalt_files/asp_net/test.aspx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/gestalt_files/asp_net/test.aspx -------------------------------------------------------------------------------- /test/gestalt_files/cakephp/foo.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/gestalt_files/drupal/bar.php: -------------------------------------------------------------------------------- 1 | 5 | -------------------------------------------------------------------------------- /test/gestalt_files/eclipse/.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | sample 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | 15 | org.eclipse.jdt.core.javanature 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/gestalt_files/eclipse_platform/main.java: -------------------------------------------------------------------------------- 1 | /******************************************************************************* 2 | * Gibberish Code Copyrighted Just For The Hell Of It. 3 | ******************************************************************************/ 4 | package net.ohloh.www; 5 | 6 | import java.text.SimpleDateFormat; 7 | import java.util.Map; 8 | import org.eclipse.core.lotsa_stuff; 9 | 10 | public class AptPlugin extends Plugin { 11 | public static final String PLUGIN_ID = "org.eclipse.jdt.apt.core"; //$NON-NLS-1$ 12 | } 13 | -------------------------------------------------------------------------------- /test/gestalt_files/gtk/simple.c: -------------------------------------------------------------------------------- 1 | #include 2 | int main(int argc, char *argv[]) 3 | { 4 | GtkWidget *gtkWindow; 5 | 6 | gtk_init(&argc, &argv); 7 | 8 | window = gtk_window_new(GTK_WINDOW_TOPLEVEL); 9 | gtk_widget_show(window); 10 | 11 | gtk_main(); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /test/gestalt_files/jquery/jquery-1.2.6.min.js: -------------------------------------------------------------------------------- 1 | i = 1; 2 | -------------------------------------------------------------------------------- /test/gestalt_files/kde/foo.c: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /test/gestalt_files/mac/foo.c: -------------------------------------------------------------------------------- 1 | AppleEvent tAppleEvent; 2 | -------------------------------------------------------------------------------- /test/gestalt_files/moodle/moodle.php: -------------------------------------------------------------------------------- 1 | 9 | -------------------------------------------------------------------------------- /test/gestalt_files/msdos/bar.c: -------------------------------------------------------------------------------- 1 | #include "MSDOS" 2 | -------------------------------------------------------------------------------- /test/gestalt_files/msdos/foo.c: -------------------------------------------------------------------------------- 1 | #include "__MSDOS__" 2 | -------------------------------------------------------------------------------- /test/gestalt_files/netbeans/nbplatform/foo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/gestalt_files/netbeans/nbplatform/foo -------------------------------------------------------------------------------- /test/gestalt_files/netbeans/nbplatform/project.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | org.netbeans.modules.apisupport.project.suite 4 | 5 | 6 | sample 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/gestalt_files/pear/Sample.class.php: -------------------------------------------------------------------------------- 1 | 11 | -------------------------------------------------------------------------------- /test/gestalt_files/pear/package.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | -------------------------------------------------------------------------------- /test/gestalt_files/php/main.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/gestalt_files/plist/Info.plist.in: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/gestalt_files/posix/configure.in: -------------------------------------------------------------------------------- 1 | a line of code 2 | -------------------------------------------------------------------------------- /test/gestalt_files/posix/foo.rb: -------------------------------------------------------------------------------- 1 | # this is ruby code 2 | class Foo 3 | attr_reader :bar 4 | end 5 | -------------------------------------------------------------------------------- /test/gestalt_files/python/hello_world.py: -------------------------------------------------------------------------------- 1 | print "Hello, World!" 2 | -------------------------------------------------------------------------------- /test/gestalt_files/rails/foo.rb: -------------------------------------------------------------------------------- 1 | # we're impersonating a rails app 2 | RAILS_ROOT = '/' 3 | some_rails_code = "true" 4 | -------------------------------------------------------------------------------- /test/gestalt_files/ruby_just_enough/foo.rb: -------------------------------------------------------------------------------- 1 | a = 1 2 | a = 2 3 | a = 3 4 | a = 4 5 | a = 5 6 | a = 6 7 | a = 7 8 | a = 8 9 | a = 9 10 | a = 10 11 | a = 11 12 | a = 12 13 | a = 13 14 | a = 14 15 | a = 15 16 | -------------------------------------------------------------------------------- /test/gestalt_files/ruby_not_enough/foo.rb: -------------------------------------------------------------------------------- 1 | a = 1 2 | a = 2 3 | a = 3 4 | a = 4 5 | a = 5 6 | a = 6 7 | a = 7 8 | a = 8 9 | a = 9 10 | a = 10 11 | a = 11 12 | a = 12 13 | a = 13 14 | a = 14 15 | a = 15 16 | -------------------------------------------------------------------------------- /test/gestalt_files/spring_framework/main.java: -------------------------------------------------------------------------------- 1 | class JavaClass 2 | { 3 | int i = 1; 4 | int i = 2; 5 | int i = 3; 6 | } 7 | 8 | -------------------------------------------------------------------------------- /test/gestalt_files/spring_framework/spring.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/gestalt_files/spring_framework/spring.jar -------------------------------------------------------------------------------- /test/gestalt_files/symfony/config.php: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /test/gestalt_files/weblogic_maven/foo.java: -------------------------------------------------------------------------------- 1 | /* Just a comment */ 2 | { 3 | return a_few_lines_of_java_to_trigger_the_java_platform(); 4 | } 5 | -------------------------------------------------------------------------------- /test/gestalt_files/weblogic_maven/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | org.codehaus.mojo 6 | weblogic-maven-plugin 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /test/gestalt_files/websphere/foo.java: -------------------------------------------------------------------------------- 1 | /* Just a comment */ 2 | { 3 | return a_few_lines_of_java_to_trigger_the_java_platform(); 4 | } 5 | -------------------------------------------------------------------------------- /test/gestalt_files/websphere/ibm-webservices-bnd.xmi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/gestalt_files/websphere/ibm-webservices-bnd.xmi -------------------------------------------------------------------------------- /test/gestalt_files/win32_enough/bar.c: -------------------------------------------------------------------------------- 1 | // a commented WndProc 2 | WndProc *wndproc; 3 | 4 | -------------------------------------------------------------------------------- /test/gestalt_files/win32_enough/foo.c: -------------------------------------------------------------------------------- 1 | // another commented WndProc 2 | WndProc *wndproc; 3 | 4 | -------------------------------------------------------------------------------- /test/gestalt_files/win32_not_enough/foo.c: -------------------------------------------------------------------------------- 1 | // a commented WndProc 2 | WndProc *wndproc; 3 | 4 | -------------------------------------------------------------------------------- /test/gestalt_files/wpf/wpf.xaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /test/gestalt_files/wx_widgets/main.h: -------------------------------------------------------------------------------- 1 | /* some random includes (and one that's not so random) */ 2 | #include 3 | #include "wx/window.h" 4 | -------------------------------------------------------------------------------- /test/gestalt_files/xwindows/foo.c: -------------------------------------------------------------------------------- 1 | #include 2 | -------------------------------------------------------------------------------- /test/src_dir/Makefile: -------------------------------------------------------------------------------- 1 | # This is a makefile. 2 | 3 | giant_space_monkey : giant_space_monkey.c 4 | $(CC) $(CFLAGS) -o $@ $? 5 | 6 | -------------------------------------------------------------------------------- /test/src_dir/Makefile.am: -------------------------------------------------------------------------------- 1 | # This is an automake file 2 | EXTRA_DIST = giant-space-monkey.txt 3 | 4 | -------------------------------------------------------------------------------- /test/src_dir/abstract_crystal.cr: -------------------------------------------------------------------------------- 1 | abstract class Animal 2 | abstract def talk 3 | end 4 | end 5 | -------------------------------------------------------------------------------- /test/src_dir/ada1.ada: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; use Ada.Text_IO; 2 | 3 | procedure Get_Name is 4 | 5 | Name : String (1..80); 6 | Length : Integer; 7 | 8 | begin 9 | -- no variables needed here :) 10 | 11 | Put ("Enter your first name> "); 12 | Get_Line (Name, Length); 13 | New_Line; 14 | Put ("Hello "); 15 | Put (Name (1..Length)); 16 | Put (", we hope that you enjoy learning Ada!"); 17 | 18 | end Get_Name; 19 | -------------------------------------------------------------------------------- /test/src_dir/ada1.adb: -------------------------------------------------------------------------------- 1 | with Ada.Text_IO; use Ada.Text_IO; 2 | 3 | procedure Get_Name is 4 | 5 | Name : String (1..80); 6 | Length : Integer; 7 | 8 | begin 9 | -- no variables needed here :) 10 | 11 | Put ("Enter your first name> "); 12 | Get_Line (Name, Length); 13 | New_Line; 14 | Put ("Hello "); 15 | Put (Name (1..Length)); 16 | Put (", we hope that you enjoy learning Ada!"); 17 | 18 | end Get_Name; 19 | -------------------------------------------------------------------------------- /test/src_dir/ampl.mod: -------------------------------------------------------------------------------- 1 | /* This is a test file for AMPL 2 | * This is a multiline comment 3 | */ 4 | 5 | # An AMPL model 6 | var x >= 42; # variable definition. 7 | minimize o: x; 8 | -------------------------------------------------------------------------------- /test/src_dir/assembler2.S: -------------------------------------------------------------------------------- 1 | /******************************************************** 2 | Made up assembler file, in the style of linux kernel 3 | ********************************************************/ 4 | 5 | #define FOO 43 // they even use whack-whack comments 6 | 7 | mov eax, ecx 8 | -------------------------------------------------------------------------------- /test/src_dir/assembler6502.as8: -------------------------------------------------------------------------------- 1 | ; "Hello world" in 6502 assembly language for 8-bit Atari. 2 | ; Assembler: http://xasm.atari.org/ or http://mads.atari8.info/ 3 | 4 | org $3000 5 | main lda #$21 6 | sta $22f 7 | lda #
dl 10 | sta $231 11 | jmp * 12 | 13 | text dta d' HELLO, ',d'WORLD! '* 14 | 15 | ; Display List 16 | dl dta b($70),b($70),b($70),b($47),a(text),b($41),a(dl) 17 | 18 | org $2e0 19 | dta a(main) 20 | 21 | end 22 | -------------------------------------------------------------------------------- /test/src_dir/assembler6502.asx: -------------------------------------------------------------------------------- 1 | ; "Hello world" in 6502 assembly language for 8-bit Atari. 2 | ; Assembler: http://xasm.atari.org/ or http://mads.atari8.info/ 3 | 4 | org $3000 5 | main lda #$21 6 | sta $22f 7 | lda #
dl 10 | sta $231 11 | jmp * 12 | 13 | text dta d' HELLO, ',d'WORLD! '* 14 | 15 | ; Display List 16 | dl dta b($70),b($70),b($70),b($47),a(text),b($41),a(dl) 17 | 18 | org $2e0 19 | dta a(main) 20 | 21 | end 22 | -------------------------------------------------------------------------------- /test/src_dir/augeas.aug: -------------------------------------------------------------------------------- 1 | (** documentation *) 2 | module Augeas = 3 | autoload xfm 4 | (**/**) 5 | (* extra comment *) 6 | 7 | (* multiline 8 | comment*) 9 | let lns = Shellvars.lns 10 | 11 | (* recursion in (* a 12 | comment *) to complicate things *) 13 | let filter = incl "/foo/bar" 14 | let xfm = transform lns filter 15 | -------------------------------------------------------------------------------- /test/src_dir/bat1.bat: -------------------------------------------------------------------------------- 1 | REM comment 1 2 | rem comment 2 3 | rEm comment 3 4 | rEm.comment 4 5 | Rem=comment 5 6 | @Rem comment 6 7 | @reM=comment 7 8 | ::comment 8 9 | 10 | echo not a rem comment! 11 | 12 | -------------------------------------------------------------------------------- /test/src_dir/blitzmax.bmx: -------------------------------------------------------------------------------- 1 | ' 2 | ' Comments 3 | ' 4 | SuperStrict 5 | 6 | Rem 7 | bbdoc: docs 8 | End Rem 9 | Module bah.fish 10 | 11 | Import BRL.StandardIO 12 | 13 | Import "test.bmx" ' comment 14 | 15 | rem 16 | some comments 17 | 18 | 19 | Type blah 20 | still in comments 21 | End Type 22 | 23 | endrem 24 | 25 | Type TABC 26 | 27 | Method hello() 28 | End Method 29 | 30 | End Type 31 | 32 | print "hello rem fish ' " 33 | -------------------------------------------------------------------------------- /test/src_dir/brainfuck.bf: -------------------------------------------------------------------------------- 1 | Print "Hello World!!!!!" 2 | 3 | Line that does nothing: >< 4 | >++++++[>+++[<<++++>>-]<-]<. 5 | >+++++[<++++++>-]<-. 6 | +++++++. 7 | . 8 | +++. 9 | >>++++[<++++++>-]<++[<--->-]<-. 10 | >>++[<+++++>-]<+[<+++++>-]<. 11 | >++++[<++++++>-]<. 12 | +++. 13 | ------. 14 | >++[<---->-]<. 15 | >>++[<+++++>-]<+[<------>-]<-. 16 | . 17 | . 18 | . 19 | . 20 | -------------------------------------------------------------------------------- /test/src_dir/c2.h.in: -------------------------------------------------------------------------------- 1 | /* c2.h.in. */ 2 | 3 | #ifndef C2_H 4 | #define C2_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_INTTYPES_H 8 | 9 | /* Define to 1 if you have the `m' library (-lm). */ 10 | #undef HAVE_LIBM 11 | 12 | /* Define to 1 if you have the ANSI C header files. */ 13 | #undef STDC_HEADERS 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /test/src_dir/c_binding_crystal.cr: -------------------------------------------------------------------------------- 1 | @[Link(ldflags: "/home/alex/projects/fisbot/lib/ohcount/ohcount.so")] 2 | 3 | lib OhcountC 4 | fun ohcount_sourcefile_new(filepath : LibC::Char*) : Int32* 5 | end 6 | -------------------------------------------------------------------------------- /test/src_dir/c_str.c: -------------------------------------------------------------------------------- 1 | p = '"'; 2 | /* this should be a comment */ 3 | -------------------------------------------------------------------------------- /test/src_dir/chaiscript.chai: -------------------------------------------------------------------------------- 1 | /* 2 | Random Comments 3 | Foo Foo Foo 4 | */ 5 | var submenu=1; 6 | // comment 7 | // another comment 8 | submenu += 10 9 | var f = fun() { 5 }; 10 | def myFun(i) : i > 0 { 11 | return i + 10; 12 | } 13 | 14 | 15 | // some comment 16 | var delay_hide=500 17 | b=0 18 | -------------------------------------------------------------------------------- /test/src_dir/classic_basic.b: -------------------------------------------------------------------------------- 1 | 10 INPUT "What is your name: "; U$ 2 | 20 PRINT "Hello "; U$ 3 | 30 REM Test 4 | 40 INPUT "How many stars do you want: "; N 5 | 50 S$ = "" 6 | 60 FOR I = 1 TO N 7 | 70 S$ = S$ + "*" 8 | 80 NEXT I 9 | 90 PRINT S$ 10 | 100 REM 11 | 110 INPUT "Do you want more stars? "; A$ 12 | 120 IF LEN(A$) = 0 THEN GOTO 110 13 | 130 A$ = LEFT$(A$, 1) 14 | 140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 15 | 150 PRINT "Goodbye "; 16 | 160 FOR I = 1 TO 200 17 | 170 PRINT U$; " "; 18 | 180 NEXT I 19 | 190 PRINT 20 | -------------------------------------------------------------------------------- /test/src_dir/classic_basic.bas: -------------------------------------------------------------------------------- 1 | 10 INPUT "What is your name: "; U$ 2 | 20 PRINT "Hello "; U$ 3 | 30 REM Test 4 | 40 INPUT "How many stars do you want: "; N 5 | 50 S$ = "" 6 | 60 FOR I = 1 TO N 7 | 70 S$ = S$ + "*" 8 | 80 NEXT I 9 | 90 PRINT S$ 10 | 11 | 100 REM 12 | 110 INPUT "Do you want more stars? "; A$ 13 | 120 IF LEN(A$) = 0 THEN GOTO 110 14 | 130 A$ = LEFT$(A$, 1) 15 | 140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | 150 PRINT "Goodbye "; 17 | 160 FOR I = 1 TO 200 18 | 170 PRINT U$; " "; 19 | 180 NEXT I 20 | 190 PRINT 21 | -------------------------------------------------------------------------------- /test/src_dir/classic_basic1.classic_basic: -------------------------------------------------------------------------------- 1 | 10 INPUT "What is your name: "; U$ 2 | 20 PRINT "Hello "; U$ 3 | 30 REM 4 | 40 INPUT "How many stars do you want: "; N 5 | 50 S$ = "" 6 | 60 FOR I = 1 TO N 7 | 70 S$ = S$ + "*" 8 | 80 NEXT I 9 | 90 PRINT S$ 10 | 100 REM 11 | 110 INPUT "Do you want more stars? "; A$ 12 | 120 IF LEN(A$) = 0 THEN GOTO 110 13 | 130 A$ = LEFT$(A$, 1) 14 | 140 IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 15 | 150 PRINT "Goodbye "; 16 | 160 FOR I = 1 TO 200 17 | 170 PRINT U$; " "; 18 | 180 NEXT I 19 | 190 PRINT 20 | -------------------------------------------------------------------------------- /test/src_dir/clearsilver_template1.cs: -------------------------------------------------------------------------------- 1 | 2 | 3 |

4 |

5 | 6 | 7 | -------------------------------------------------------------------------------- /test/src_dir/click_me.xaml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /test/src_dir/cmake1.cmake: -------------------------------------------------------------------------------- 1 | # blah comment 2 | # 3 | 4 | something() 5 | # comment 6 | something_else() 7 | 8 | long_function( 9 | # comment 10 | param 11 | ) 12 | 13 | long_string(" 14 | # looks like a comment but isn't 15 | ") 16 | 17 | long_string( 18 | " 19 | # looks like a comment but isn't 20 | " 21 | ) 22 | 23 | message( 24 | ' 25 | # looks like a string but isn't 26 | ' 27 | ) 28 | 29 | message("string") 30 | 31 | message( 32 | 33 | ) 34 | -------------------------------------------------------------------------------- /test/src_dir/configure.ac: -------------------------------------------------------------------------------- 1 | dnl This is an autoconf file. 2 | 3 | AC_INIT([giant-space-monkey], [0.0]) 4 | AC_PREREQ(2.5) 5 | 6 | -------------------------------------------------------------------------------- /test/src_dir/coq.v: -------------------------------------------------------------------------------- 1 | Require Import String. 2 | (* comment *) 3 | Check "multiline 4 | string"%string. 5 | 6 | (* multiline 7 | comment *) 8 | 9 | (* recursion in (* a 10 | comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/src_dir/css1.css: -------------------------------------------------------------------------------- 1 | .foo { 2 | padding: 10px; 3 | } 4 | -------------------------------------------------------------------------------- /test/src_dir/dcl.com: -------------------------------------------------------------------------------- 1 | $! Test file for DCL parser 2 | $ ! Written by Camiel Vanderhoeven 3 | $ 4 | $ 5 | $ SET VERIFY 6 | $ WRITE SYS$SYSTEM 7 | This is some text 8 | 9 | $ EXIT 10 | $! This is comment again 11 | $! 12 | $ 13 | -------------------------------------------------------------------------------- /test/src_dir/diff1_new.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 5 | 9 | 10 | new 11 | 12 | -------------------------------------------------------------------------------- /test/src_dir/diff1_old.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | 9 | 10 | old 11 | 12 | -------------------------------------------------------------------------------- /test/src_dir/diff2_new.c: -------------------------------------------------------------------------------- 1 | /* new */ 2 | #include 'foo.c' 3 | /* common */ 4 | int do_stuff(old_code) { 5 | int common; 6 | int new_var; 7 | } 8 | -------------------------------------------------------------------------------- /test/src_dir/diff2_old.c: -------------------------------------------------------------------------------- 1 | /* old */ 2 | #include 'foo.c' 3 | /* common */ 4 | int do_stuff(old_code) { 5 | int common; 6 | int old_var; 7 | } 8 | -------------------------------------------------------------------------------- /test/src_dir/diff3_new.xml: -------------------------------------------------------------------------------- 1 | 2 | new 3 | 4 | -------------------------------------------------------------------------------- /test/src_dir/diff3_old.xml: -------------------------------------------------------------------------------- 1 | 2 | old 3 | 4 | -------------------------------------------------------------------------------- /test/src_dir/dylan1.dylan: -------------------------------------------------------------------------------- 1 | // random program i found 2 | define function describe-list(my-list :: , #key verbose?) => () 3 | format(*standard-output*, "{a , size: %d", my-list.size); 4 | if (verbose?) 5 | format(*standard-output*, ", elements:"); 6 | for (item in my-list) 7 | format(*standard-output*, " %=", item); 8 | end for; 9 | end if; 10 | format(*standard-output*, "}"); 11 | end function; 12 | 13 | describe-list(#(1, 2, 3, 4, 5, 6)); 14 | // prints "{a , size: 6}" 15 | 16 | describe-list(#(5, 7, 3), verbose?: #t); 17 | // prints "{a , size: 3, elements: 5 7 3}" 18 | -------------------------------------------------------------------------------- /test/src_dir/eiffel.e: -------------------------------------------------------------------------------- 1 | class 2 | HELLO_WORLD 3 | create 4 | make 5 | feature 6 | make 7 | do 8 | -- prints "Hello world!" and starts new line 9 | 10 | print ("Hello, world!%N") 11 | 12 | end 13 | end 14 | -------------------------------------------------------------------------------- /test/src_dir/english.st: -------------------------------------------------------------------------------- 1 | a 2 | aa 3 | aardvark 4 | abacus 5 | apple 6 | zebra 7 | -------------------------------------------------------------------------------- /test/src_dir/example.qml: -------------------------------------------------------------------------------- 1 | // Just an example of QML file... 2 | 3 | import QtQuick 2.0 4 | 5 | Rectangle { 6 | width: 200 7 | height: 200 8 | color: "crimson" 9 | 10 | MouseArea { 11 | anchors.fill: parent 12 | onClicked: { 13 | // Was clicked 14 | Qt.quit(); 15 | } 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /test/src_dir/example.rkt: -------------------------------------------------------------------------------- 1 | ;; language declaration commented out until someone extends the 2 | ;; parser to support it: 3 | 4 | ;; #lang racket 5 | 6 | ;; Report each unique line from stdin 7 | (let ([saw (make-hash)]) 8 | (for ([line (in-lines)]) 9 | (unless (hash-ref saw line #f) 10 | (displayln line)) 11 | (hash-set! saw line #t))) 12 | 13 | -------------------------------------------------------------------------------- /test/src_dir/example.xsl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | sample webpage 9 | 10 | 11 | 12 | 13 | comment in HTML 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/src_dir/factor1.factor: -------------------------------------------------------------------------------- 1 | ! This is a comment 2 | ! Factor syntax is very simple, it just contains words separated by spaces 3 | ! '!' is a line comment word 4 | ! "whatever" is a string word 5 | USING: kernel io ; ! This is a vocabulary inclusion word 6 | IN: testing 7 | 8 | : test-string ( -- ) 9 | "this is a string" print ; 10 | 11 | : test ( x -- y ) ! Parenthesis define a stack effect declaration 12 | dup swap drop ; 13 | 14 | MAIN: test 15 | -------------------------------------------------------------------------------- /test/src_dir/fb.js: -------------------------------------------------------------------------------- 1 | function escapeHTML(value) 2 | { 3 | return String(value).replace(/[<>&"']/g, replaceChars); 4 | } 5 | 6 | window.onerror = onError; 7 | 8 | if (document.documentElement.getAttribute("debug") == "true") 9 | toggleConsole(true); 10 | -------------------------------------------------------------------------------- /test/src_dir/foo.dart: -------------------------------------------------------------------------------- 1 | void main() { 2 | // Line comment 3 | 4 | /* Block 5 | comment */ 6 | 7 | print("Hello!"); // Code with line comment 8 | print("World!"); /* Code with block comment */ 9 | } 10 | -------------------------------------------------------------------------------- /test/src_dir/foo.dtx: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | \texbf Hello world 3 | 4 | 5 | % \acommand 6 | % \anothercommand 7 | %% sample comment 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /test/src_dir/foo.ebuild: -------------------------------------------------------------------------------- 1 | # This is an ebuild. 2 | # Distributed under the terms of the GNU General Public License v2 3 | # $Header: $ 4 | 5 | DESCRIPTION="An ebuild" 6 | HOMEPAGE="" 7 | SRC_URI="" 8 | 9 | LICENSE="" 10 | SLOT="0" 11 | KEYWORDS="~x86" 12 | IUSE="" 13 | 14 | DEPEND="" 15 | RDEPEND="" 16 | 17 | pkg_setup() { 18 | # This is foo 19 | einfo "This is foo" 20 | } 21 | 22 | -------------------------------------------------------------------------------- /test/src_dir/foo.exheres-0: -------------------------------------------------------------------------------- 1 | # This is an exheres. 2 | 3 | require subversion bash-completion eutils flag-o-matic 4 | 5 | DESCRIPTION="An exheres" 6 | HOMEPAGE="http://example.org/" 7 | SRC_URI="" 8 | 9 | MYOPTIONS="monkey" 10 | LICENSE="GPL-2" 11 | SLOT="0" 12 | PLATFORMS="~amd64 ~ia64 ~x86" 13 | 14 | DEPENDENCIES="" 15 | 16 | src_prepare() { 17 | default 18 | ./autogen.bash || die "autogen.bash failed" 19 | } 20 | 21 | -------------------------------------------------------------------------------- /test/src_dir/foo.glsl: -------------------------------------------------------------------------------- 1 | // GLSL vertex shader 2 | void main() { 3 | gl_Position = gl_ProjectionMatrix * gl_ModelViewMatrix * gl_Vertex; 4 | } -------------------------------------------------------------------------------- /test/src_dir/foo.lc: -------------------------------------------------------------------------------- 1 | # Comment 2 | -- Comment 3 | // Comment 4 | 5 | /* 6 | 7 | Block Comment 8 | 9 | */ 10 | 11 | on mouseUp 12 | doSomething 13 | end mouseUp 14 | -------------------------------------------------------------------------------- /test/src_dir/foo.nsh: -------------------------------------------------------------------------------- 1 | ; NSIS "header" libraries can be in .nsh files. 2 | /* Copyright some time 3 | * never 4 | * and not much of that either 5 | "still a comment" 6 | */ 7 | 8 | !macro SillyMacro Param1 9 | ; ... Because we can ;-) 10 | !error "Why did you call this macro, ${Param1}? That was silly." 11 | !macroend 12 | 13 | Function Die 14 | # Likewise, because we can. 15 | DetailPrint "Aarrrrggghh! I died." 16 | Quit 17 | FunctionEnd 18 | -------------------------------------------------------------------------------- /test/src_dir/foo.nsi: -------------------------------------------------------------------------------- 1 | ; some nsis code 2 | /* 3 | * lorem 4 | ipsum 5 | dolor sit amet etcetera 6 | */ 7 | 8 | !include LogicLib.nsh 9 | OutFile foo.exe 10 | 11 | Section 12 | IfFileExists ${__FILE__} 0 +2 ; comments can be inline 13 | # Use of ; in a string on the next line 14 | MessageBox MB_OK "You moved this installer file; you shouldn't do that ;-)" 15 | SectionEnd 16 | -------------------------------------------------------------------------------- /test/src_dir/foo.swift: -------------------------------------------------------------------------------- 1 | class Person { 2 | var age = 25 3 | 4 | init() { 5 | print(“A new instance of this class Person is created.”) 6 | } 7 | 8 | 9 | /* Block 10 | comment */ 11 | func sayHelloWorld() { // Code appended with line comment 12 | print("Hello World") /* Code appended with block comment */ 13 | } 14 | } 15 | 16 | let personObj = Person() 17 | print(“This person age is \(personObj.age)”) 18 | -------------------------------------------------------------------------------- /test/src_dir/foo.tex: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | \texbf Hello world 3 | 4 | 5 | % 6 | % sample comment 7 | 8 | \end{document} 9 | -------------------------------------------------------------------------------- /test/src_dir/foo.vim: -------------------------------------------------------------------------------- 1 | " Vim syntax file 2 | " Language: Test file for ohcount 3 | " Author: Ciaran McCreesh 4 | " 5 | " This is a test vim syntax file for ohcount. 6 | " 7 | 8 | if &compatible || v:version < 700 9 | finish 10 | endif 11 | 12 | if exists("b:current_syntax") 13 | finish 14 | endif 15 | 16 | " This is a comment. There are many like it, but this one is mine. 17 | syn region GiantSpaceMonkey start=/^\s*#/ end=/$/ 18 | hi def link GiantSpaceMonkey Comment 19 | 20 | let b:current_syntax = "ohcount-test" 21 | 22 | -------------------------------------------------------------------------------- /test/src_dir/forth.4th: -------------------------------------------------------------------------------- 1 | \ Sample Forth code 2 | 3 | ( This is a comment 4 | spanning multiple lines ) 5 | 6 | : somedefinition ; 7 | 8 | -------------------------------------------------------------------------------- /test/src_dir/forth.fs: -------------------------------------------------------------------------------- 1 | \ Sample Forth code 2 | 3 | ( This is a comment 4 | spanning multiple lines ) 5 | 6 | : somedefinition ; 7 | 8 | -------------------------------------------------------------------------------- /test/src_dir/fortranfixed.f: -------------------------------------------------------------------------------- 1 | C Just a comment, whee. 2 | program foo 3 | 4 | C Many languages seem to count split lines as multiple lines, 5 | C so we should, too. 6 | write (*,*) 1 7 | + + 1 8 | 9 | C And I've never seen Fortran code that wraps strings; I'm 10 | C not even sure fixed form allows it. 11 | write (*,*) 'So we don''t bother testing odd string foo.' 12 | end 13 | -------------------------------------------------------------------------------- /test/src_dir/fortranfree.f: -------------------------------------------------------------------------------- 1 | ! -*- F90 -*- 2 | ! Just a comment, whee. 3 | program foofree 4 | integer:: c 5 | 6 | ! Many languages seem to count split lines as multiple lines, 7 | ! so we should, too. 8 | write (*,*) 1 & 9 | & + 1 10 | 11 | C = 1 ! Not a comment. 12 | 13 | ! And I've never seen Fortran code that wraps strings; I'm 14 | ! not even sure fixed form allows it. 15 | write (*,*) 'But we might as well test for it in& 16 | & free format.' 17 | 18 | end 19 | -------------------------------------------------------------------------------- /test/src_dir/groovy1.groovy: -------------------------------------------------------------------------------- 1 | //hello.groovy 2 | println "hello, world" 3 | for (arg in this.args ) { 4 | println "Argument:" + arg; 5 | } 6 | // this is a comment 7 | /* a block comment, commenting out an alternative to above: 8 | this.args.each{ arg -> println "hello, ${arg}"} 9 | */ 10 | -------------------------------------------------------------------------------- /test/src_dir/haml.haml: -------------------------------------------------------------------------------- 1 | %p 2 | %p= "stuff" 3 | / oneliner! 4 | %p 5 | / 6 | %p this won't render 7 | %p it is a comment! 8 | %p= "stuff" 9 | %p 10 | - code 11 | %p= "stuff" 12 | %p 13 | 14 | \- not script! 15 | -# silent comment 16 | %p 17 | -# 18 | silent 19 | comment 20 | %br/ 21 | -------------------------------------------------------------------------------- /test/src_dir/haskell2.hs: -------------------------------------------------------------------------------- 1 | {-| 2 | 3 | -} 4 | 5 | -------------------------------------------------------------------------------- /test/src_dir/haskell3.hs: -------------------------------------------------------------------------------- 1 | {- 2 | {- 3 lines of comments total! -} 3 | 4 | -} 5 | 6 | -------------------------------------------------------------------------------- /test/src_dir/java2.java: -------------------------------------------------------------------------------- 1 | /** 2 | */ 3 | 4 | -------------------------------------------------------------------------------- /test/src_dir/js2.js: -------------------------------------------------------------------------------- 1 | 14 | -------------------------------------------------------------------------------- /test/src_dir/js3.js: -------------------------------------------------------------------------------- 1 | return "'" + this.replace('\\', '\\\\').replace("'", '\\\'') + "'"; 2 | // comment 3 | -------------------------------------------------------------------------------- /test/src_dir/jsp1.jsp: -------------------------------------------------------------------------------- 1 | 2 | 3 | JSP page 4 | 5 | 6 | <%@ page language="java" %> 7 | <% out.println("Hello World"); %> 8 | <% // comment 9 | /* 10 | * more comment 11 | */ 12 | %> 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/src_dir/kotlin.kt: -------------------------------------------------------------------------------- 1 | // Line comment 2 | fun sum(a : Double, b : Double) : Double { 3 | return a + b 4 | } 5 | 6 | /* 7 | * Block comment 8 | */ 9 | 10 | fun hello(place : String) : Unit { 11 | print("Hello, \"$place\"\n") 12 | } 13 | 14 | /* 15 | * /* 16 | * * Block comments nest 17 | * */ 18 | */ 19 | 20 | fun main() : Unit { 21 | hello("""Very, very, very 22 | // long place 23 | somewhere""") 24 | } 25 | -------------------------------------------------------------------------------- /test/src_dir/limbo.m: -------------------------------------------------------------------------------- 1 | Htmlent: module { 2 | PATH: con "/dis/lib/htmlent.dis"; 3 | entities: array of (string, int); 4 | 5 | init: fn(); 6 | lookup: fn(name: string): int; 7 | conv: fn(s: string): string; 8 | }; 9 | -------------------------------------------------------------------------------- /test/src_dir/logtalk.lgt: -------------------------------------------------------------------------------- 1 | /* test file for Logtalk parsing */ 2 | 3 | % this is a Logtalk source file 4 | 5 | :- object(hello_world). 6 | 7 | % the initialization/1 directive argument is automatically executed 8 | % when the object is loaded into memory: 9 | :- initialization((nl, write('********** Hello World! **********'), nl)). 10 | 11 | :- end_object. 12 | -------------------------------------------------------------------------------- /test/src_dir/macro_crystal.cr: -------------------------------------------------------------------------------- 1 | # This is a comment. 2 | 3 | macro create_foo(name, &block) 4 | {% name.id = "bar" %} 5 | {{block}} 6 | -------------------------------------------------------------------------------- /test/src_dir/modelica.mo: -------------------------------------------------------------------------------- 1 | within fooBar; 2 | package Examples 3 | 4 | annotation (Icon(graphics={ 5 | Polygon( 6 | points={{-48,50},{52,-10},{-48,-70},{-48,50}}, 7 | lineColor={0,0,255}, 8 | pattern=LinePattern.None, 9 | fillColor={95,95,95}, 10 | fillPattern=FillPattern.Solid)}), Documentation(revisions=" 11 | 12 |

Copyright 2015-2016 RTE (France), SmarTS Lab (Sweden), AIA (Spain) and DTU (Denmark)

13 | ")); 14 | end Examples; 15 | -------------------------------------------------------------------------------- /test/src_dir/mxml1.mxml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TextArea { 8 | backgroundColor: #EEF5EE; 9 | } 10 | 11 | 12 | 13 | 14 | 15 | function copy() { 16 | destination.text=source.text 17 | } 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /test/src_dir/nix.nix: -------------------------------------------------------------------------------- 1 | {pkgs,config}: 2 | 3 | # one line comment 4 | { 5 | /* mulpiple line comment 6 | foo = 21; 7 | */ 8 | bar = " 9 | #!/bin/sh 10 | 11 | ls -la 12 | # comment 13 | echo hello #comment 14 | "; 15 | 16 | baz = '' 17 | #!/bin/sh 18 | 19 | ls -la 20 | # comment 21 | echo hello #comment 22 | ''; 23 | nixHttp = [ http://nixos.org/ ]; 24 | } 25 | -------------------------------------------------------------------------------- /test/src_dir/objj.j: -------------------------------------------------------------------------------- 1 | 2 | @import 3 | @import 4 | 5 | @import "Superclass.j" 6 | 7 | /* 8 | I'm commenting this class 9 | */ 10 | @implementation Class : Superclass 11 | { 12 | var x @accessors; 13 | } 14 | 15 | + (void)classMethod 16 | { 17 | return self; // this is a comment 18 | } 19 | 20 | - (void)instanceMethod 21 | { 22 | return self; 23 | } 24 | 25 | @end 26 | -------------------------------------------------------------------------------- /test/src_dir/ocaml.ml: -------------------------------------------------------------------------------- 1 | (** documentation *) 2 | print_string "Hello world!\n";; 3 | (**/**) 4 | (* extra comment *) 5 | 6 | (* multiline 7 | comment*) 8 | 9 | (* recursion in (* a 10 | comment *) to complicate things *) 11 | -------------------------------------------------------------------------------- /test/src_dir/pascal1.pas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/src_dir/pascal1.pas -------------------------------------------------------------------------------- /test/src_dir/pascal2.pp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/blackducksoftware/ohcount/ad25d3c4e7fa8042a00dfcf7f497ebf0903dfdae/test/src_dir/pascal2.pp -------------------------------------------------------------------------------- /test/src_dir/perl_pod_to_eof.pl: -------------------------------------------------------------------------------- 1 | =head NAME 2 | -------------------------------------------------------------------------------- /test/src_dir/pike1.pike: -------------------------------------------------------------------------------- 1 | #!/bin/env pike 2 | /* Say hello. */ 3 | int main(int argc, array(string) argv) 4 | { 5 | Stdio.stdout.write("Hello, world.\n"); 6 | } 7 | -------------------------------------------------------------------------------- /test/src_dir/postscript.ps: -------------------------------------------------------------------------------- 1 | %!PS 2 | % Postscript Directive at the top. Just like its supposed to be. 3 | /Courier 4 | 5 | 15 selectfont 6 | 72 500 moveto 7 | 8 | (Hello world) show 9 | showpage 10 | -------------------------------------------------------------------------------- /test/src_dir/prolog.pl: -------------------------------------------------------------------------------- 1 | /* test file for Prolog parsing */ 2 | 3 | % this is a Prolog source file 4 | 5 | % select(Element, List, Remaining) 6 | 7 | select(H, [H| T], T). 8 | select(H, [X| R], [X| T]) :- 9 | select(H, R, T). 10 | -------------------------------------------------------------------------------- /test/src_dir/puppet_empty_class_1.pp: -------------------------------------------------------------------------------- 1 | class tester ( 2 | ) { 3 | "Some Content" 4 | } 5 | -------------------------------------------------------------------------------- /test/src_dir/puppet_empty_class_2.pp: -------------------------------------------------------------------------------- 1 | class test::files { 2 | "Some Content" 3 | } 4 | -------------------------------------------------------------------------------- /test/src_dir/puppet_with_include_only.pp: -------------------------------------------------------------------------------- 1 | include ::postfix 2 | -------------------------------------------------------------------------------- /test/src_dir/py1.py: -------------------------------------------------------------------------------- 1 | # some python code 2 | # lorem 3 | # ipsum 4 | # foo 5 | 6 | class Foo: 7 | """ 8 | This is a foo class 9 | It doesn't do anything 10 | Therefore this doc comment is pointless 11 | """ 12 | 13 | def __init__(self, bar): 14 | """short doc comment""" 15 | print(bar) 16 | 17 | def string(self): 18 | print('This is a string') 19 | -------------------------------------------------------------------------------- /test/src_dir/rhtml1.rhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Ajax table manipulation attempt 4 | <%= stylesheet_link_tag "style" %> 5 | <%= javascript_include_tag :defaults %> 6 | 7 | 8 | 9 |
10 | <%= @content_for_layout %> 11 |
12 | 13 | <%= ruby code %>
14 | 18 | <%- multi 19 | lines of code 20 | # even inline comments! 21 | "damn" # that's sweet 22 | %> 23 |
<%= ruby_code %>
24 | 25 | 26 | -------------------------------------------------------------------------------- /test/src_dir/ruby1.rb: -------------------------------------------------------------------------------- 1 | require 'foo' 2 | 3 | #comment 4 | #comment 5 | #comment with "string" 6 | 7 | module Foo 8 | class Bar #comment 9 | def foo 10 | "double_quoted string" 11 | "embedded double_quote \"" 12 | more_code = true 13 | 'single_quoted string' 14 | 'embedded single_quote\'' 15 | more_code = true 16 | "multiline dquote 17 | more quote 18 | # not a comment 19 | " 20 | end 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /test/src_dir/rust.rs: -------------------------------------------------------------------------------- 1 | /* 2 | * This is the example given by www.rust-lang.org 3 | */ 4 | // Line comments work too 5 | fn main() { 6 | let nums = [1, 2]; 7 | let noms = ["Tim", "Eston", "Aaron", "Ben"]; 8 | 9 | let mut odds = nums.iter().map(|&x| x * 2 - 1); 10 | 11 | for num in odds { 12 | do spawn { 13 | println!("{:s} says hello from a lightweight thread!", noms[num]); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /test/src_dir/sample.i3: -------------------------------------------------------------------------------- 1 | (* Modula-3 *) INTERFACE M3Sample; (* file extension ".i3" *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...\n'; 10 | dqString = "this is a string within 'a string' ...\n"; 11 | 12 | END M3Sample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sample.m3: -------------------------------------------------------------------------------- 1 | (* Modula-3 *) MODULE M3Sample; (* file extension ".m3" *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...\n'; 10 | dqString = "this is a string within 'a string' ...\n"; 11 | 12 | END M3Sample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sample.mod: -------------------------------------------------------------------------------- 1 | MODULE Sample; (* in Modula-2 *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...'; 10 | dqString = "this is a string within 'a string' ..."; 11 | 12 | END Sample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sample.ob2: -------------------------------------------------------------------------------- 1 | (* Oberon-2 *) MODULE OberonSample; (* file extension ".ob2" *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString* = 'this is a string within "a string" ...'; 10 | dqString* = "this is a string within 'a string' ..."; 11 | 12 | END OberonSample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sample.obn: -------------------------------------------------------------------------------- 1 | (* Oberon *) MODULE OberonSample; (* file extension ".obn" *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString* = 'this is a string within "a string" ...'; 10 | dqString* = "this is a string within 'a string' ..."; 11 | 12 | END OberonSample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sampleDef.def: -------------------------------------------------------------------------------- 1 | DEFINITION MODULE Sample; (* in Modula-2 *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...'; 10 | dqString = "this is a string within 'a string' ..."; 11 | 12 | END Sample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sampleImp.mod: -------------------------------------------------------------------------------- 1 | IMPLEMENTATION MODULE Sample; (* in Modula-2 *) 2 | 3 | (* This is a comment *) 4 | 5 | (* This is a comment ... 6 | ... spanning more than one line *) 7 | 8 | CONST 9 | sqString = 'this is a string within "a string" ...'; 10 | dqString = "this is a string within 'a string' ..."; 11 | 12 | END Sample. 13 | -------------------------------------------------------------------------------- /test/src_dir/sh1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ls -la 4 | # comment 5 | echo hello #comment 6 | -------------------------------------------------------------------------------- /test/src_dir/sh2.sh: -------------------------------------------------------------------------------- 1 | var="\ 2 | Some string" 3 | 4 | # Now a comment 5 | var="some new string" 6 | -------------------------------------------------------------------------------- /test/src_dir/smalltalk1.st: -------------------------------------------------------------------------------- 1 | "====================================================================== 2 | | 3 | | Benchmark for streams 4 | | 5 | | 6 | ======================================================================" 7 | 8 | 9 | Eval [ 10 | n := Smalltalk arguments isEmpty 11 | ifTrue: [ 10000 ] 12 | ifFalse: [ 1 max: Smalltalk arguments first asInteger ]. 13 | 14 | hello := String new writeStream. 15 | n timesRepeat: [ hello nextPutAll: 'hello 16 | \' ]. "this is a comment 17 | so this line is a comment too\" 18 | hello position displayNl 19 | "but the previous one, and this one too, are not!" ] 20 | -------------------------------------------------------------------------------- /test/src_dir/standard_crystal.cr: -------------------------------------------------------------------------------- 1 | #comment 2 | # comment with "string" 3 | 4 | class Rest 5 | def one 6 | two do |c| 7 | puts c 8 | end 9 | end 10 | 11 | def two(&block : Int32 -> _) 12 | three { |x| yield x } # yield is faster than passing blocks. 13 | end 14 | 15 | def three 16 | yield 3 17 | end 18 | end 19 | 20 | Rest.new.one 21 | -------------------------------------------------------------------------------- /test/src_dir/structured_basic.b: -------------------------------------------------------------------------------- 1 | INPUT "What is your name: "; U$ 2 | PRINT "Hello "; U$ 3 | REM Test 4 | INPUT "How many stars do you want: "; N 5 | S$ = "" 6 | FOR I = 1 TO N 7 | S$ = S$ + "*" 8 | NEXT I 9 | PRINT S$ 10 | 11 | REM 12 | INPUT "Do you want more stars? "; A$ 13 | IF LEN(A$) = 0 THEN GOTO 110 14 | A$ = LEFT$(A$, 1) 15 | IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | PRINT "Goodbye "; 17 | FOR I = 1 TO 200 18 | PRINT U$; " "; 19 | NEXT I 20 | PRINT 21 | -------------------------------------------------------------------------------- /test/src_dir/structured_basic.bas: -------------------------------------------------------------------------------- 1 | INPUT "What is your name: "; U$ 2 | PRINT "Hello "; U$ 3 | REM Test 4 | INPUT "How many stars do you want: "; N 5 | S$ = "" 6 | FOR I = 1 TO N 7 | S$ = S$ + "*" 8 | NEXT I 9 | PRINT S$ 10 | 11 | REM 12 | INPUT "Do you want more stars? "; A$ 13 | IF LEN(A$) = 0 THEN GOTO 110 14 | A$ = LEFT$(A$, 1) 15 | IF (A$ = "Y") OR (A$ = "y") THEN GOTO 40 16 | PRINT "Goodbye "; 17 | FOR I = 1 TO 200 18 | PRINT U$; " "; 19 | NEXT I 20 | PRINT 21 | -------------------------------------------------------------------------------- /test/src_dir/ts1.ts: -------------------------------------------------------------------------------- 1 | /* 2 | * This is a TypeScript File 3 | */ 4 | 5 | // And a regular comment 6 | 7 | export class SomeClass { 8 | public text: string; 9 | 10 | public sayHello(name: string): string { 11 | return `Hello, ${name}`; 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /test/src_dir/unrealscript.uc: -------------------------------------------------------------------------------- 1 | class foo extends Actor; 2 | 3 | /** An UnrealScript 3 styled comment. */ 4 | var bool bFoo; 5 | 6 | simulated function PostBeginPlay() 7 | { 8 | // Comment 9 | log(self@"Hello World! Foo is"@bFoo); // Another comment 10 | /* A 11 | block 12 | comment */ 13 | Super.PostBeginPlay(); 14 | } 15 | 16 | defaultproperties 17 | { 18 | bFoo = true 19 | } 20 | -------------------------------------------------------------------------------- /test/src_dir/vb1.vb: -------------------------------------------------------------------------------- 1 | class foo 2 | ' comment 3 | 4 | require File.dirname(__FILE__) + '/../test_helper' 5 | include Lingo 6 | 7 | class ShellTest < LingoTest 8 | def test_comment 9 | p = Languages::Shell.parse(" #comment") 10 | assert_equal({ 'shell' => { :comment => [" #comment"] } }, p.output_buffers) 11 | end 12 | 13 | def test_comprehensive 14 | verify_parse("sh1.sh") 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /test/src_dir/vbs1.vbs: -------------------------------------------------------------------------------- 1 | 2 | require File.dirname(__FILE__) + '/../test_helper' 3 | include Lingo 4 | 5 | class ShellTest < LingoTest 6 | def test_comment 7 | p = Languages::Shell.parse(" #comment") 8 | assert_equal({ 'shell' => { :comment => [" #comment"] } }, p.output_buffers) 9 | end 10 | 11 | def test_comprehensive 12 | verify_parse("sh1.sh") 13 | end 14 | end 15 | -------------------------------------------------------------------------------- /test/src_dir/xml1.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 8 | ]]> 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/src_licenses/academic_t1.c: -------------------------------------------------------------------------------- 1 | /* Academic Free License */ 2 | -------------------------------------------------------------------------------- /test/src_licenses/adaptive_t1.rb: -------------------------------------------------------------------------------- 1 | # Adaptive Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_2_t1.cpp: -------------------------------------------------------------------------------- 1 | // Apache License, 2.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_2_t2.rb: -------------------------------------------------------------------------------- 1 | # Apache Software License 2.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_ish_t1.sql: -------------------------------------------------------------------------------- 1 | -- Apache-like license 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_ish_t2.sql: -------------------------------------------------------------------------------- 1 | -- apache-style license 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_t1.c: -------------------------------------------------------------------------------- 1 | // Apache Software License 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_t2.rb: -------------------------------------------------------------------------------- 1 | # Apache Software License 1.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/apache_t3.rb: -------------------------------------------------------------------------------- 1 | # apache license 2 | -------------------------------------------------------------------------------- /test/src_licenses/apple_open_source_t1.rb: -------------------------------------------------------------------------------- 1 | # Apple Public Source License 2 | -------------------------------------------------------------------------------- /test/src_licenses/artistic_t1.d: -------------------------------------------------------------------------------- 1 | // Artistic License 2 | -------------------------------------------------------------------------------- /test/src_licenses/attribution_assurance_t1.c: -------------------------------------------------------------------------------- 1 | /* Attribution Assurance Licenses */ 2 | -------------------------------------------------------------------------------- /test/src_licenses/boost_t2.c: -------------------------------------------------------------------------------- 1 | // Boost Software License - Version 1.0 - August 17th, 2003 2 | -------------------------------------------------------------------------------- /test/src_licenses/bsd_t1.rb: -------------------------------------------------------------------------------- 1 | # New BSD License 2 | -------------------------------------------------------------------------------- /test/src_licenses/cecill-b.c: -------------------------------------------------------------------------------- 1 | // terms of the CeCILL-B 2 | -------------------------------------------------------------------------------- /test/src_licenses/cecill-c.c: -------------------------------------------------------------------------------- 1 | // terms of the CeCILL-C 2 | -------------------------------------------------------------------------------- /test/src_licenses/cecill.c: -------------------------------------------------------------------------------- 1 | // terms of the CeCILL 2 | -------------------------------------------------------------------------------- /test/src_licenses/common_development_and_distribution_t1.c: -------------------------------------------------------------------------------- 1 | // Common Development and Distribution License 2 | -------------------------------------------------------------------------------- /test/src_licenses/common_public_t1.c: -------------------------------------------------------------------------------- 1 | // Common Public License 1.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/computer_associates_trusted_t1.c: -------------------------------------------------------------------------------- 1 | // Computer Associates Trusted Open Source License 1.1 2 | -------------------------------------------------------------------------------- /test/src_licenses/cua_office_t1.c: -------------------------------------------------------------------------------- 1 | /* 2 | * CUA Office Public License Version 1.0 3 | */ 4 | -------------------------------------------------------------------------------- /test/src_licenses/eclipse_t1.java: -------------------------------------------------------------------------------- 1 | // Eclipse Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/educational_t1.c: -------------------------------------------------------------------------------- 1 | // Educational Community License 2 | -------------------------------------------------------------------------------- /test/src_licenses/eiffel_2_t1.c: -------------------------------------------------------------------------------- 1 | // Eiffel Forum License V2.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/eiffel_t1.c: -------------------------------------------------------------------------------- 1 | // Eiffel Forum License 2 | -------------------------------------------------------------------------------- /test/src_licenses/entessa_t1.c: -------------------------------------------------------------------------------- 1 | // Entessa Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/eu_datagrid_t1.c: -------------------------------------------------------------------------------- 1 | // EU DataGrid Software License 2 | -------------------------------------------------------------------------------- /test/src_licenses/fair_t1.c: -------------------------------------------------------------------------------- 1 | // Fair License 2 | -------------------------------------------------------------------------------- /test/src_licenses/frameworx_t1.c: -------------------------------------------------------------------------------- 1 | // Frameworx License 2 | -------------------------------------------------------------------------------- /test/src_licenses/gpl3_or_later_t3.cpp: -------------------------------------------------------------------------------- 1 | /*************************************************************** 2 | * License: GPL version 3 or later 3 | **************************************************************/ 4 | -------------------------------------------------------------------------------- /test/src_licenses/gpl3_t2.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed under the terms of the GNU GPL v3, with Classpath Linking Exception 3 | * Licensed under the terms of the New BSD License for exclusive use by the Ensemble OS Project 4 | */ 5 | -------------------------------------------------------------------------------- /test/src_licenses/gpl_line_wrap_1.c: -------------------------------------------------------------------------------- 1 | // The line break and comment syntax should not disrupt the license match 2 | // GNU General 3 | // Public License 4 | -------------------------------------------------------------------------------- /test/src_licenses/gpl_t1.c: -------------------------------------------------------------------------------- 1 | // GNU General Public License (GPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/gpl_t2.c: -------------------------------------------------------------------------------- 1 | // This code is licensed under GPL. 2 | -------------------------------------------------------------------------------- /test/src_licenses/gpl_t3.c: -------------------------------------------------------------------------------- 1 | // @license http://www.gnu.org/licenses/gpl.txt 2 | -------------------------------------------------------------------------------- /test/src_licenses/gpl_t4.c: -------------------------------------------------------------------------------- 1 | //@license GPLv2 http://files.syscp.org/misc/COPYING.txt 2 | -------------------------------------------------------------------------------- /test/src_licenses/historical_t1.c: -------------------------------------------------------------------------------- 1 | // Historical Permission Notice and Disclaimer 2 | -------------------------------------------------------------------------------- /test/src_licenses/ibm_public_t1.c: -------------------------------------------------------------------------------- 1 | // IBM Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/intel_open_source_t1.c: -------------------------------------------------------------------------------- 1 | // Intel Open Source License 2 | -------------------------------------------------------------------------------- /test/src_licenses/jabber_open_source_t1.c: -------------------------------------------------------------------------------- 1 | // Jabber Open Source License 2 | -------------------------------------------------------------------------------- /test/src_licenses/lgpl_t1.c: -------------------------------------------------------------------------------- 1 | // GNU Library or "Lesser" General Public License (LGPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/lgpl_t2.c: -------------------------------------------------------------------------------- 1 | // GNU Lesser General Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/lgpl_t3.c: -------------------------------------------------------------------------------- 1 | // GNU LESSER GENERAL PUBLIC LICENSE 2 | -------------------------------------------------------------------------------- /test/src_licenses/lgpl_t4.c: -------------------------------------------------------------------------------- 1 | // Lesser GPL 2 | -------------------------------------------------------------------------------- /test/src_licenses/lgpl_t5.c: -------------------------------------------------------------------------------- 1 | // Library GPL 2 | -------------------------------------------------------------------------------- /test/src_licenses/lucent_plan9_t1.c: -------------------------------------------------------------------------------- 1 | // Lucent Public License (Plan9) 2 | -------------------------------------------------------------------------------- /test/src_licenses/lucent_public_t1.c: -------------------------------------------------------------------------------- 1 | // Lucent Public License Version 1.02 2 | -------------------------------------------------------------------------------- /test/src_licenses/mit_t1.c: -------------------------------------------------------------------------------- 1 | // MIT license 2 | -------------------------------------------------------------------------------- /test/src_licenses/mit_t2.c: -------------------------------------------------------------------------------- 1 | // MIT/X11 license 2 | -------------------------------------------------------------------------------- /test/src_licenses/mitre_t1.c: -------------------------------------------------------------------------------- 1 | // MITRE Collaborative Virtual Workspace License (CVW License) 2 | -------------------------------------------------------------------------------- /test/src_licenses/motosoto_t1.c: -------------------------------------------------------------------------------- 1 | // Motosoto License 2 | -------------------------------------------------------------------------------- /test/src_licenses/mozilla_public_1_1_t1.c: -------------------------------------------------------------------------------- 1 | // Mozilla Public License 1.1 (MPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/mozilla_public_1_t1.c: -------------------------------------------------------------------------------- 1 | // Mozilla Public License 1.0 (MPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/nasa_open_t1.c: -------------------------------------------------------------------------------- 1 | // NASA Open Source Agreement 1.3 2 | -------------------------------------------------------------------------------- /test/src_licenses/naumen_t1.c: -------------------------------------------------------------------------------- 1 | // Naumen Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/nethack_t1.c: -------------------------------------------------------------------------------- 1 | // Nethack General Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/nokia_open_source_t1.c: -------------------------------------------------------------------------------- 1 | // Nokia Open Source License 2 | -------------------------------------------------------------------------------- /test/src_licenses/oclc_research_t1.c: -------------------------------------------------------------------------------- 1 | // OCLC Research Public License 2.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/open_group_test_t1.c: -------------------------------------------------------------------------------- 1 | // Open Group Test Suite License 2 | -------------------------------------------------------------------------------- /test/src_licenses/open_software_t1.c: -------------------------------------------------------------------------------- 1 | // Open Software License 2 | -------------------------------------------------------------------------------- /test/src_licenses/php_license_t1.php: -------------------------------------------------------------------------------- 1 | 6 | -------------------------------------------------------------------------------- /test/src_licenses/python_license_t1.py: -------------------------------------------------------------------------------- 1 | """ 2 | Python license 3 | """ 4 | -------------------------------------------------------------------------------- /test/src_licenses/python_software_foundation_t1.py: -------------------------------------------------------------------------------- 1 | # Python Software Foundation License 2 | -------------------------------------------------------------------------------- /test/src_licenses/qt_public_t1.c: -------------------------------------------------------------------------------- 1 | // Qt Public License (QPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/realnetworks_public_source_t1.c: -------------------------------------------------------------------------------- 1 | // RealNetworks Public Source License V1.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/reciprocal_public_t1.c: -------------------------------------------------------------------------------- 1 | // Reciprocal Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/ricoh_source_t1.c: -------------------------------------------------------------------------------- 1 | // Ricoh Source Code Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/sleepycat_t1.c: -------------------------------------------------------------------------------- 1 | // Sleepycat License 2 | -------------------------------------------------------------------------------- /test/src_licenses/sugarcrm_1_1_3_t1.c: -------------------------------------------------------------------------------- 1 | // Sugar Public License Version 1.1.3 2 | -------------------------------------------------------------------------------- /test/src_licenses/sun_industry_standards_t1.c: -------------------------------------------------------------------------------- 1 | // Sun Industry Standards Source License (SISSL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/sun_public_t1.c: -------------------------------------------------------------------------------- 1 | // Sun Public License 2 | -------------------------------------------------------------------------------- /test/src_licenses/sybase_open_watcom_t1.c: -------------------------------------------------------------------------------- 1 | // Sybase Open Watcom Public License 1.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/u_of_i_ncsa_t1.c: -------------------------------------------------------------------------------- 1 | // University of Illinois/NCSA Open Source License 2 | -------------------------------------------------------------------------------- /test/src_licenses/vovida_software_t1.c: -------------------------------------------------------------------------------- 1 | // Vovida Software License v. 1.0 2 | -------------------------------------------------------------------------------- /test/src_licenses/w3c_t1.c: -------------------------------------------------------------------------------- 1 | // W3C License 2 | -------------------------------------------------------------------------------- /test/src_licenses/wtfpl.c: -------------------------------------------------------------------------------- 1 | // Do What The Fuck you Want to Public License 2 (WTFPL) 2 | -------------------------------------------------------------------------------- /test/src_licenses/wx_windows_t1.c: -------------------------------------------------------------------------------- 1 | // wxWindows Library License 2 | -------------------------------------------------------------------------------- /test/src_licenses/x_net_t1.c: -------------------------------------------------------------------------------- 1 | // X.Net License 2 | -------------------------------------------------------------------------------- /test/src_licenses/zlib_libpng_t1.c: -------------------------------------------------------------------------------- 1 | // zlib/libpng license 2 | -------------------------------------------------------------------------------- /test/src_licenses/zope_t1.c: -------------------------------------------------------------------------------- 1 | // Zope Public License 2 | -------------------------------------------------------------------------------- /test/symlink_test_dir/symlink_test_dir_target: -------------------------------------------------------------------------------- 1 | ../symlink_test_dir_target/ -------------------------------------------------------------------------------- /test/symlink_test_dir_target/from_symlink_foo.c: -------------------------------------------------------------------------------- 1 | // c file 2 | int function_a(void) { 3 | int x; 4 | } 5 | -------------------------------------------------------------------------------- /test/unit/parsers/test_ada.h: -------------------------------------------------------------------------------- 1 | 2 | void test_ada_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("ada", " --comment"), 5 | "ada", "", "--comment", 0 6 | ); 7 | } 8 | 9 | void test_ada_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("ada", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | } 15 | 16 | void all_ada_tests() { 17 | test_ada_comments(); 18 | test_ada_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_ampl.h: -------------------------------------------------------------------------------- 1 | 2 | void test_ampl_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("ampl", " #comment"), 5 | "ampl", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_ampl_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("ampl", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_ampl_tests() { 17 | test_ampl_comments(); 18 | test_ampl_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_augeas.h: -------------------------------------------------------------------------------- 1 | 2 | void test_augeas_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("augeas", " (* comment *)"), 5 | "augeas", "", "(* comment *)", 0 6 | ); 7 | } 8 | 9 | void test_augeas_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("augeas", " (*comment*)"), 12 | "comment", "(*comment*)" 13 | ); 14 | } 15 | 16 | void all_augeas_tests() { 17 | test_augeas_comments(); 18 | test_augeas_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_autoconf.h: -------------------------------------------------------------------------------- 1 | 2 | void test_autoconf_comment_entities() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("autoconf", " dnl comment"), 5 | "autoconf", "", "dnl comment", 0 6 | ); 7 | } 8 | 9 | void all_autoconf_tests() { 10 | test_autoconf_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_automake.h: -------------------------------------------------------------------------------- 1 | 2 | void test_automake_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("automake", " #comment"), 5 | "comment", "#comment" 6 | ); 7 | } 8 | 9 | void all_automake_tests() { 10 | test_automake_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_bat.h: -------------------------------------------------------------------------------- 1 | 2 | void test_bat_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("bat", " REM comment"), 5 | "bat", "", "REM comment", 0 6 | ); 7 | } 8 | 9 | void test_bat_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("bat", " rem comment"), 12 | "comment", "rem comment" 13 | ); 14 | } 15 | 16 | void all_bat_tests() { 17 | test_bat_comments(); 18 | test_bat_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_bfpp.h: -------------------------------------------------------------------------------- 1 | void test_bfpp_comment() { 2 | test_parser_verify_parse( 3 | test_parser_sourcefile("bfpp", " = comment"), 4 | "bfpp", "", "= comment", 0 5 | ); 6 | } 7 | 8 | void test_bfpp_comment_entities() { 9 | test_parser_verify_entity( 10 | test_parser_sourcefile("bfpp", " = comment"), 11 | " comment", "= comment" 12 | ); 13 | } 14 | 15 | void all_bfpp_tests() { 16 | test_bfpp_comment(); 17 | test_bfpp_comment_entities(); 18 | } 19 | 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_blitzmax.h: -------------------------------------------------------------------------------- 1 | 2 | void test_blitzmax_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("blitzmax", "' comment"), 5 | "blitzmax", "", "' comment", 0 6 | ); 7 | } 8 | 9 | void test_blitzmax_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("bat", " ' comment"), 12 | "comment", "' comment" 13 | ); 14 | } 15 | 16 | void all_blitzmax_tests() { 17 | test_blitzmax_comments(); 18 | test_blitzmax_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_brainfuck.h: -------------------------------------------------------------------------------- 1 | void test_brainfuck_comment() { 2 | test_parser_verify_parse( 3 | test_parser_sourcefile("brainfuck", " #comment"), 4 | "brainfuck", "", "#comment", 0 5 | ); 6 | } 7 | 8 | void test_brainfuck_comment_entities() { 9 | test_parser_verify_entity( 10 | test_parser_sourcefile("brainfuck", " #comment"), 11 | "#comment", "#comment" 12 | ); 13 | } 14 | 15 | void all_brainfuck_tests() { 16 | test_brainfuck_comment(); 17 | test_brainfuck_comment_entities(); 18 | } 19 | -------------------------------------------------------------------------------- /test/unit/parsers/test_clearsilver.h: -------------------------------------------------------------------------------- 1 | 2 | void test_clearsilver_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("clearsilver", " #comment"), 5 | "clearsilver", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_clearsilver_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("clearsilver", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_clearsilver_tests() { 17 | test_clearsilver_comments(); 18 | test_clearsilver_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_clojure.h: -------------------------------------------------------------------------------- 1 | 2 | void test_clojure_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("clojure", " ;;; comment"), 5 | "clojure", "", ";;; comment", 0 6 | ); 7 | } 8 | 9 | void test_clojure_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("clojure", " ;comment"), 12 | "comment", ";comment" 13 | ); 14 | } 15 | 16 | void all_clojure_tests() { 17 | test_clojure_comments(); 18 | test_clojure_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_coq.h: -------------------------------------------------------------------------------- 1 | 2 | void test_coq_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("coq", " (* comment *)"), 5 | "coq", "", "(* comment *)", 0 6 | ); 7 | } 8 | 9 | void test_coq_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("coq", " (*comment*)"), 12 | "comment", "(*comment*)" 13 | ); 14 | } 15 | 16 | void all_coq_tests() { 17 | test_coq_comments(); 18 | test_coq_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_crystal.h: -------------------------------------------------------------------------------- 1 | 2 | void test_crystal_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("crystal", " #comment"), 5 | "crystal", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_crystal_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("crystal", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("crystal", "=begin\ncomment\n=end"), 16 | "comment", "=begin\ncomment\n=end" 17 | ); 18 | } 19 | 20 | void all_crystal_tests() { 21 | test_crystal_comments(); 22 | test_crystal_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_cs_aspx.h: -------------------------------------------------------------------------------- 1 | 2 | void test_cs_aspx_comments() { 3 | test_parser_verify_parse2( 4 | test_parser_sourcefile("cs_aspx", "<%\n //comment\n%>"), 5 | "html", "<%\n%>", "", 0, 6 | "csharp", "", "//comment\n", 0 7 | ); 8 | } 9 | 10 | void all_cs_aspx_tests() { 11 | test_cs_aspx_comments(); 12 | } 13 | -------------------------------------------------------------------------------- /test/unit/parsers/test_csharp.h: -------------------------------------------------------------------------------- 1 | 2 | void test_csharp_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("csharp", " //comment"), 5 | "csharp", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_csharp_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("csharp", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("csharp", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_csharp_tests() { 21 | test_csharp_comments(); 22 | test_csharp_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_css.h: -------------------------------------------------------------------------------- 1 | 2 | void test_css_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("css", " /*comment*/"), 5 | "css", "", "/*comment*/", 0 6 | ); 7 | } 8 | 9 | void test_css_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("css", " /*comment*/"), 12 | "comment", "/*comment*/" 13 | ); 14 | } 15 | 16 | void all_css_tests() { 17 | test_css_comments(); 18 | test_css_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_dylan.h: -------------------------------------------------------------------------------- 1 | 2 | void test_dylan_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("dylan", " //comment"), 5 | "dylan", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_dylan_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("dylan", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("dylan", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_dylan_tests() { 21 | test_dylan_comments(); 22 | test_dylan_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_ebuild.h: -------------------------------------------------------------------------------- 1 | 2 | void test_ebuild_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("ebuild", " #comment"), 5 | "comment", "#comment" 6 | ); 7 | } 8 | 9 | void all_ebuild_tests() { 10 | test_ebuild_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_eiffel.h: -------------------------------------------------------------------------------- 1 | 2 | void test_eiffel_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("eiffel", " --comment"), 5 | "eiffel", "", "--comment", 0 6 | ); 7 | } 8 | 9 | void test_eiffel_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("eiffel", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | } 15 | 16 | void all_eiffel_tests() { 17 | test_eiffel_comments(); 18 | test_eiffel_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_elm.h: -------------------------------------------------------------------------------- 1 | 2 | void test_elm_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("elm", " --comment"), 5 | "elm", "", "--comment", 0 6 | ); 7 | } 8 | 9 | void test_elm_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("elm", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("elm", " {-comment-}"), 16 | "comment", "{-comment-}" 17 | ); 18 | } 19 | 20 | void all_elm_tests() { 21 | test_elm_comments(); 22 | test_elm_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_emacs_lisp.h: -------------------------------------------------------------------------------- 1 | 2 | void test_emacs_lisp_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("emacslisp", " ;;comment"), 5 | "emacslisp", "", ";;comment", 0 6 | ); 7 | } 8 | 9 | void test_emacs_lisp_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("emacslisp", " ;comment"), 12 | "comment", ";comment" 13 | ); 14 | } 15 | 16 | void all_emacs_lisp_tests() { 17 | test_emacs_lisp_comments(); 18 | test_emacs_lisp_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_erlang.h: -------------------------------------------------------------------------------- 1 | 2 | void test_erlang_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("erlang", " %%comment"), 5 | "erlang", "", "%%comment", 0 6 | ); 7 | } 8 | 9 | void test_erlang_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("erlang", " %comment"), 12 | "comment", "%comment" 13 | ); 14 | } 15 | 16 | void all_erlang_tests() { 17 | test_erlang_comments(); 18 | test_erlang_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_exheres.h: -------------------------------------------------------------------------------- 1 | 2 | void test_exheres_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("exheres", " #comment"), 5 | "comment", "#comment" 6 | ); 7 | } 8 | 9 | void all_exheres_tests() { 10 | test_exheres_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_factor.h: -------------------------------------------------------------------------------- 1 | 2 | void test_factor_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("factor", " ! comment"), 5 | "factor", "", "! comment", 0 6 | ); 7 | } 8 | 9 | void test_factor_strings() { 10 | test_parser_verify_parse( 11 | test_parser_sourcefile("factor", "\"abc!not a 'comment\""), 12 | "factor", "\"abc!not a 'comment\"", "", 0 13 | ); 14 | } 15 | 16 | void all_factor_tests() { 17 | test_factor_comments(); 18 | test_factor_strings(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_forth.h: -------------------------------------------------------------------------------- 1 | 2 | void test_forth_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("forth", " \\comment"), 5 | "comment", "\\comment" 6 | ); 7 | test_parser_verify_entity( 8 | test_parser_sourcefile("forth", " (comment)"), 9 | "comment", "(comment)" 10 | ); 11 | } 12 | 13 | void all_forth_tests() { 14 | test_forth_comment_entities(); 15 | } 16 | -------------------------------------------------------------------------------- /test/unit/parsers/test_fortran.h: -------------------------------------------------------------------------------- 1 | 2 | void test_fortran_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("fortranfree", " !comment"), 5 | "comment", "!comment" 6 | ); 7 | test_parser_verify_entity( 8 | test_parser_sourcefile("fortranfixed", "C comment"), 9 | "comment", "C comment" 10 | ); 11 | } 12 | 13 | void all_fortran_tests() { 14 | test_fortran_comment_entities(); 15 | } 16 | -------------------------------------------------------------------------------- /test/unit/parsers/test_fsharp.h: -------------------------------------------------------------------------------- 1 | 2 | void test_fsharp_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("fsharp", " //comment"), 5 | "fsharp", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_fsharp_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("fsharp", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("fsharp", " (*comment*)"), 16 | "comment", "(*comment*)" 17 | ); 18 | } 19 | 20 | void all_fsharp_tests() { 21 | test_fsharp_comments(); 22 | test_fsharp_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_groovy.h: -------------------------------------------------------------------------------- 1 | 2 | void test_groovy_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("groovy", " //comment"), 5 | "groovy", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_groovy_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("groovy", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("groovy", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_groovy_tests() { 21 | test_groovy_comments(); 22 | test_groovy_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_haskell.h: -------------------------------------------------------------------------------- 1 | 2 | void test_haskell_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("haskell", " --comment"), 5 | "haskell", "", "--comment", 0 6 | ); 7 | } 8 | 9 | void test_haskell_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("haskell", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("haskell", " {-comment-}"), 16 | "comment", "{-comment-}" 17 | ); 18 | } 19 | 20 | void all_haskell_tests() { 21 | test_haskell_comments(); 22 | test_haskell_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_haxe.h: -------------------------------------------------------------------------------- 1 | 2 | void test_haxe_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("haxe", " //comment"), 5 | "haxe", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_haxe_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("haxe", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("haxe", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_haxe_tests() { 21 | test_haxe_comments(); 22 | test_haxe_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_jam.h: -------------------------------------------------------------------------------- 1 | 2 | void test_jam_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("jam", " #comment"), 5 | "jam", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_jam_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("jam", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_jam_tests() { 17 | test_jam_comments(); 18 | test_jam_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_java.h: -------------------------------------------------------------------------------- 1 | 2 | void test_java_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("java", " //comment"), 5 | "java", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_java_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("java", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("java", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_java_tests() { 21 | test_java_comments(); 22 | test_java_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_julia.h: -------------------------------------------------------------------------------- 1 | 2 | void test_julia_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("julia", " #comment"), 5 | "julia", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_julia_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("julia", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("julia", "#=\ncomment\n=#"), 16 | "comment", "#=\ncomment\n=#" 17 | ); 18 | } 19 | 20 | void all_julia_tests() { 21 | test_julia_comments(); 22 | test_julia_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_lua.h: -------------------------------------------------------------------------------- 1 | 2 | void test_lua_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("lua", " -- comment"), 5 | "lua", "", "-- comment", 0 6 | ); 7 | } 8 | 9 | void test_lua_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("lua", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("lua", " --[[comment\ncomment]]"), 16 | "comment", "--[[comment\ncomment]]" 17 | ); 18 | } 19 | 20 | void all_lua_tests() { 21 | test_lua_comments(); 22 | test_lua_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_make.h: -------------------------------------------------------------------------------- 1 | 2 | void test_make_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("make", " #comment"), 5 | "comment", "#comment" 6 | ); 7 | } 8 | 9 | void all_make_tests() { 10 | test_make_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_mathematica.h: -------------------------------------------------------------------------------- 1 | 2 | void test_mathematica_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("mathematica", " (*comment*)"), 5 | "comment", "(*comment*)" 6 | ); 7 | } 8 | 9 | void all_mathematica_tests() { 10 | test_mathematica_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_metafont.h: -------------------------------------------------------------------------------- 1 | 2 | void test_metafont_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("metafont", " % comment"), 5 | "metafont", "", "% comment", 0 6 | ); 7 | } 8 | 9 | void test_metafont_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("metafont", " %comment"), 12 | "comment", "%comment" 13 | ); 14 | } 15 | 16 | void all_metafont_tests() { 17 | test_metafont_comments(); 18 | test_metafont_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_nix.h: -------------------------------------------------------------------------------- 1 | 2 | void test_nix_line_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("nix", "# comment"), 5 | "nix", "", "# comment", 0 6 | ); 7 | } 8 | 9 | void all_nix_tests() { 10 | test_nix_line_comments(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_ocaml.h: -------------------------------------------------------------------------------- 1 | 2 | void test_ocaml_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("ocaml", " (* comment *)"), 5 | "ocaml", "", "(* comment *)", 0 6 | ); 7 | } 8 | 9 | void test_ocaml_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("ocaml", " (*comment*)"), 12 | "comment", "(*comment*)" 13 | ); 14 | } 15 | 16 | void all_ocaml_tests() { 17 | test_ocaml_comments(); 18 | test_ocaml_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_perl.h: -------------------------------------------------------------------------------- 1 | 2 | void test_perl_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("perl", " #comment"), 5 | "perl", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_perl_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("perl", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("perl", "=head1\ncomment\n=cut"), 16 | "comment", "=head1\ncomment\n=cut" 17 | ); 18 | } 19 | 20 | void all_perl_tests() { 21 | test_perl_comments(); 22 | test_perl_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_pike.h: -------------------------------------------------------------------------------- 1 | 2 | void test_pike_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("pike", " //comment"), 5 | "pike", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_pike_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("pike", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("pike", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_pike_tests() { 21 | test_pike_comments(); 22 | test_pike_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_postscript.h: -------------------------------------------------------------------------------- 1 | 2 | void test_postscript_comment_entities(){ 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("postscript", "%comment"), 5 | "comment", "%comment" 6 | ); 7 | } 8 | 9 | void all_postscript_tests(){ 10 | test_postscript_comment_entities(); 11 | } 12 | -------------------------------------------------------------------------------- /test/unit/parsers/test_powershell.h: -------------------------------------------------------------------------------- 1 | void test_powershell_comments() { 2 | test_parser_verify_parse( 3 | test_parser_sourcefile("powershell", " #comment"), 4 | "powershell", "", "#comment", 0 5 | ); 6 | } 7 | 8 | void test_powershell_comment_entities() { 9 | test_parser_verify_entity( 10 | test_parser_sourcefile("powershell", " #comment"), 11 | "comment", "#comment" 12 | ); 13 | } 14 | 15 | void all_powershell_tests() { 16 | test_powershell_comments(); 17 | test_powershell_comment_entities(); 18 | } 19 | -------------------------------------------------------------------------------- /test/unit/parsers/test_puppet.h: -------------------------------------------------------------------------------- 1 | 2 | void test_puppet_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("puppet", " #comment"), 5 | "puppet", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_puppet_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("puppet", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("puppet", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_puppet_tests() { 21 | test_puppet_comments(); 22 | test_puppet_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_qml.h: -------------------------------------------------------------------------------- 1 | 2 | void test_qml_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("qml", " //comment"), 5 | "qml", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_qml_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("qml", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("qml", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_qml_tests() { 21 | test_qml_comments(); 22 | test_qml_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_r.h: -------------------------------------------------------------------------------- 1 | 2 | void test_r_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("r", " #comment"), 5 | "r", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_r_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("r", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_r_tests() { 17 | test_r_comments(); 18 | test_r_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_rexx.h: -------------------------------------------------------------------------------- 1 | 2 | void test_rexx_comment() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("rexx", " /*comment*/"), 5 | "rexx", "", "/*comment*/", 0 6 | ); 7 | } 8 | 9 | void test_rexx_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("rexx", " /*comment*/"), 12 | "comment", "/*comment*/" 13 | ); 14 | } 15 | 16 | void all_rexx_tests() { 17 | test_rexx_comment(); 18 | test_rexx_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_rhtml.h: -------------------------------------------------------------------------------- 1 | 2 | void test_rhtml_comment() { 3 | test_parser_verify_parse2( 4 | test_parser_sourcefile("rhtml", "<%\n #comment\n%>"), 5 | "html", "<%\n%>", "", 0, 6 | "ruby", "", "#comment\n", 0 7 | ); 8 | } 9 | 10 | void all_rhtml_tests() { 11 | test_rhtml_comment(); 12 | } 13 | -------------------------------------------------------------------------------- /test/unit/parsers/test_ruby.h: -------------------------------------------------------------------------------- 1 | 2 | void test_ruby_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("ruby", " #comment"), 5 | "ruby", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_ruby_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("ruby", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("ruby", "=begin\ncomment\n=end"), 16 | "comment", "=begin\ncomment\n=end" 17 | ); 18 | } 19 | 20 | void all_ruby_tests() { 21 | test_ruby_comments(); 22 | test_ruby_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_scala.h: -------------------------------------------------------------------------------- 1 | 2 | void test_scala_comment_entities() { 3 | test_parser_verify_entity( 4 | test_parser_sourcefile("scala", " //comment"), 5 | "comment", "//comment" 6 | ); 7 | test_parser_verify_entity( 8 | test_parser_sourcefile("scala", " /*comment*/"), 9 | "comment", "/*comment*/" 10 | ); 11 | } 12 | 13 | void all_scala_tests() { 14 | test_scala_comment_entities(); 15 | } 16 | -------------------------------------------------------------------------------- /test/unit/parsers/test_scheme.h: -------------------------------------------------------------------------------- 1 | 2 | void test_scheme_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("scheme", " ;;; comment"), 5 | "scheme", "", ";;; comment", 0 6 | ); 7 | } 8 | 9 | void test_scheme_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("scheme", " ;comment"), 12 | "comment", ";comment" 13 | ); 14 | } 15 | 16 | void all_scheme_tests() { 17 | test_scheme_comments(); 18 | test_scheme_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_scilab.h: -------------------------------------------------------------------------------- 1 | 2 | void test_scilab_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("scilab", " //comment"), 5 | "scilab", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_scilab_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("scilab", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | } 15 | 16 | void all_scilab_tests() { 17 | test_scilab_comments(); 18 | test_scilab_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_shell.h: -------------------------------------------------------------------------------- 1 | 2 | void test_shell_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("shell", " #comment"), 5 | "shell", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_shell_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("shell", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_shell_tests() { 17 | test_shell_comments(); 18 | test_shell_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_smalltalk.h: -------------------------------------------------------------------------------- 1 | 2 | void test_smalltalk_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("smalltalk", " \"comment\\\""), 5 | "smalltalk", "", "\"comment\\\"", 0 6 | ); 7 | } 8 | 9 | void test_smalltalk_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("smalltalk", " \"comment\""), 12 | "comment", "\"comment\"" 13 | ); 14 | } 15 | 16 | void all_smalltalk_tests() { 17 | test_smalltalk_comments(); 18 | test_smalltalk_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_tcl.h: -------------------------------------------------------------------------------- 1 | 2 | void test_tcl_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("tcl", " #comment"), 5 | "tcl", "", "#comment", 0 6 | ); 7 | } 8 | 9 | void test_tcl_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("tcl", " #comment"), 12 | "comment", "#comment" 13 | ); 14 | } 15 | 16 | void all_tcl_tests() { 17 | test_tcl_comments(); 18 | test_tcl_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_tex.h: -------------------------------------------------------------------------------- 1 | 2 | void test_tex_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("tex", " %comment"), 5 | "tex", "", "%comment", 0 6 | ); 7 | } 8 | 9 | void test_tex_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("tex", " %comment"), 12 | "comment", "%comment" 13 | ); 14 | } 15 | 16 | void all_tex_tests() { 17 | test_tex_comments(); 18 | test_tex_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_umple.h: -------------------------------------------------------------------------------- 1 | void test_umple_comments() { 2 | test_parser_verify_parse( 3 | test_parser_sourcefile("umple", " //comment"), 4 | "umple", "", "//comment", 0 5 | ); 6 | } 7 | 8 | void test_umple_comment_entities() { 9 | test_parser_verify_entity( 10 | test_parser_sourcefile("umple", " //comment"), 11 | "comment", "//comment" 12 | ); 13 | test_parser_verify_entity( 14 | test_parser_sourcefile("umple", " /*comment*/"), 15 | "comment", "/*comment*/" 16 | ); 17 | } 18 | 19 | void all_umple_tests() { 20 | test_umple_comments(); 21 | test_umple_comment_entities(); 22 | } 23 | -------------------------------------------------------------------------------- /test/unit/parsers/test_vala.h: -------------------------------------------------------------------------------- 1 | 2 | void test_vala_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("vala", " //comment"), 5 | "vala", "", "//comment", 0 6 | ); 7 | } 8 | 9 | void test_vala_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("vala", " //comment"), 12 | "comment", "//comment" 13 | ); 14 | test_parser_verify_entity( 15 | test_parser_sourcefile("vala", " /*comment*/"), 16 | "comment", "/*comment*/" 17 | ); 18 | } 19 | 20 | void all_vala_tests() { 21 | test_vala_comments(); 22 | test_vala_comment_entities(); 23 | } 24 | -------------------------------------------------------------------------------- /test/unit/parsers/test_vb_aspx.h: -------------------------------------------------------------------------------- 1 | 2 | void test_vb_aspx_comment() { 3 | test_parser_verify_parse2( 4 | test_parser_sourcefile("vb_aspx", "<%\n 'comment\n%>"), 5 | "html", "<%\n%>", "", 0, 6 | "visualbasic", "", "'comment\n", 0 7 | ); 8 | } 9 | 10 | void all_vb_aspx_tests() { 11 | test_vb_aspx_comment(); 12 | } 13 | -------------------------------------------------------------------------------- /test/unit/parsers/test_vhdl.h: -------------------------------------------------------------------------------- 1 | 2 | void test_vhdl_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("vhdl", " -- comment"), 5 | "vhdl", "", "-- comment", 0 6 | ); 7 | } 8 | 9 | void test_vhdl_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("vhdl", " --comment"), 12 | "comment", "--comment" 13 | ); 14 | } 15 | 16 | void all_vhdl_tests() { 17 | test_vhdl_comments(); 18 | test_vhdl_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_xaml.h: -------------------------------------------------------------------------------- 1 | 2 | void test_xaml_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("xaml", " "), 5 | "xaml", "", "", 0 6 | ); 7 | } 8 | 9 | void test_xaml_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("xaml", " "), 12 | "comment", "" 13 | ); 14 | } 15 | 16 | void all_xaml_tests() { 17 | test_xaml_comments(); 18 | test_xaml_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_xml.h: -------------------------------------------------------------------------------- 1 | 2 | void test_xml_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("xml", " "), 5 | "xml", "", "", 0 6 | ); 7 | } 8 | 9 | void test_xml_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("xml", " "), 12 | "comment", "" 13 | ); 14 | } 15 | 16 | void all_xml_tests() { 17 | test_xml_comments(); 18 | test_xml_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_xmlschema.h: -------------------------------------------------------------------------------- 1 | 2 | void test_xmlschema_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("xmlschema", " "), 5 | "xmlschema", "", "", 0 6 | ); 7 | } 8 | 9 | void test_xmlschema_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("xmlschema", " "), 12 | "comment", "" 13 | ); 14 | } 15 | 16 | void all_xmlschema_tests() { 17 | test_xmlschema_comments(); 18 | test_xmlschema_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/parsers/test_xslt.h: -------------------------------------------------------------------------------- 1 | 2 | void test_xslt_comments() { 3 | test_parser_verify_parse( 4 | test_parser_sourcefile("xslt", " "), 5 | "xslt", "", "", 0 6 | ); 7 | } 8 | 9 | void test_xslt_comment_entities() { 10 | test_parser_verify_entity( 11 | test_parser_sourcefile("xslt", " "), 12 | "comment", "" 13 | ); 14 | } 15 | 16 | void all_xslt_tests() { 17 | test_xslt_comments(); 18 | test_xslt_comment_entities(); 19 | } 20 | -------------------------------------------------------------------------------- /test/unit/ruby/gestalt/filename_rule_test.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require File.dirname(__FILE__) + '/../../../../ruby/gestalt' 3 | 4 | class FilenameRuleTest < Test::Unit::TestCase 5 | include Ohcount::Gestalt 6 | 7 | def test_process_file 8 | r = FilenameRule.new('foo\.rb') 9 | s = Ohcount::SourceFile.new('/bar/com/foo.rb', :contents => <<-RUBY_CODE 10 | # comment 11 | code = 1 12 | RUBY_CODE 13 | ) 14 | assert r.process_source_file(s) 15 | assert_equal 1, r.count 16 | end 17 | end 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/unit/ruby/gestalt/gestalt_test.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require File.dirname(__FILE__) + '/../test_helper.rb' 3 | require File.dirname(__FILE__) + '/file_rule_test' 4 | require File.dirname(__FILE__) + '/filename_rule_test' 5 | require File.dirname(__FILE__) + '/keyword_rule_test' 6 | require File.dirname(__FILE__) + '/rule_test' 7 | require File.dirname(__FILE__) + '/definitions_test' 8 | require File.dirname(__FILE__) + '/java_definitions_test' 9 | require File.dirname(__FILE__) + '/dot_net_definitions_test' 10 | require File.dirname(__FILE__) + '/jasper_definitions_test' 11 | -------------------------------------------------------------------------------- /test/unit/ruby/gestalt/rule_test.rb: -------------------------------------------------------------------------------- 1 | require 'test/unit' 2 | require File.dirname(__FILE__) + '/../../../../ruby/gestalt' 3 | 4 | class RuleTest < Test::Unit::TestCase 5 | 6 | def test_here 7 | 8 | end 9 | end 10 | 11 | 12 | -------------------------------------------------------------------------------- /test/unit/ruby/ruby_test.rb: -------------------------------------------------------------------------------- 1 | require File.dirname(__FILE__) + '/test_helper.rb' 2 | require File.dirname(__FILE__) + '/source_file_list_test.rb' 3 | require File.dirname(__FILE__) + '/source_file_test.rb' 4 | require File.dirname(__FILE__) + '/gestalt/gestalt_test' 5 | --------------------------------------------------------------------------------