Repository: AlDanial/cloc Branch: master Commit: 26f78e2f1443 Files: 1027 Total size: 3.1 MB Directory structure: gitextract_92_lc_1g/ ├── .devcontainer/ │ ├── Dockerfile │ └── devcontainer.json ├── .dockerignore ├── .github/ │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE/ │ │ ├── report-a-bug.md │ │ └── request-an-enhancement.md │ └── workflows/ │ ├── build.yml │ ├── release-ready.yml │ └── release-staging.yml ├── .gitignore ├── .vscode/ │ └── launch.json ├── Dockerfile ├── Dockerfile.build ├── LICENSE ├── README.md ├── Unix/ │ ├── AUTHORS │ ├── COPYING │ ├── INSTALL │ ├── Makefile │ ├── NEWS │ ├── README │ ├── cloc │ ├── cloc.1.pod │ ├── pod2man.mk │ ├── t/ │ │ ├── 00_C.t │ │ ├── 01_opts.t │ │ └── 02_git.t │ └── why_this_directory_exists.txt ├── cloc ├── sqlite_formatter └── tests/ ├── README ├── inputs/ │ ├── 955.bpmn │ ├── 955.hbm.xml │ ├── 955.jrxml │ ├── 955.lb.xml │ ├── 955.tld │ ├── AnsProlog.lp │ ├── Application_Data_Test.feature.cs │ ├── Arturo.art │ ├── Assembler-Intel.asm │ ├── Assembly-sysv.S │ ├── BUILD │ ├── BasicPlane.Figures-Rectangle.ixx │ ├── BoxWidget.ui │ ├── Buchberger.cocoa5 │ ├── C#.cs │ ├── C++-MFC.cc │ ├── C++-uppercase.CPP │ ├── C-Ansi.c │ ├── C.g4 │ ├── ChangeProperties.il │ ├── Chapel.chpl │ ├── Cobol.cbl │ ├── CodeQL.ql │ ├── ColdFusion.cfm │ ├── Combinators.idr │ ├── Containerfile │ ├── Counter.razor │ ├── DIEnumerator-10.0.ll │ ├── DocTest.thrift │ ├── Dockerfile │ ├── ERC20.cairo │ ├── ExprParser.g │ ├── FOCUS.focexec │ ├── Fortran77.f │ ├── Fortran90.f90 │ ├── FreemarkerTemplate.ftl │ ├── GamePanel.tscn │ ├── Gencat-NLS.msg │ ├── Haskell.hs │ ├── Hello.lidr │ ├── HelpersView.axaml │ ├── IDL.idl │ ├── ItemView.vue │ ├── Java.java │ ├── JetCar.cls │ ├── LaTeX.tex │ ├── Lanczos.m │ ├── LogMain.re │ ├── Lookup.agda │ ├── MSDOS.bat │ ├── Makefile │ ├── Mako.mako │ ├── Mathematica_1.m │ ├── Mathematica_2.wlt │ ├── Mojo.mojom │ ├── Mumps.mps │ ├── Octave.m │ ├── Once.HC │ ├── Pascal.p │ ├── Pascal.pas │ ├── Pascal.pp │ ├── PlusCalExample.tla │ ├── Prelude.dhall │ ├── ProcessPO.odx │ ├── RedBlackTree.res │ ├── RemoteSiteHelperTest.cls │ ├── RenderTest.metal │ ├── Rounds.scad │ ├── Sample.mc │ ├── SimpleODE.mo │ ├── Slim.html.slim │ ├── Slint-helloworld.slint │ ├── Snakefile │ ├── Splice.hs-boot │ ├── Sys.hx │ ├── TLAExample.tla │ ├── TableGen-ARM.td │ ├── Test.daml │ ├── Tk │ ├── Trapezoid_Rule.ipynb │ ├── TypeScript.ts │ ├── TypeScript_2.ts │ ├── USS.uss │ ├── UXML.uxml │ ├── X++.xpo │ ├── XML.xml │ ├── XSL-FO.xsl │ ├── XSLT.xslt │ ├── XmlToJSONSendPipeline.btp │ ├── Xtend.xtend │ ├── ZosMsg.mc │ ├── ZosNet.rc │ ├── ZosNp.def │ ├── aa/ │ │ └── bb/ │ │ └── cc/ │ │ └── plasma.c │ ├── acpclust.R │ ├── apertium-dan.dan.rlx │ ├── args.janet │ ├── arvo.hoon │ ├── asciidoctor.adoc │ ├── assembly.cs │ ├── basic.luau │ ├── basic.p4 │ ├── bbf-device.yang │ ├── beluga.bel │ ├── birds.pro │ ├── blur.glsl │ ├── body.gjs │ ├── bubs_tak_ard.prc │ ├── build.bzl │ ├── build.cake │ ├── cad.asy │ ├── cadence_test.cdc │ ├── captcha.cs │ ├── capture.ecr │ ├── certificates.sls │ ├── ch10-REPL-oriented-repl-interactions.cj │ ├── chat.st │ ├── child_template.jinja2 │ ├── child_template.njk │ ├── clarityfiles.clar │ ├── class.imba │ ├── cli-args.nf │ ├── cloc-dev.code-workspace │ ├── cloc_counts.csv │ ├── clusterConf.ttcn │ ├── comments.rhai │ ├── comments_in_str.svelte │ ├── comp.ecpp │ ├── complex_union.derw │ ├── conditions.CBL │ ├── config.junos │ ├── cpp-example.inc │ ├── cross-platform.just │ ├── csharp-designer.designer.cs │ ├── cucumber.feature │ ├── custom.triple.extension.js │ ├── darwin-configuration.nix │ ├── dd/ │ │ └── bb/ │ │ ├── cc/ │ │ │ └── MoreTeapotsRenderer.cpp │ │ ├── config.c │ │ └── ee/ │ │ └── TeapotRenderer.cpp │ ├── demo.odin │ ├── dev.exs │ ├── diff/ │ │ ├── A/ │ │ │ ├── d1/ │ │ │ │ └── hello.f90 │ │ │ ├── d2/ │ │ │ │ ├── hello.java │ │ │ │ └── hi.py │ │ │ └── hello.C │ │ └── B/ │ │ ├── d1/ │ │ │ └── hello.f90 │ │ ├── d2/ │ │ │ └── hi.py │ │ ├── extra_file.pl │ │ └── hello.C │ ├── dlist.lean │ ├── door.tres │ ├── dotNET_intermediate.il │ ├── double_doors.dsc │ ├── drools.drl │ ├── drupal.mxml │ ├── eddsa.circom │ ├── elixir.ex │ ├── en_AU.po │ ├── example_2d.gdshader │ ├── fib.dfy │ ├── fib_class.pkl │ ├── fibonacci.ncl │ ├── find.plm │ ├── flatbuffers.fbs │ ├── fmt.ha │ ├── foo_bar/ │ │ ├── bar/ │ │ │ └── foo/ │ │ │ └── momo/ │ │ │ └── tbfm.sh │ │ └── foo/ │ │ └── bar/ │ │ └── lala/ │ │ └── tfbl.sh │ ├── fortran.inc │ ├── fractal.um │ ├── fsharp.fs │ ├── fsharp_script.fsx │ ├── functional.cj │ ├── futhark.fut │ ├── generate.fnl │ ├── git_helpers.fish │ ├── github_user.aria │ ├── glade-search-popover.ui │ ├── glossary.json │ ├── glossary.json5 │ ├── gnureadline.vala │ ├── graphql.gql │ ├── greeter.tsx │ ├── groovy_triple.gvy │ ├── guard_talking.yarn │ ├── guestbook.tpl │ ├── hanoi.inc │ ├── harbour_xbase.prg │ ├── hello.C │ ├── hello.bf │ ├── hello.f │ ├── hello.f90 │ ├── hello.java │ ├── hello.kt │ ├── hello.lua │ ├── hello.pas │ ├── hello.pl1 │ ├── hello.sp │ ├── hello1.pas │ ├── hello_1.0.bb │ ├── hello_app.go │ ├── hello_app.ʕ◔ϖ◔ʔ │ ├── hello_app_autogen.go │ ├── hello_app_autogen.ʕ◔ϖ◔ʔ │ ├── helloworld.raml │ ├── hi.mojo │ ├── hi.py │ ├── htlc.teal │ ├── html_heex_example.heex │ ├── i18n_de.ts │ ├── iclean.icl │ ├── idris_block_comments.idr │ ├── igorpro.ipf │ ├── includes_demo.mustache │ ├── inner_ref.jsonnet │ ├── input.gts │ ├── insertJournalEntry.ipl │ ├── invoices.prql │ ├── io.c3 │ ├── issue_875.bdy │ ├── issue_876.vue │ ├── issues/ │ │ ├── 114/ │ │ │ ├── bar/ │ │ │ │ ├── bee/ │ │ │ │ │ └── inner_most.js │ │ │ │ └── under_Bar.js │ │ │ └── foo/ │ │ │ └── under_foo.js │ │ ├── 131/ │ │ │ ├── README │ │ │ └── hi.py │ │ ├── 132/ │ │ │ ├── .gitignore │ │ │ ├── C-Ansi.c │ │ │ ├── README │ │ │ └── ignore_dir/ │ │ │ └── Fortran77.f │ │ ├── 166/ │ │ │ ├── X │ │ │ └── fake.thy │ │ ├── 183/ │ │ │ ├── eval1957.SACunidir.fr │ │ │ └── file.fth │ │ ├── 245/ │ │ │ └── complex_regular_subexpression.scala │ │ ├── 280/ │ │ │ ├── L/ │ │ │ │ └── hello_1.c │ │ │ └── R/ │ │ │ └── hello_2.c │ │ ├── 286/ │ │ │ └── project/ │ │ │ ├── ignore_subdir/ │ │ │ │ └── test.py │ │ │ └── read_subdir/ │ │ │ └── hi.c │ │ ├── 296/ │ │ │ ├── Lanczos.m │ │ │ ├── Mathematica_1.m │ │ │ ├── Octave.m │ │ │ ├── hello.lua │ │ │ ├── nested.lua │ │ │ └── qsort_demo.m │ │ ├── 312/ │ │ │ └── sam #ple.py │ │ ├── 318/ │ │ │ ├── Rcs.yaml │ │ │ └── Réponse.cs │ │ ├── 327/ │ │ │ ├── example.smarty2 │ │ │ └── lang.config │ │ ├── 341/ │ │ │ ├── cItems.cls │ │ │ └── thesis.cls │ │ ├── 350/ │ │ │ └── fs.go │ │ ├── 365/ │ │ │ └── RSpecTests.java │ │ ├── 370/ │ │ │ └── arduino_issue_370.ino │ │ ├── 375/ │ │ │ └── docstring.py │ │ ├── 378/ │ │ │ └── git_script.sh │ │ ├── 380/ │ │ │ └── wrapper.pl │ │ ├── 381/ │ │ │ ├── issue381.c │ │ │ └── issue381.java │ │ ├── 386/ │ │ │ └── make_386_repo.sh │ │ ├── 405/ │ │ │ └── globs.py │ │ ├── 407/ │ │ │ ├── count_dir/ │ │ │ │ ├── C-Ansi.c │ │ │ │ └── Test/ │ │ │ │ └── Java.java │ │ │ ├── level2/ │ │ │ │ ├── Java.java │ │ │ │ └── level/ │ │ │ │ └── Test/ │ │ │ │ ├── C-Ansi.c │ │ │ │ └── level2/ │ │ │ │ └── hi.py │ │ │ └── linked_dir/ │ │ │ └── hello.f │ │ ├── 408/ │ │ │ └── badly_named_ruby.pl │ │ ├── 420/ │ │ │ └── mixed_case_ext.Pl │ │ ├── 433/ │ │ │ └── excl.txt │ │ ├── 454/ │ │ │ └── createServer.js │ │ ├── 455/ │ │ │ ├── list.txt │ │ │ └── list_align.txt │ │ ├── 456/ │ │ │ ├── XML_no_ext │ │ │ └── XML_weird_ext.profile │ │ ├── 463/ │ │ │ ├── left.C │ │ │ └── right.C │ │ ├── 472/ │ │ │ ├── lua_def.txt │ │ │ └── not_really.lua │ │ ├── 476/ │ │ │ ├── A/ │ │ │ │ ├── bye.C │ │ │ │ ├── bye.f90 │ │ │ │ ├── hello.C │ │ │ │ └── hello.f90 │ │ │ └── B/ │ │ │ ├── bye.f90 │ │ │ ├── hello.C │ │ │ ├── hello.f90 │ │ │ └── yo.C │ │ ├── 482/ │ │ │ └── A/ │ │ │ ├── C-Ansi.c │ │ │ ├── hi.py │ │ │ └── temp.c │ │ ├── 494/ │ │ │ ├── P_EDI_Book.sql │ │ │ └── P_EDI_BookF8.sql │ │ ├── 502/ │ │ │ ├── FileCounter20200715140433.txt │ │ │ └── Điếm LOC/ │ │ │ └── P_EDI_Book.sql │ │ ├── 513/ │ │ │ ├── L/ │ │ │ │ └── empty.c │ │ │ └── diff_list.txt │ │ ├── 520/ │ │ │ └── julia_docstr.jl │ │ ├── 521/ │ │ │ ├── Test 188/ │ │ │ │ ├── Test1.sql │ │ │ │ └── UP0PB.sql │ │ │ └── Test188New/ │ │ │ └── Test 188/ │ │ │ ├── Test1.sql │ │ │ └── UP0PB.sql │ │ ├── 528/ │ │ │ ├── Fortran77.f │ │ │ ├── Lanczos.m │ │ │ ├── Mathematica_1.m │ │ │ ├── Octave.m │ │ │ ├── hello.C │ │ │ ├── hello.f │ │ │ ├── matlab_line_colors.m │ │ │ └── qsort_demo.m │ │ ├── 530/ │ │ │ └── C-Ansi.c │ │ ├── 537/ │ │ │ ├── my_define.txt │ │ │ └── sourceCounter.vsql │ │ ├── 538/ │ │ │ └── add.elm │ │ ├── 539/ │ │ │ └── nested_comments.elm │ │ ├── 540/ │ │ │ └── Hello.f │ │ ├── 542/ │ │ │ └── txt_lang_def.txtt │ │ ├── 577/ │ │ │ ├── diff_list_file.txt │ │ │ ├── options.txt │ │ │ ├── tour.swift │ │ │ └── tour2.swift │ │ ├── 579/ │ │ │ └── csharp-autogen.cs │ │ ├── 580/ │ │ │ └── encodingtest.cs │ │ ├── 596/ │ │ │ ├── def.txt │ │ │ └── hello.C │ │ ├── 597/ │ │ │ └── hello.C │ │ ├── 606/ │ │ │ └── in/ │ │ │ └── nomad_job.hcl │ │ ├── 611/ │ │ │ └── cmakelists.txt │ │ ├── 613/ │ │ │ └── nav.scss │ │ ├── 619/ │ │ │ └── RA.s │ │ ├── 625/ │ │ │ ├── new/ │ │ │ │ └── hello.C │ │ │ └── old/ │ │ │ └── .gitignore │ │ ├── 628/ │ │ │ └── sample.graphql │ │ ├── 644/ │ │ │ └── UInt8.cs │ │ ├── 657/ │ │ │ ├── C-Ansi.c │ │ │ ├── extra/ │ │ │ │ └── Mathematica_1.m │ │ │ └── hello.f │ │ ├── 670/ │ │ │ ├── hello.C │ │ │ └── hi.py │ │ ├── 692/ │ │ │ ├── A.txt │ │ │ └── B.txt │ │ ├── 701/ │ │ │ └── demo.ml │ │ ├── 710/ │ │ │ ├── A/ │ │ │ │ ├── cal.data │ │ │ │ └── hello.C │ │ │ ├── B/ │ │ │ │ └── hello.C │ │ │ └── test_files.list │ │ ├── 712/ │ │ │ ├── dir1/ │ │ │ │ ├── main.c │ │ │ │ └── sub_dir1/ │ │ │ │ └── foo.txt │ │ │ └── dir2/ │ │ │ ├── foo.txt │ │ │ └── main.c │ │ ├── 713/ │ │ │ └── hello.C │ │ ├── 720/ │ │ │ └── inputs.txt │ │ ├── 722/ │ │ │ ├── Fortran77.f │ │ │ ├── hello.f90 │ │ │ └── hello.lua │ │ ├── 735/ │ │ │ └── excludes.txt │ │ ├── 753/ │ │ │ ├── Application_Data_Test.feature.cs │ │ │ ├── assembly.cs │ │ │ └── csharp-designer.designer.cs │ │ ├── 781/ │ │ │ ├── fortran.inc │ │ │ ├── pascal.inc │ │ │ └── test1.inc │ │ ├── 784/ │ │ │ ├── .cloc-ignore │ │ │ └── src/ │ │ │ └── net/ │ │ │ └── companies/ │ │ │ ├── assembly.cs │ │ │ └── captcha.cs │ │ ├── 785/ │ │ │ ├── (dir)/ │ │ │ │ └── test.svelte │ │ │ ├── .cloc-ignore │ │ │ └── ok/ │ │ │ └── ok.sh │ │ ├── 804/ │ │ │ └── infoSQL.java │ │ ├── 805/ │ │ │ └── text_block.java │ │ ├── 806/ │ │ │ └── huffman.java │ │ ├── 811/ │ │ │ └── inline_comment.xml │ │ ├── 816/ │ │ │ └── star_slash_star.go │ │ ├── 822/ │ │ │ ├── a/ │ │ │ │ └── b/ │ │ │ │ └── c.csv │ │ │ └── a.csv │ │ ├── 833/ │ │ │ └── Developer/ │ │ │ ├── abc.txt │ │ │ └── clocTest/ │ │ │ └── foo/ │ │ │ ├── bar/ │ │ │ │ └── bar.swift │ │ │ └── foo.swift │ │ ├── 851/ │ │ │ └── level_1/ │ │ │ ├── flatbuffers.fbs │ │ │ ├── hello.lua │ │ │ └── level_2/ │ │ │ └── hello_2.lua │ │ ├── 862/ │ │ │ ├── Fortran77.f │ │ │ ├── a.py │ │ │ ├── b.py │ │ │ └── hello.c │ │ ├── 898/ │ │ │ ├── irregular'file.md │ │ │ └── regular.md │ │ └── 906/ │ │ ├── current_version.py │ │ └── previous_version.py │ ├── julia.jl │ ├── just_stuff.haml │ ├── kvlang.kv │ ├── layer.conf │ ├── layout.dt │ ├── linker.ld │ ├── locale_facets.h │ ├── logos.x │ ├── logos.xm │ ├── logtalk.lgt │ ├── machineDefFreshIds.lem │ ├── magikfile.magik │ ├── main.f03 │ ├── master.blade.php │ ├── matlab_line_colors.m │ ├── md5.rkt │ ├── meson.build │ ├── messages.rb │ ├── mfile.mk │ ├── modules1-func1.pp │ ├── modules1-func2.pp │ ├── modules1-ntp1.pp │ ├── modules1-typealias.pp │ ├── moonbit.mbt │ ├── moonbit.mbti │ ├── nested.lua │ ├── nomad_job.hcl │ ├── notes.typ │ ├── nu-example.nu │ ├── nuon-example.nuon │ ├── offline.jcl │ ├── openharmony.ets │ ├── orgmode.org │ ├── page_layout.aspx │ ├── pages.wxml │ ├── pages.wxss │ ├── parser_1.civet │ ├── parser_2.civet │ ├── pascal.inc │ ├── pek_example.pek │ ├── ping_pong.lfe │ ├── plain_text.txt │ ├── plantuml.puml │ ├── pointillism.pde │ ├── poly_constructor.jai │ ├── pop_by_country.xq │ ├── prob060-andreoss.p6 │ ├── proguard-project-app.pro │ ├── qsort_demo.m │ ├── queue.p │ ├── rand.apl │ ├── ranges.surql │ ├── razor.cshtml │ ├── reStructuredText.rst │ ├── reactive.svelte │ ├── regex_limit.gradle │ ├── ring.pony │ ├── robotframework.robot │ ├── robotframework.tsv │ ├── roku.brs │ ├── rules.sss │ ├── sample.R │ ├── sample.bicep │ ├── sample.ejs │ ├── schema.prisma │ ├── scheme.sls │ ├── script1-hadoop.pig │ ├── sdp_parser.jspeg │ ├── sdp_parser.peg │ ├── sdp_parser.peggy │ ├── sdp_parser.pegjs │ ├── sdp_parser.tspeg │ ├── send_msg.applescript │ ├── server_side.aspx │ ├── sharpsign.cl │ ├── slug.astro │ ├── solidity.sol │ ├── specman_e.e │ ├── specman_e2.e │ ├── squirrel_table.nut │ ├── stata.do │ ├── statcsv.nim │ ├── streamlines.pro │ ├── string.gleam │ ├── style.scss │ ├── swig_example.i │ ├── temp.c │ ├── templ_example.templ │ ├── test-1.0-py2.py3-none-win32.whl │ ├── test.Dsr │ ├── test.Rmd │ ├── test.hs │ ├── test.rego │ ├── test.vbhtml │ ├── test.vbs │ ├── test1.inc │ ├── test1.lhs │ ├── test1.php │ ├── test2.lhs │ ├── test_w_cpp_comments.svelte │ ├── tictactoe3d.ring │ ├── tnsdl.sdl │ ├── toml.pest │ ├── toml_example.toml │ ├── tour.swift │ ├── traffic_light.fsl │ ├── triple_lang_def.txt │ ├── type.wast │ ├── updateSprites.wgsl │ ├── utilities.R │ ├── variable_length.carbon │ ├── vba_test.vba │ ├── vbnet_test.vb │ ├── vbox.fxml │ ├── verilog.sv │ ├── vinos.nlogo │ ├── vs_solution.sln │ ├── vtl.vm │ ├── vyper.vy │ ├── warship.ts │ ├── webservice.wsdl │ ├── wiki.properties │ ├── window.blp │ ├── with_pod.pl │ ├── wokka.cbl │ ├── wokka.cs │ ├── wpedia.ini │ ├── x.mustache │ ├── xattr.conf │ ├── zir_sema.zig │ └── zos_assembly.s ├── make_git_repo.bash └── outputs/ ├── 00_C.yaml ├── 955.bpmn.yaml ├── 955.hbm.xml.yaml ├── 955.jrxml.yaml ├── 955.lb.xml.yaml ├── 955.tld.yaml ├── AnsProlog.lp.yaml ├── Arturo.art.yaml ├── Assembler-Intel.asm.yaml ├── Assembly-sysv.S.yaml ├── BUILD.yaml ├── BasicPlane.Figures-Rectangle.ixx.yaml ├── BoxWidget.ui.yaml ├── Buchberger.cocoa5.yaml ├── C#.cs.yaml ├── C++-MFC.cc.yaml ├── C++-uppercase.CPP.yaml ├── C-Ansi.c.yaml ├── C.g4.yaml ├── ChangeProperties.il.yaml ├── Chapel.chpl.yaml ├── Cobol.cbl.yaml ├── CodeQL.ql.yaml ├── ColdFusion.cfm.yaml ├── Combinators.idr.yaml ├── Containerfile.yaml ├── Counter.razor.yaml ├── DIEnumerator-10.0.ll.yaml ├── DocTest.thrift.yaml ├── Dockerfile.yaml ├── ERC20.cairo.yaml ├── ExprParser.g.yaml ├── FOCUS.focexec.yaml ├── Fortran77.f.yaml ├── Fortran90.f90.yaml ├── FreemarkerTemplate.ftl.yaml ├── GamePanel.tscn.yaml ├── Gencat-NLS.msg.yaml ├── Haskell.hs.yaml ├── Hello.lidr.yaml ├── HelpersView.axaml.yaml ├── IDL.idl.yaml ├── ItemView.vue.yaml ├── Java.java.yaml ├── JetCar.cls.yaml ├── LaTeX.tex.yaml ├── Lanczos.m.yaml ├── LogMain.re.yaml ├── Lookup.agda.yaml ├── MSDOS.bat.yaml ├── Makefile.yaml ├── Mako.mako.yaml ├── Mathematica_1.m.yaml ├── Mathematica_2.wlt.yaml ├── Mojo.mojom.yaml ├── Mumps.mps.yaml ├── Octave.m.yaml ├── Once.HC.yaml ├── Pascal.pas.yaml ├── Pascal.pp.yaml ├── PlusCalExample-no-autogen.tla.yaml ├── PlusCalExample.tla.yaml ├── Prelude.dhall.yaml ├── ProcessPO.odx.yaml ├── RedBlackTree.res.yaml ├── RemoteSiteHelperTest.cls.yaml ├── RenderTest.metal.yaml ├── Rounds.scad.yaml ├── SVG_logo.svg.yaml ├── Sample.mc.yaml ├── SimpleODE.mo.yaml ├── Slim.html.slim.yaml ├── Slint-helloworld.slint.yaml ├── Snakefile.yaml ├── Splice.hs-boot.yaml ├── Sys.hx.yaml ├── TLAExample.tla.yaml ├── TableGen-ARM.yaml ├── Test.daml.yaml ├── Tk.yaml ├── Trapezoid_Rule.ipynb.yaml ├── TypeScript.ts.yaml ├── TypeScript_2.ts.yaml ├── USS.uss.yaml ├── UXML.uxml.yaml ├── X++.xpo.yaml ├── XML.xml.yaml ├── XSL-FO.xsl.yaml ├── XSLT.xslt.yaml ├── XmlToJSONSendPipeline.btp.yaml ├── Xtend.xtend.yaml ├── ZosMsg.mc.yaml ├── ZosNet.rc.yaml ├── ZosNp.def.yaml ├── aa.yaml ├── acpclust.R.yaml ├── apertium-dan.dan.rlx.yaml ├── args.janet.yaml ├── arvo.hoon.yaml ├── asciidoctor.adoc.yaml ├── assembly.cs.yaml ├── basic.luau.yaml ├── basic.p4.yaml ├── bbf-device.yang.yaml ├── beluga.bel.yaml ├── birds.pro.yaml ├── bitbake.yaml ├── blur.glsl.yaml ├── body.gjs.yaml ├── bubs_tak_ard.prc.yaml ├── build.bzl.yaml ├── build.cake.yaml ├── cad.asy.yaml ├── cadence_test.cdc.yaml ├── captcha.cs.yaml ├── capture.ecr.yaml ├── certificates.sls.yaml ├── ch10-REPL-oriented-repl-interactions.cj.yaml ├── chat.st.yaml ├── child_template.jinja2.yaml ├── child_template.njk.yaml ├── clarityfiles.clar.yaml ├── class.imba.yaml ├── cli-args.nf.yaml ├── cloc-dev.code-workspace.yaml ├── cloc_counts.csv.yaml ├── clusterConf.ttcn.yaml ├── comments.rhai.yaml ├── comments_in_str.svelte.yaml ├── comp.ecpp.yaml ├── complex_union.derw.yaml ├── conditions.CBL.yaml ├── config.junos.yaml ├── cross-platform.just.yaml ├── csharp-designer.designer.cs.yaml ├── cucumber.feature.yaml ├── custom.triple.extension.js.yaml ├── darwin-configuration.nix.yaml ├── dd.yaml ├── demo.odin.yaml ├── dev.exs.yaml ├── dlist.lean.yaml ├── door.tres.yaml ├── dotNET_intermediate.il.yaml ├── double_doors.dsc.yaml ├── drools.drl.yaml ├── drupal.mxml.yaml ├── eddsa.circom.yaml ├── elixir.ex.yaml ├── en_AU.po.yaml ├── example_2d.gdshader.yaml ├── exclude_dir_1.yaml ├── fib.dfy.yaml ├── fib_class.pkl.yaml ├── fibonacci.ncl.yaml ├── find.plm.yaml ├── flatbuffers.fbs.yaml ├── fmt.ha.yaml ├── foo_bar.yaml ├── fractal.um.yaml ├── fsharp.fs.yaml ├── fsharp_script.fsx.yaml ├── functional.cj.yaml ├── futhark.fut.yaml ├── generate.fnl.yaml ├── git_helpers.fish.yaml ├── git_tests/ │ ├── 04179b6_ae0d26e.yaml │ ├── contents_f647093e8.tar.yaml │ ├── count_and_diff.yaml.HEAD │ ├── count_and_diff.yaml.HEAD~1 │ ├── count_and_diff.yaml.diff.HEAD~1.HEAD │ ├── d9b672643d.yaml │ ├── diff_contents_f647093e8.tar.yaml │ ├── diff_f15bf042b_f647093e8b.yaml │ ├── f15bf04_d9b6726.yaml │ └── f647093e8be3.yaml ├── github_user.aria.yaml ├── glade-search-popover.ui.yaml ├── glossary.json.yaml ├── glossary.json5.yaml ├── gnureadline.vala.yaml ├── graphql.gql.yaml ├── greeter.tsx.yaml ├── guard_talking.yarn.yaml ├── guestbook.tpl.yaml ├── harbour_xbase.prg.yaml ├── hello.bf.yaml ├── hello.f.yaml ├── hello.f90.yaml ├── hello.kt.yaml ├── hello.lua.yaml ├── hello.pas.yaml ├── hello.pl1.yaml ├── hello.sp.yaml ├── hello1.pas.yaml ├── hello_app.go-1.yaml ├── hello_app.go-2.yaml ├── helloworld.raml.yaml ├── hi.mojo.yaml ├── hi.py.yaml ├── htlc.teal.yaml ├── html_heex_example.heex.yaml ├── i18n_de.ts.yaml ├── iclean.icl.yaml ├── idris_block_comments.idr.yaml ├── igorpro.ipf.yaml ├── includes_demo.mustache.yaml ├── inner_ref.jsonnet.yaml ├── input.gts.yaml ├── insertJournalEntry.ipl.yaml ├── invoices.prql.yaml ├── io.c3.yaml ├── issue_875.bdy.yaml ├── issue_876.vue.yaml ├── issues/ │ ├── 114/ │ │ ├── T1.yaml │ │ ├── T2.yaml │ │ ├── T3.yaml │ │ ├── T4.yaml │ │ ├── T5.yaml │ │ ├── T6.yaml │ │ └── T7.yaml │ ├── 131/ │ │ ├── T1.yaml │ │ └── T2.yaml │ ├── 132/ │ │ ├── T1.yaml │ │ ├── T2.yaml │ │ ├── T3.yaml │ │ ├── T4.yaml │ │ ├── T5.yaml │ │ └── T6.yaml │ ├── 147/ │ │ └── T1.yaml │ ├── 166/ │ │ └── fake.thy.yaml │ ├── 183/ │ │ ├── eval1957.SACunidir.fr.yaml │ │ └── file.fth.yaml │ ├── 245/ │ │ └── CRS.scala.yaml │ ├── 280/ │ │ ├── 280.yaml │ │ └── 280_by_file.yaml │ ├── 286/ │ │ ├── 1.yaml │ │ ├── 2.yaml │ │ ├── 3.yaml │ │ ├── 4.yaml │ │ ├── 5.yaml │ │ └── 6.yaml │ ├── 296/ │ │ └── results.yaml │ ├── 312/ │ │ └── results.yaml │ ├── 327/ │ │ └── results.yaml │ ├── 341/ │ │ └── results.yaml │ ├── 350/ │ │ └── fs.go.yaml │ ├── 365/ │ │ └── results.yaml │ ├── 370/ │ │ └── results.yaml │ ├── 375/ │ │ └── results.yaml │ ├── 380/ │ │ └── wrapper.pl.yaml │ ├── 381/ │ │ ├── issue381.c.yaml │ │ └── issue381.java.yaml │ ├── 396/ │ │ ├── excl.yaml │ │ └── excl_diff.yaml │ ├── 405/ │ │ └── globs.py.yaml │ ├── 407/ │ │ ├── results1.yaml │ │ ├── results2.yaml │ │ └── results3.yaml │ ├── 408/ │ │ └── badly_named_ruby.yaml │ ├── 420/ │ │ └── results.yaml │ ├── 433/ │ │ └── results.yaml │ ├── 454/ │ │ └── createServer.js.yaml │ ├── 455/ │ │ ├── list.yaml │ │ └── list_align.yaml │ ├── 456/ │ │ ├── XML_no_ext.yaml │ │ └── XML_weird_ext.profile.yaml │ ├── 463/ │ │ └── diff.yaml │ ├── 472/ │ │ └── not_really.lua.yaml │ ├── 476/ │ │ ├── all.yaml │ │ ├── no_cpp.yaml │ │ └── no_fortran.yaml │ ├── 482/ │ │ └── results.yaml │ ├── 494/ │ │ └── results.yaml │ ├── 502/ │ │ └── results.yaml │ ├── 513/ │ │ └── results.yaml │ ├── 520/ │ │ ├── doc_as_code.yaml │ │ └── doc_as_comment.yaml │ ├── 521/ │ │ ├── skip_uniq.yaml │ │ └── uniq.yaml │ ├── 528/ │ │ ├── cutoff_code_10.yaml │ │ ├── cutoff_code_50pct.yaml │ │ └── cutoff_files_1.yaml │ ├── 530/ │ │ ├── case_1.yaml │ │ ├── case_2.yaml │ │ ├── case_3.yaml │ │ ├── case_4.yaml │ │ └── tests.sh │ ├── 537/ │ │ ├── results_force.yaml │ │ └── results_read.yaml │ ├── 538/ │ │ └── add.elm.yaml │ ├── 539/ │ │ └── nested_comments.elm.yaml │ ├── 540/ │ │ └── Hello.f.yaml │ ├── 542/ │ │ └── results.yaml │ ├── 577/ │ │ └── diff_list.yaml │ ├── 579/ │ │ └── csharp-autogen.cs.yaml │ ├── 580/ │ │ └── encodingtest.cs.yaml │ ├── 596/ │ │ └── results.yaml │ ├── 597/ │ │ └── results.yaml │ ├── 599/ │ │ └── results.yaml │ ├── 606/ │ │ └── results.yaml │ ├── 611/ │ │ └── cmakelists.txt.yaml │ ├── 613/ │ │ └── nav.scss.yaml │ ├── 619/ │ │ └── RA.s.yaml │ ├── 625/ │ │ └── results.yaml │ ├── 628/ │ │ └── results.yaml │ ├── 637/ │ │ ├── diff_incl_lang.yaml │ │ └── straight_incl_lang.yaml │ ├── 644/ │ │ └── results.yaml │ ├── 657/ │ │ └── results.yaml │ ├── 670/ │ │ └── results.yaml │ ├── 692/ │ │ └── results.yaml │ ├── 701/ │ │ └── results.yaml │ ├── 708/ │ │ └── results.yaml │ ├── 710/ │ │ └── results.yaml │ ├── 712/ │ │ └── results.yaml │ ├── 713/ │ │ └── results.yaml │ ├── 720/ │ │ └── results.yaml │ ├── 722/ │ │ └── results_1.yaml │ ├── 735/ │ │ └── results.yaml │ ├── 753/ │ │ ├── all.yaml │ │ └── no_autogen.yaml │ ├── 772/ │ │ └── results.yaml │ ├── 781/ │ │ └── results.yaml │ ├── 784/ │ │ └── results.yaml │ ├── 785/ │ │ └── results.yaml │ ├── 804/ │ │ └── infoSQL.java.yaml │ ├── 805/ │ │ └── text_block.java.yaml │ ├── 806/ │ │ └── results.yaml │ ├── 811/ │ │ └── inline_comment.xml.yaml │ ├── 816/ │ │ └── results.yaml │ ├── 822/ │ │ ├── T1.yaml │ │ ├── T2.yaml │ │ ├── T3.yaml │ │ ├── T4.yaml │ │ ├── T5.yaml │ │ ├── T6.yaml │ │ ├── T7.yaml │ │ └── T8.yaml │ ├── 833/ │ │ └── results.yaml │ ├── 851/ │ │ └── results.yaml │ ├── 862/ │ │ ├── diff_results.yaml │ │ └── results.yaml │ ├── 886/ │ │ ├── results.yaml │ │ └── results_by_file.yaml │ ├── 898/ │ │ └── results.yaml │ ├── 906/ │ │ └── results.yaml │ └── 917/ │ └── results.yaml ├── julia.jl.yaml ├── just_stuff.haml.yaml ├── kvlang.kv.yaml ├── layout.dt.yaml ├── linker.ld.yaml ├── locale_facets.h.yaml ├── logos.x.yaml ├── logos.xm.yaml ├── logtalk.lgt.yaml ├── machineDefFreshIds.lem.yaml ├── magikfile.magik.yaml ├── main.f03.yaml ├── master.blade.php.yaml ├── matlab_line_colors.m.yaml ├── md5.rkt.yaml ├── meson.build.yaml ├── messages.rb.yaml ├── mfile.mk.yaml ├── modules1-func1.pp.yaml ├── modules1-func2.pp.yaml ├── modules1-ntp1.pp.yaml ├── modules1-typealias.pp.yaml ├── moonbit.yaml ├── nested.lua.yaml ├── nomad_job.hcl.yaml ├── notes.typ.yaml ├── nu-example.nu.yaml ├── nuon-example.nuon.yaml ├── offline.jcl.yaml ├── openharmony.ets.yaml ├── orgmode.org.yaml ├── page_layout.aspx.yaml ├── pages.wxml.yaml ├── pages.wxss.yaml ├── parser_1.civet.yaml ├── parser_2.civet.yaml ├── pawn.yaml ├── pek_example.pek.yaml ├── ping_pong.lfe.yaml ├── plain_text.txt.yaml ├── plantuml.puml.yaml ├── pointillism.pde.yaml ├── poly_constructor.jai.yaml ├── pop_by_country.xq.yaml ├── prob060-andreoss.p6.yaml ├── proguard-project-app.pro.yaml ├── qsort_demo.m.yaml ├── rand.apl.yaml ├── ranges.surql.yaml ├── razor.cshtml.yaml ├── reStructuredText.rst.yaml ├── reactive.svelte.yaml ├── regex_limit.gradle.yaml ├── ring.pony.1.yaml ├── ring.pony.2.yaml ├── robotframework.robot.yaml ├── robotframework.tsv.yaml ├── roku.brs.yaml ├── rules.sss.yaml ├── sample.R.yaml ├── sample.bicep.yaml ├── sample.ejs.yaml ├── schema.prisma.yaml ├── scheme.sls.yaml ├── script1-hadoop.pig.yaml ├── sdp_parser.jspeg.yaml ├── sdp_parser.peg.yaml ├── sdp_parser.peggy.yaml ├── sdp_parser.pegjs.yaml ├── sdp_parser.tspeg.yaml ├── send_msg.applescript.yaml ├── server_side.aspx.yaml ├── sharpsign.cl.yaml ├── slug.astro.yaml ├── solidity.sol.yaml ├── specman_e.e.yaml ├── specman_e2.e.yaml ├── squirrel_table.nut.yaml ├── stata.do.yaml ├── statcsv.nim.yaml ├── streamlines.pro.yaml ├── string.gleam.yaml ├── style.scss.yaml ├── swig_example.i.yaml ├── temp.c.yaml ├── templ_example.templ.yaml ├── test-1.0-py2.py3-none-win32.whl.yaml ├── test.Dsr.yaml ├── test.Rmd.yaml ├── test.hs.yaml ├── test.rego.yaml ├── test.vbhtml.yaml ├── test.vbs.yaml ├── test1.inc.yaml ├── test1.lhs.yaml ├── test1.php.yaml ├── test2.lhs.yaml ├── test_w_cpp_comments.svelte.yaml ├── tictactoe3d.ring.yaml ├── tnsdl.sdl.yaml ├── toml.pest.yaml ├── toml_example.toml.yaml ├── tour.swift.yaml ├── traffic_light.fsl.yaml ├── type.wast.yaml ├── updateSprites.wgsl.yaml ├── utilities.R.yaml ├── variable_length.carbon.yaml ├── vba_test.vba.yaml ├── vbnet_test.vb.yaml ├── vbox.fxml.yaml ├── verilog.sv.yaml ├── vinos.nlogo.yaml ├── vs_solution.sln.yaml ├── vtl.vm.yaml ├── vyper.vy.yaml ├── warship.ts.yaml ├── webservice.wsdl.yaml ├── wiki.properties.yaml ├── window.blp.yaml ├── with_pod.pl.yaml ├── wokka.cbl.yaml ├── wokka.cs.yaml ├── wpedia.ini.yaml ├── x.mustache.yaml ├── zir_sema.zig.yaml └── zos_assembly.s.yaml ================================================ FILE CONTENTS ================================================ ================================================ FILE: .devcontainer/Dockerfile ================================================ # Original Dockerfile by Sébastien HOUZÉ, https://github.com/shouze # Adapted for use as devcontainer FROM perl:slim AS base RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates \ git \ unzip \ locales \ locales \ exuberant-ctags \ build-essential \ && rm -rf /var/lib/apt/lists/* # Generate locale RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \ locale-gen ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 # Install all dependencies RUN cpanm \ Algorithm::Diff \ Digest::MD5 \ Parallel::ForkManager \ Regexp::Common \ Perl::LanguageServer \ Perl::Tidy \ && rm -rf $HOME/.cpanm ================================================ FILE: .devcontainer/devcontainer.json ================================================ { "build": { "dockerfile": "Dockerfile" }, "extensions": [ "mhutchie.git-graph", "eamodio.gitlens", "richterger.perl", "cfgweb.vscode-perl", "gruntfuggly.todo-tree" ] } ================================================ FILE: .dockerignore ================================================ .github LICENSE README.md ================================================ FILE: .github/FUNDING.yml ================================================ # These are supported funding model platforms github: [AlDanial] ================================================ FILE: .github/ISSUE_TEMPLATE/report-a-bug.md ================================================ --- name: report a bug about: report a bug title: '' labels: '' assignees: '' --- **Describe the bug** A concise description of the problem you found with cloc. **cloc; OS; OS version** - cloc version: - If running the cloc source, Perl version: - OS (eg Linux, Windows, macOS, etc): - OS version: **To Reproduce** Steps one can follow reproduce the behavior you're seeing. **Expected result** A concise description of what you expected to happen. **Additional context** Add any other context about the problem here. ================================================ FILE: .github/ISSUE_TEMPLATE/request-an-enhancement.md ================================================ --- name: request an enhancement about: request support for additional languages or new capabilities title: '' labels: '' assignees: '' --- **If you want an unsupported language added, provide:** - language name: - file extension(s): - method(s) of commenting text: - location of sample code: **For other enhancements:** Give a concise description of what you want cloc to be able to do. ================================================ FILE: .github/workflows/build.yml ================================================ # This workflow will build a container image, # to run all tests (syntax checking + integration tests) on each PR and git push. on: [push, pull_request] name: Run all tests jobs: deploy: name: Deploy runs-on: ubuntu-latest timeout-minutes: 4 steps: - name: Checkout uses: actions/checkout@v1 - name: Run tests id: run-tests env: IMAGE_TAG: ${{ github.sha }} run: | # Build a docker container to run tests docker build . --target test ================================================ FILE: .github/workflows/release-ready.yml ================================================ name: Create release on: pull_request: types: [closed] jobs: create_release: if: ${{ github.event.pull_request.merged == true && startsWith(github.head_ref, 'release-v') }} runs-on: ubuntu-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: ref: "master" - name: Extract version from branch name id: get_version run: | BRANCH="${GITHUB_HEAD_REF:-${GITHUB_REF#refs/heads/}}" if [[ "$BRANCH" =~ release-v([0-9]+\.[0-9]+) ]]; then VERSION="${BASH_REMATCH[1]}" echo "VERSION=$VERSION" >> $GITHUB_OUTPUT echo "DISPLAY_VERSION=v$VERSION" >> $GITHUB_OUTPUT else echo "Branch name does not match expected format (release-vX.XX)!" && exit 1 fi - name: Package repository as tar.gz run: | VER="${{ steps.get_version.outputs.VERSION }}" git archive --format=tar.gz -o cloc-$VER.tar.gz HEAD - name: Get artifact url id: get_artifact_url env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | ARTIFACT_COMMENT=$(gh pr view ${{ github.event.pull_request.number }} --json comments -q ' .comments | sort_by(.createdAt) | reverse | map(select(.body | contains("**Built executable artifact:**"))) | .[0].body ') if [ -z "$ARTIFACT_COMMENT" ]; then echo "No matching comment found." exit 1 fi MATCHING_URLS=$(echo "$ARTIFACT_COMMENT" | grep -oP 'https:\/\/[^\s\)]+') if [ -z "$MATCHING_URLS" ]; then echo "No URL found in the comment." exit 1 fi ARTIFACT_URL=$(echo "$MATCHING_URLS" | head -n 1) RUN_ID=$(echo "$ARTIFACT_URL" | grep -oP '/actions/runs/\K[0-9]+') echo "RUN_ID=$RUN_ID" >> $GITHUB_OUTPUT echo "Artifact URL: $ARTIFACT_URL" - name: Download artifact uses: actions/download-artifact@v4 with: name: cloc-${{ steps.get_version.outputs.VERSION }}-executable github-token: ${{ secrets.GITHUB_TOKEN }} run-id: ${{ steps.get_artifact_url.outputs.RUN_ID }} - name: Prepare renamed release assets run: | VER="${{ steps.get_version.outputs.VERSION }}" cp cloc cloc-$VER.pl cp Unix/NEWS release_notes-$VER.txt - name: Create GitHub release with assets uses: softprops/action-gh-release@v2 with: tag_name: "${{ steps.get_version.outputs.DISPLAY_VERSION }}" name: "${{ steps.get_version.outputs.DISPLAY_VERSION }}" body: "${{ github.event.pull_request.body }}" token: ${{ secrets.GITHUB_TOKEN }} files: | cloc-${{ steps.get_version.outputs.VERSION }}.tar.gz README.md cloc-${{ steps.get_version.outputs.VERSION }}.pl cloc-${{ steps.get_version.outputs.VERSION }}.exe release_notes-${{ steps.get_version.outputs.VERSION }}.txt ================================================ FILE: .github/workflows/release-staging.yml ================================================ name: Build Windows executable on: pull_request: types: [labeled] jobs: staging_build: if: ${{ github.event.label.name == 'release-ready' }} runs-on: windows-latest steps: - name: Checkout repository uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} # Branch name must be in the format "release-vX.XX" - name: Extract version from branch name id: get_version shell: pwsh run: | $branch = "${{ github.head_ref }}" if (-not $branch) { $branch = "${{ github.ref }}" } if ($branch -match 'release-v(?[0-9]+\.[0-9]+)') { $ver = $Matches["ver"] echo "VERSION_NUM=$ver" >> $env:GITHUB_OUTPUT echo "DISPLAY_VERSION=v$ver" >> $env:GITHUB_OUTPUT Write-Host "Extracted version: $ver" } else { Write-Error "Branch name does not match expected format (release-vX.XX)." } - name: Update version in cloc files shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" Write-Host "Updating version in cloc and Unix/cloc to '$ver'" $replaceVer = 'my $VERSION = "' + $ver + '";' (Get-Content cloc) -replace 'my \$VERSION = ".*";', $replaceVer | Set-Content cloc (Get-Content Unix/cloc) -replace 'my \$VERSION = ".*";', $replaceVer | Set-Content Unix/cloc - name: Update README.md with version and date shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" $disp = "${{ steps.get_version.outputs.DISPLAY_VERSION }}" $currentDate = (Get-Date).ToString("MMM. d, yyyy") Write-Host "Updating README.md with version $disp and date $currentDate" (Get-Content README.md) ` -replace 'Latest release:\s+v\d+\.\d+\s+\(.*\)', "Latest release: $disp ($currentDate)" ` -replace 'badge/version-\d+\.\d+', "badge/version-$ver" ` -replace 'cloc-\d+\.\d+\.pl', "cloc-$ver.pl" ` -replace 'cloc-\d+\.\d+\.exe(?!:)', "cloc-$ver.exe" ` -replace 'pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-\d+\.\d+\.exe', "pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-$ver.exe" ` -replace 'cloc-\d+\.\d+\.exe', "cloc-$ver.exe" | Set-Content README.md - name: Install or upgrade Strawberry Perl shell: pwsh run: | if (Get-Command perl -ErrorAction SilentlyContinue) { # see https://github.com/StrawberryPerl/Perl-Dist-Strawberry/issues/19#issuecomment-2401043349 choco uninstall strawberryperl -y } choco install strawberryperl --no-progress -y perl -V cpan -v - name: Install CPAN dependencies shell: pwsh run: | cpan -i App::cpanminus cpanm Digest::MD5 cpanm Regexp::Common cpanm Algorithm::Diff cpanm PAR::Packer cpanm Win32::LongPath || cpanm -n Win32::LongPath - name: Build executable shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o "cloc-$ver.exe" cloc - name: Upload executable to VirusTotal and get analysis URL id: vt_upload shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" $apiKey = "${{ secrets.VIRUSTOTAL_API_KEY }}" $exeFile = "cloc-$ver.exe" $absoluteFilePath = (Get-Location).Path + "\" + $exeFile Write-Host "Uploading $absoluteFilePath to VirusTotal..." $headers=@{} $headers.Add("accept", "application/json") $headers.Add("content-type", "multipart/form-data") $headers.Add("x-apikey", $apiKey) $response = Invoke-RestMethod -Uri "https://www.virustotal.com/api/v3/files" ` -Method POST ` -Headers $headers ` -Form @{ file = Get-Item -Path $absoluteFilePath } $vtAnalysisId = $response.data.id $response2 = Invoke-WebRequest -Uri "https://www.virustotal.com/api/v3/analyses/$vtAnalysisId" -Method GET -Headers $headers $vtId = ($response2.Content | ConvertFrom-Json).data.links.item.Split("/")[-1] $vtUrl = "https://www.virustotal.com/gui/file/$vtId" echo "VT_URL=$vtUrl" >> $env:GITHUB_OUTPUT Write-Host "VirusTotal analysis available at $vtUrl" - name: Upload artifact uses: actions/upload-artifact@v4 id: upload-artifact with: name: cloc-${{ steps.get_version.outputs.VERSION_NUM }}-executable path: cloc-${{ steps.get_version.outputs.VERSION_NUM }}.exe - name: Post comment with artifact and VirusTotal URL uses: peter-evans/create-or-update-comment@v4 with: issue-number: ${{ github.event.pull_request.number }} body: | **Built executable artifact:** [Download the executable artifact from this workflow run](${{ steps.upload-artifact.outputs.artifact-url }}) **VirusTotal Analysis:** ${{ steps.vt_upload.outputs.VT_URL }} - name: Clean up local exe shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" Remove-Item "cloc-$ver.exe" - name: Update README recent versions entry shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" $vtUrl = "${{ steps.vt_upload.outputs.VT_URL }}" $readme = Get-Content README.md -Raw $pattern = 'The entries for recent versions are:\s*\r?\n\s*\r?\n' $replacement = "The entries for recent versions are:`n`ncloc-$ver.exe:`n$vtUrl`n`n" $newReadme = [regex]::Replace($readme, $pattern, $replacement) Set-Content -Path README.md -Value $newReadme (Get-Content README.md -Raw) -replace '\r?\n\s*\r?\n$', "" | Set-Content README.md - name: Update Unix/NEWS with release notes shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" $currentDate = (Get-Date).ToString("MMM. d, yyyy") $event = Get-Content $env:GITHUB_EVENT_PATH -Raw | ConvertFrom-Json $prBody = $event.pull_request.body -replace '"', '`"' $processedNotes = $prBody -replace '- ', ' o ' -replace '[\*\`_]', '' $newsContent = Get-Content Unix/NEWS -Raw -Encoding UTF8 $header = @( " Release Notes for cloc version $ver", " https://github.com/AlDanial/cloc", " $currentDate" ) $newNews = $header + "" + $processedNotes + "" + ("=" * 76) + $newsContent Set-Content -Path Unix/NEWS -Value $newNews -Encoding UTF8 (Get-Content Unix/NEWS -Raw) -replace '\r?\n\s*\r?\n$', "" | Set-Content Unix/NEWS -Encoding UTF8 - name: Commit changes shell: pwsh run: | $ver = "${{ steps.get_version.outputs.VERSION_NUM }}" git config user.name "github-actions" git config user.email "actions@github.com" git add cloc README.md Unix/NEWS Unix/cloc git commit -m "chore: prepare release version $ver" git push ================================================ FILE: .gitignore ================================================ cloc-?.??.* release_notes-?.??.txt # Visual Studio Code and extensions .vstags .vscode/perl-lang .gitmodules Unix/cloc_submodule_test ================================================ FILE: .vscode/launch.json ================================================ { // Further information: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "type": "perl", "request": "launch", "name": "Perl-Debug", "program": "${workspaceFolder}/${relativeFile}", "stopOnEntry": true, "reloadModules": true } ] } ================================================ FILE: Dockerfile ================================================ # Dockerfile by Sébastien HOUZÉ, https://github.com/shouze FROM perl:slim AS builder RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y --no-install-recommends \ dos2unix \ gcc #Install all dependencies RUN cpanm \ Algorithm::Diff \ Digest::MD5 \ Parallel::ForkManager \ Regexp::Common #Copy source code COPY cloc /usr/src/ RUN find /usr/src/ -type f -exec dos2unix {} \; FROM perl:slim AS base RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y --no-install-recommends \ git \ unzip \ && rm -rf /var/lib/apt/lists/* #Copy dependencies and source prepared in base image COPY --from=builder /usr/local/lib/perl5 /usr/local/lib/perl5 COPY --from=builder /usr/src/ /usr/src/ #################### FROM base AS test RUN export DEBIAN_FRONTEND=noninteractive \ && apt-get update \ && apt-get install -y --no-install-recommends \ ca-certificates #Copy test code COPY .git /usr/src/.git COPY tests /usr/src/tests COPY Unix /usr/src/Unix WORKDIR /usr/src/Unix #Checkout of cloc_submodule_test for t/02_git.t tests RUN git clone https://github.com/AlDanial/cloc_submodule_test.git #Run tests RUN make test #################### FROM base AS final WORKDIR /tmp ENTRYPOINT ["/usr/src/cloc"] CMD ["--help"] ================================================ FILE: Dockerfile.build ================================================ FROM alpine:3.11 RUN apk add --no-cache cloc ENTRYPOINT ["cloc"] ================================================ FILE: LICENSE ================================================ GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. {description} Copyright (C) {year} {fullname} This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. {signature of Ty Coon}, 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. ================================================ FILE: README.md ================================================ # cloc *Count Lines of Code* * * * cloc counts blank lines, comment lines, and physical lines of source code in many programming languages. Latest release: v2.08 (Jan. 24, 2026) [![Version](https://img.shields.io/badge/version-2.08-blue.svg)](https://github.com/AlDanial/cloc) [![Contributors](https://img.shields.io/github/contributors/AlDanial/cloc.svg)](https://github.com/AlDanial/cloc/graphs/contributors) [![DOI](https://zenodo.org/badge/doi/10.5281/zenodo.42029482.svg)](https://doi.org/10.5281/zenodo.42029482) [![Forks](https://img.shields.io/github/forks/AlDanial/cloc.svg)](https://github.com/AlDanial/cloc/network/members) [![Downloads](https://img.shields.io/github/downloads/AlDanial/cloc/total.svg)]() cloc moved to GitHub in September 2015 after being hosted at http://cloc.sourceforge.net/ since August 2006. # Quick Start Step 1: Install cloc (see [Install from Github Releases](#install-from-github-releases) and [Install via package manager](#install-via-package-manager)) or run cloc's [docker image](#run-via-docker). The Windows executable has no requirements. The source version of cloc requires a Perl interpreter, and the Docker version of cloc requires a Docker installation. Step 2: Open a terminal (`cmd.exe` on Windows). Step 3: Invoke cloc to count your source files, directories, archives, or git commits. The executable name differs depending on whether you use the development source version (`cloc`), source for a released version (`cloc-2.08.pl`) or a Windows executable (`cloc-2.08.exe`). On this page, `cloc` is the generic term used to refer to any of these. [Include Security](https://www.youtube.com/user/IncludeSecurity) has a [YouTube video](https://www.youtube.com/watch?v=eRLTkDMsCqs) showing the steps in action. **a file** ``` prompt> cloc hello.c 1 text file. 1 unique file. 0 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.04 s (28.3 files/s, 340.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 1 0 7 5 ------------------------------------------------------------------------------- ``` **a directory** ``` prompt> cloc gcc-5.2.0/gcc/c 16 text files. 15 unique files. 3 files ignored. https://github.com/AlDanial/cloc v 1.65 T=0.23 s (57.1 files/s, 188914.0 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- C 10 4680 6621 30812 C/C++ Header 3 99 286 496 ------------------------------------------------------------------------------- SUM: 13 4779 6907 31308 ------------------------------------------------------------------------------- ``` **an archive** We'll pull cloc's source zip file from GitHub, then count the contents: ``` prompt> wget https://github.com/AlDanial/cloc/archive/master.zip prompt> cloc master.zip https://github.com/AlDanial/cloc v 1.65 T=0.07 s (26.8 files/s, 141370.3 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Perl 2 725 1103 8713 ------------------------------------------------------------------------------- SUM: 2 725 1103 8713 ------------------------------------------------------------------------------- ``` **a git repository, using a specific commit** This example uses code from PuDB, a fantastic Python debugger. ``` prompt> git clone https://github.com/inducer/pudb.git prompt> cd pudb prompt> cloc 6be804e07a5db 48 text files. 41 unique files. 8 files ignored. github.com/AlDanial/cloc v 1.99 T=0.04 s (1054.9 files/s, 189646.8 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Python 28 1519 728 4659 reStructuredText 6 102 20 203 YAML 2 9 2 75 Bourne Shell 3 6 0 17 Text 1 0 0 11 make 1 4 6 10 ------------------------------------------------------------------------------- SUM: 41 1640 756 4975 ------------------------------------------------------------------------------- ``` **each subdirectory of a particular directory** Say you have a directory with three different git-managed projects, Project0, Project1, and Project2. You can use your shell's looping capability to count the code in each. This example uses bash (scroll down for cmd.exe example): ``` prompt> for d in ./*/ ; do (cd "$d" && echo "$d" && cloc --vcs git); done ./Project0/ 7 text files. 7 unique files. 1 file ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (390.2 files/s, 25687.6 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- D 4 61 32 251 Markdown 1 9 0 38 make 1 0 0 4 ------------------------------------------------------------------------------- SUM: 6 70 32 293 ------------------------------------------------------------------------------- ./Project1/ 7 text files. 7 unique files. 0 files ignored. github.com/AlDanial/cloc v 1.71 T=0.02 s (293.0 files/s, 52107.1 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Go 7 165 282 798 ------------------------------------------------------------------------------- SUM: 7 165 282 798 ------------------------------------------------------------------------------- ./Project2/ 49 text files. 47 unique files. 13 files ignored. github.com/AlDanial/cloc v 1.71 T=0.10 s (399.5 files/s, 70409.4 lines/s) ------------------------------------------------------------------------------- Language files blank comment code ------------------------------------------------------------------------------- Python 33 1226 1026 3017 C 4 327 337 888 Markdown 1 11 0 28 YAML 1 0 2 12 ------------------------------------------------------------------------------- SUM: 39 1564 1365 3945 ------------------------------------------------------------------------------- ``` **each subdirectory of a particular directory (Windows/cmd.exe)** ``` for /D %I in (.\*) do cd %I && cloc --vcs git && cd .. ``` # Overview cloc counts blank lines, comment lines, and physical lines of source code in [many programming languages](#recognized-languages). Given two versions of a code base, cloc can compute differences in blank, comment, and source lines. It is written entirely in Perl with no dependencies outside the standard distribution of Perl v5.6 and higher (code from some external modules is [embedded within cloc](https://github.com/AlDanial/cloc#regexp_common)) and so is quite portable. cloc is known to run on many flavors of Linux, FreeBSD, NetBSD, OpenBSD, macOS, AIX, HP-UX, Solaris, IRIX, z/OS, and Windows. (To run the Perl source version of cloc on Windows one needs [ActiveState Perl](http://www.activestate.com/activeperl) 5.6.1 or higher, [Strawberry Perl](http://strawberryperl.com/), Windows Subsystem for Linux, [Cygwin](http://www.cygwin.com/), [MobaXTerm](http://mobaxterm.mobatek.net/) with the Perl plug-in installed, or a mingw environment and terminal such as provided by [Git for Windows](https://gitforwindows.org/). Alternatively one can use the Windows binary of cloc generated with [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.019/lib/pp.pm) to run on Windows computers that have neither Perl nor Cygwin.) In addition to counting code in individual text files, directories, and git repositories, cloc can also count code in archive files such as ``.tar`` (including compressed versions), ``.zip``, Python wheel ``.whl``, Jupyter notebook ``.ipynb``, source RPMs ``.rpm`` or ``.src`` (requires ``rpm2cpio``), and Debian ``.deb`` files (requires ``dpkg-deb``). cloc contains code from David Wheeler's [SLOCCount](http://www.dwheeler.com/sloccount/), Damian Conway and Abigail's Perl module [Regexp::Common](http://search.cpan.org/%7Eabigail/Regexp-Common-2.120/lib/Regexp/Common.pm), Sean M. Burke's Perl module [Win32::Autoglob](http://search.cpan.org/%7Esburke/Win32-Autoglob-1.01/Autoglob.pm), and Tye McQueen's Perl module [Algorithm::Diff](http://search.cpan.org/%7Etyemq/Algorithm-Diff-1.1902/lib/Algorithm/Diff.pm). Language scale factors were derived from Mayes Consulting, LLC web site http://softwareestimator.com/IndustryData2.htm. New releases nominally appear every six months. ## Install from Github Releases Grab the latest release of cloc from the [Releases section of this repository](https://github.com/AlDanial/cloc/releases). ### Source version on Linux/macOS Save the latest source file, for example `cloc-2.08.pl`, as `cloc` (if you prefer the shorter command name) somewhere on your `PATH`. After downloading, make the file executable: ```shell cd ~/Downloads mv cloc-2.08.pl cloc chmod a+rx cloc ./cloc --version # make sure it runs mv cloc ~/bin # for example, if ~/bin is in $PATH ``` ### Source version on Windows You'll need a Perl interpreter such as [Strawberry Perl](http://strawberryperl.com/) installed to run the source version of cloc. After downloading the cloc source file, open a command prompt or PowerShell window, navigate to the download directory (`C:\TEMP` in the example below), then test cloc with: ```dos cd C:\TEMP> C:TEMP\> perl cloc-2.08.pl --version ``` ### Binary version on Windows Download the latest released Windows executable, for example `cloc-2.08.exe` and save it as `cloc.exe` (if desired) in a directory on your `PATH`. There is no binary version for Linux or macOS. ## Install via package manager Depending your operating system, one of these installation methods may work for you (all but the last two entries for Windows require a Perl interpreter): npm install -g cloc # https://www.npmjs.com/package/cloc sudo apt install cloc # Debian, Ubuntu sudo yum install cloc # Red Hat, Fedora sudo dnf install cloc # Fedora 22 or later sudo pacman -S cloc # Arch yay -S cloc-git # Arch AUR (latest git version) sudo emerge -av dev-util/cloc # Gentoo https://packages.gentoo.org/packages/dev-util/cloc sudo apk add cloc # Alpine Linux doas pkg_add cloc # OpenBSD sudo pkg install cloc # FreeBSD sudo port install cloc # macOS with MacPorts brew install cloc # macOS with Homebrew winget install AlDanial.Cloc # Windows with winget (might not work, ref https://github.com/AlDanial/cloc/issues/849) choco install cloc # Windows with Chocolatey scoop install cloc # Windows with Scoop **Note**: I don't control any of these packages. If you encounter a bug in cloc using one of the above packages, try with cloc pulled from the latest stable release here on GitHub (link follows below) before submitting a problem report. ## Run via docker These docker commands count lines of code in and below the current directory: ```shell docker run --rm -v $PWD:/tmp aldanial/cloc . ``` ### Run via docker on git-bash ```shell docker run --rm -v "/$(pwd -W)":/tmp aldanial/cloc . ``` ## Development version Download the cloc source code at https://github.com/AlDanial/cloc/raw/master/cloc and save it as the file `cloc` (or `cloc.pl`, or whatever executable name you wish). The next step depends on the operating system you're using. # License cloc is licensed under the [GNU General Public License, v 2](http://www.gnu.org/licenses/gpl-2.0.html), excluding portions which are copied from other sources. Code copied from the Regexp::Common, Win32::Autoglob, and Algorithm::Diff Perl modules is subject to the [Artistic License](https://opensource.org/license/artistic-2-0). # Why Use cloc? cloc has many features that make it easy to use, thorough, extensible, and portable: 1. Exists as a single, self-contained file that requires minimal installation effort---just download the file and run it. 2. Can read language comment definitions from a file and thus potentially work with computer languages that do not yet exist. 3. Allows results from multiple runs to be summed together by language and by project. 4. Can produce results in a variety of formats: plain text, Markdown, SQL, JSON, XML, YAML, comma separated values. 5. Can count code within compressed archives (tar balls, Zip files, Java .ear files). 6. Has numerous troubleshooting options. 7. Handles file and directory names with spaces and other unusual characters. 8. Has no dependencies outside the standard Perl distribution. 9. Runs on Linux, FreeBSD, NetBSD, OpenBSD, macOS, AIX, HP-UX, Solaris, IRIX, and z/OS systems that have Perl 5.6 or higher. The source version runs on Windows with either ActiveState Perl, Strawberry Perl, Cygwin, or MobaXTerm+Perl plugin. Alternatively on Windows one can run the Windows binary which has no dependencies. # Other Counters If cloc does not suit your needs here are other freely available counters to consider: * [loc](https://github.com/cgag/loc/) * [gcloc](https://github.com/JoaoDanielRufino/gcloc) * [gocloc](https://github.com/hhatto/gocloc/) * [Ohcount](https://github.com/blackducksoftware/ohcount/) * [scc](https://github.com/boyter/scc/) * [sclc](https://code.google.com/archive/p/sclc/) * [SLOCCount](http://www.dwheeler.com/sloccount/) * [Sonar](http://www.sonarsource.org/) * [tokei](https://github.com/Aaronepower/tokei/) * [Unified Code Count](http://csse.usc.edu/ucc_new/wordpress/) Other references: * QSM's [directory](http://www.qsm.com/CodeCounters.html) of code counting tools. * The [Wikipedia entry](http://en.wikipedia.org/wiki/Source_lines_of_code) for source code line counts. # Regexp::Common, Digest::MD5, Win32::Autoglob, Algorithm::Diff Although cloc does not need Perl modules outside those found in the standard distribution, cloc does rely on a few external modules. Code from three of these external modules--Regexp::Common, Win32::Autoglob, and Algorithm::Diff--is embedded within cloc. A fourth module, Digest::MD5, is used only if it is available. If cloc finds Regexp::Common or Algorithm::Diff installed locally it will use those installation. If it doesn't, cloc will install the parts of Regexp::Common and/or Algorithm:Diff it needs to temporary directories that are created at the start of a cloc run then removed when the run is complete. The necessary code from Regexp::Common v2.120 and Algorithm::Diff v1.1902 are embedded within the cloc source code (see subroutines `Install_Regexp_Common()` and `Install_Algorithm_Diff()` ). Only three lines are needed from Win32::Autoglob and these are included directly in cloc. Additionally, cloc will use Digest::MD5 to validate uniqueness among equally-sized input files if Digest::MD5 is installed locally. A parallel processing option, `--processes=*N*`, was introduced with cloc version 1.76 to enable faster runs on multi-core machines. However, to use it, one must have the module Parallel::ForkManager installed. This module does not work reliably on Windows so parallel processing will only work on Unix-like operating systems. The Windows binary is built on a computer that has both Regexp::Common and Digest::MD5 installed locally. # Building a Windows Executable #### Create your own executable The most robust option for creating a Windows executable of cloc is to use [ActiveState's Perl Development Kit](http://www.activestate.com/perl-dev-kit). It includes a utility, `perlapp`, which can build stand-alone Windows, Mac, and Linux binaries of Perl source code. [perl2exe](http://www.indigostar.com/perl2exe/) will also do the trick. If you do have `perl2exe`, modify lines 84-87 in the cloc source code for a minor code modification that is necessary to make a cloc Windows executable. Otherwise, to build a Windows executable with `pp` from `PAR::Packer`, first install a Windows-based Perl distribution (for example Strawberry Perl or ActivePerl) following their instructions. Next, open a command prompt, aka a DOS window and install the PAR::Packer module. Finally, invoke the newly installed `pp` command with the cloc source code to create an `.exe` file: ``` C:> cpan -i Digest::MD5 C:> cpan -i Regexp::Common C:> cpan -i Algorithm::Diff C:> cpan -i PAR::Packer C:> cpan -i Win32::LongPath C:> pp -M Win32::LongPath -M Encode::Unicode -M Digest::MD5 -c -x -o cloc-2.08.exe cloc-2.08.pl ``` A variation on the instructions above is if you installed the portable version of Strawberry Perl, you will need to run `portableshell.bat` first to properly set up your environment. The Windows executable in the Releases section, `cloc-2.08.exe`, was built on a 64 bit Windows 11 computer using [Strawberry Perl](http://strawberryperl.com/) 5.32.1 and [PAR::Packer](http://search.cpan.org/~rschupp/PAR-Packer-1.064/lib/pp.pm) to build the `.exe`. #### Is the Windows executable safe to run? Does it have malware? Ideally, no one would need the Windows executable because they have a Perl interpreter installed on their machines and can run the cloc source file. On centrally-managed corporate Windows machines, however, this this may be difficult or impossible. The Windows executable distributed with cloc is provided as a best-effort of a virus and malware-free `.exe`. You are encouraged to run your own virus scanners against the executable and also check sites such https://www.virustotal.com/ . The entries for recent versions are: cloc-2.08.exe: https://www.virustotal.com/gui/file/4529557d957ade0dd45746eae10e9c51ee01061bb617eeeab256672faf6e42c6?nocache=1 cloc-2.06.exe: https://www.virustotal.com/gui/file/bbe48de9102d0f2520d292d65897001c1d068340eb7cd74dd1ee30c1a9091c4a?nocache=1 cloc-2.04.exe: https://www.virustotal.com/gui/file/89cda0038bf4e13c6c13ebc1e60bec4dfad362e69ac8a5b8e2d5ebe3020359e1 cloc-2.02-winget.exe: (includes [PR 850](https://github.com/AlDanial/cloc/pull/850) to allow [running from a symlink on Windows](https://github.com/AlDanial/cloc/issues/849)) https://www.virustotal.com/gui/file/be033061e091fea48a5bc9e8964cee0416ddd5b34bd5226a1c9aa4b30bdba66a?nocache=1 cloc-2.02.exe: https://www.virustotal.com/gui/file/369ed76125f7399cd582d169adf39a2e08ae5066031fea0cc8b2836ea50e7ce2?nocache=1 cloc-2.00.exe: https://www.virustotal.com/gui/file/7a234ef0cb495de1b5776acf88c5554e2bab1fb02725a5fb85756a6db3121c1f #### Why is the Windows executable so large? Windows executables of cloc versions 1.60 and earlier, created with perl2exe as noted above, are about 1.6 MB, while versions 1.62 and 1.54, created with `PAR::Packer`, are 11 MB. Version 1.66, built with a newer version of `PAR::Packer`, is about 5.5 MB. Why are the `PAR::Packer`, executables so much larger than those built with perl2exe? My theory is that perl2exe uses smarter tree pruning logic than `PAR::Packer`, but that's pure speculation. # Basic Use cloc is a command line program that takes file, directory, and/or archive names as inputs. Here's an example of running cloc against the Perl v5.22.0 source distribution: ``` prompt> cloc perl-5.22.0.tar.gz 5605 text files. 5386 unique files. 2176 files ignored. https://github.com/AlDanial/cloc v 1.65 T=25.49 s (134.7 files/s, 51980.3 lines/s) ----------------------------------------------------------------------------------- Language files blank comment code ----------------------------------------------------------------------------------- Perl 2892 136396 184362 536445 C 130 24676 33684 155648 C/C++ Header 148 9766 16569 147858 Bourne Shell 112 4044 6796 42668 Pascal 8 458 1603 8592 XML 33 142 0 2410 YAML 49 20 15 2078 C++ 10 313 277 2033 make 4 426 488 1986 Prolog 12 438 2 1146 JSON 14 1 0 1037 yacc 1 85 76 998 Windows Message File 1 102 11 489 DOS Batch 14 92 41 389 Windows Resource File 3 10 0 85 D 1 5 7 8 Lisp 2 0 3 4 ----------------------------------------------------------------------------------- SUM: 3434 176974 243934 903874 ----------------------------------------------------------------------------------- ``` To run cloc on Windows computers, open up a command (aka DOS) window and invoke cloc.exe from the command line there. Alternatively, try ClocViewer, the GUI wrapper around cloc found at https://github.com/Roemer/ClocViewer. See also https://github.com/jmensch1/codeflower for a graphical rendering of cloc results. # GUI Frontends Several GUI frontends to cloc are available: * [cloctui](https://github.com/edward-jazzhands/cloctui) * [ClocViewer](https://github.com/Roemer/ClocViewer) * [codeflower](https://github.com/jmensch1/codeflower) # Options
Full options list (cloc --help) (click the triangle to see all option) ``` prompt> cloc --help Usage: cloc [options] | | Count, or compute differences of, physical lines of source code in the given files (may be archives such as compressed tarballs or zip files, or git commit hashes or branch names) and/or recursively below the given directories. Input Options --extract-with= This option is only needed if cloc is unable to figure out how to extract the contents of the input file(s) by itself. Use to extract binary archive files (e.g.: .tar.gz, .zip, .Z). Use the literal '>FILE<' as a stand-in for the actual file(s) to be extracted. For example, to count lines of code in the input files gcc-4.2.tar.gz perl-5.8.8.tar.gz on Unix use --extract-with='gzip -dc >FILE< | tar xf -' or, if you have GNU tar, --extract-with='tar zxf >FILE<' and on Windows use, for example: --extract-with="\"c:\Program Files\WinZip\WinZip32.exe\" -e -o >FILE< ." (if WinZip is installed there). --list-file= Take the list of file and/or directory names to process from , which has one file/directory name per line. Only exact matches are counted; relative path names will be resolved starting from the directory where cloc is invoked. Set to - to read file names from a STDIN pipe. See also --exclude-list-file. --diff-list-file= Take the pairs of file names to be diff'ed from , whose format matches the output of --diff-alignment. (Run with that option to see a sample.) The language identifier at the end of each line is ignored. This enables --diff mode and bypasses file pair alignment logic. --vcs= Invoke a system call to to obtain a list of files to work on. If is 'git', then will invoke 'git ls-files' to get a file list and 'git submodule status' to get a list of submodules whose contents will be ignored. See also --git which accepts git commit hashes and branch names. If is 'svn' then will invoke 'svn list -R'. The primary benefit is that cloc will then skip files explicitly excluded by the versioning tool in question, ie, those in .gitignore or have the svn:ignore property. Alternatively may be any system command that generates a list of files. Note: cloc must be in a directory which can read the files as they are returned by . cloc will not download files from remote repositories. 'svn list -R' may refer to a remote repository to obtain file names (and therefore may require authentication to the remote repository), but the files themselves must be local. Setting to 'auto' selects between 'git' and 'svn' (or neither) depending on the presence of a .git or .svn subdirectory below the directory where cloc is invoked. --files-from is a synonym for --vcs. --unicode Check binary files to see if they contain Unicode expanded ASCII text. This causes performance to drop noticeably. Processing Options --autoconf Count .in files (as processed by GNU autoconf) of recognized languages. See also --no-autogen. --by-file Report results for every source file encountered. --by-file-by-lang Report results for every source file encountered in addition to reporting by language. --config Read command line switches from instead of the default location of /home/al/.config/cloc/options.txt. The file should contain one switch, along with arguments (if any), per line. Blank lines and lines beginning with '#' are skipped. Options given on the command line take priority over entries read from the file. --count-and-diff First perform direct code counts of source file(s) of and separately, then perform a diff of these. Inputs may be pairs of files, directories, or archives. If --out or --report-file is given, three output files will be created, one for each of the two counts and one for the diff. See also --diff, --diff-alignment, --diff-timeout, --ignore-case, --ignore-whitespace. --diff Compute differences in code and comments between source file(s) of and . The inputs may be any mix of files, directories, archives, or git commit hashes. Use --diff-alignment to generate a list showing which file pairs where compared. When comparing git branches, only files which have changed in either commit are compared. See also --git, --count-and-diff, --diff-alignment, --diff-list-file, --diff-timeout, --ignore-case, --ignore-whitespace. --diff-timeout Ignore files which take more than seconds to process. Default is 10 seconds. Setting to 0 allows unlimited time. (Large files with many repeated lines can cause Algorithm::Diff::sdiff() to take hours.) See also --timeout. --docstring-as-code cloc considers docstrings to be comments, but this is not always correct as docstrings represent regular strings when they appear on the right hand side of an assignment or as function arguments. This switch forces docstrings to be counted as code. --follow-links [Unix only] Follow symbolic links to directories (sym links to files are always followed). See also --stat. --force-lang=[,] Process all files that have a extension with the counter for language . For example, to count all .f files with the Fortran 90 counter (which expects files to end with .f90) instead of the default Fortran 77 counter, use --force-lang="Fortran 90,f" If is omitted, every file will be counted with the counter. This option can be specified multiple times (but that is only useful when is given each time). See also --script-lang, --lang-no-ext. --force-lang-def= Load language processing filters from , then use these filters instead of the built-in filters. Note: languages which map to the same file extension (for example: MATLAB/Mathematica/Objective-C/MUMPS/Mercury; Pascal/PHP; Lisp/OpenCL; Lisp/Julia; Perl/Prolog) will be ignored as these require additional processing that is not expressed in language definition files. Use --read-lang-def to define new language filters without replacing built-in filters (see also --write-lang-def, --write-lang-def-incl-dup). --git Forces the inputs to be interpreted as git targets (commit hashes, branch names, et cetera) if these are not first identified as file or directory names. This option overrides the --vcs=git logic if this is given; in other words, --git gets its list of files to work on directly from git using the hash or branch name rather than from 'git ls-files'. This option can be used with --diff to perform line count diffs between git commits, or between a git commit and a file, directory, or archive. Use -v/--verbose to see the git system commands cloc issues. --git-diff-rel Same as --git --diff, or just --diff if the inputs are recognized as git targets. Only files which have changed in either commit are compared. --git-diff-all Git diff strategy #2: compare all files in the repository between the two commits. --ignore-whitespace Ignore horizontal white space when comparing files with --diff. See also --ignore-case. --ignore-case Ignore changes in case within file contents; consider upper- and lowercase letters equivalent when comparing files with --diff. See also --ignore-whitespace. --ignore-case-ext Ignore case of file name extensions. This will cause problems counting some languages (specifically, .c and .C are associated with C and C++; this switch would count .C files as C rather than C++ on *nix operating systems). File name case insensitivity is always true on Windows. --lang-no-ext= Count files without extensions using the counter. This option overrides internal logic for files without extensions (where such files are checked against known scripting languages by examining the first line for #!). See also --force-lang, --script-lang. --max-file-size= Skip files larger than megabytes when traversing directories. By default, =100. cloc's memory requirement is roughly twenty times larger than the largest file so running with files larger than 100 MB on a computer with less than 2 GB of memory will cause problems. Note: this check does not apply to files explicitly passed as command line arguments. --no-autogen[=list] Ignore files generated by code-production systems such as GNU autoconf. To see a list of these files (then exit), run with --no-autogen list See also --autoconf. --original-dir [Only effective in combination with --strip-comments] Write the stripped files to the same directory as the original files. --read-binary-files Process binary files in addition to text files. This is usually a bad idea and should only be attempted with text files that have embedded binary data. --read-lang-def= Load new language processing filters from and merge them with those already known to cloc. If defines a language cloc already knows about, cloc's definition will take precedence. Use --force-lang-def to over-ride cloc's definitions (see also --write-lang-def, --write-lang-def-incl-dup). --script-lang=, Process all files that invoke as a #! scripting language with the counter for language . For example, files that begin with #!/usr/local/bin/perl5.8.8 will be counted with the Perl counter by using --script-lang=Perl,perl5.8.8 The language name is case insensitive but the name of the script language executable, , must have the right case. This option can be specified multiple times. See also --force-lang, --lang-no-ext. --sdir= Use as the scratch directory instead of letting File::Temp chose the location. Files written to this location are not removed at the end of the run (as they are with File::Temp). --skip-uniqueness Skip the file uniqueness check. This will give a performance boost at the expense of counting files with identical contents multiple times (if such duplicates exist). --stat Some file systems (AFS, CD-ROM, FAT, HPFS, SMB) do not have directory 'nlink' counts that match the number of its subdirectories. Consequently cloc may undercount or completely skip the contents of such file systems. This switch forces File::Find to stat directories to obtain the correct count. File search speed will decrease. See also --follow-links. --stdin-name= Give a file name to use to determine the language for standard input. (Use - as the input name to receive source code via STDIN.) --strip-comments= For each file processed, write to the current directory a version of the file which has blank and commented lines removed (in-line comments persist). The name of each stripped file is the original file name with . appended to it. It is written to the current directory unless --original-dir is on. --strip-str-comments Replace comment markers embedded in strings with 'xx'. This attempts to work around a limitation in Regexp::Common::Comment where comment markers embedded in strings are seen as actual comment markers and not strings, often resulting in a 'Complex regular subexpression recursion limit' warning and incorrect counts. There are two disadvantages to using this switch: 1/code count performance drops, and 2/code generated with --strip-comments will contain different strings where ever embedded comments are found. --sum-reports Input arguments are report files previously created with the --report-file option in plain format (eg. not JSON, YAML, XML, or SQL). Makes a cumulative set of results containing the sum of data from the individual report files. --timeout Ignore files which take more than seconds to process at any of the language's filter stages. The default maximum number of seconds spent on a filter stage is the number of lines in the file divided by one thousand. Setting to 0 allows unlimited time. See also --diff-timeout. --processes=NUM [Available only on systems with a recent version of the Parallel::ForkManager module. Not available on Windows.] Sets the maximum number of cores that cloc uses. The default value of 0 disables multiprocessing. --unix Override the operating system autodetection logic and run in UNIX mode. See also --windows, --show-os. --use-sloccount If SLOCCount is installed, use its compiled executables c_count, java_count, pascal_count, php_count, and xml_count instead of cloc's counters. SLOCCount's compiled counters are substantially faster than cloc's and may give a performance improvement when counting projects with large files. However, these cloc-specific features will not be available: --diff, --count-and-diff, --strip-comments, --unicode. --windows Override the operating system autodetection logic and run in Microsoft Windows mode. See also --unix, --show-os. Filter Options --include-content= Only count files containing text that matches the given regular expression. --exclude-content= Exclude files containing text that matches the given regular expression. --exclude-dir=[,D2,] Exclude the given comma separated directories D1, D2, D3, et cetera, from being scanned. For example --exclude-dir=.cache,test will skip all files and subdirectories that have /.cache/ or /test/ as their parent directory. Directories named .bzr, .cvs, .hg, .git, .svn, and .snapshot are always excluded. This option only works with individual directory names so including file path separators is not allowed. Use --fullpath and --not-match-d= to supply a regex matching multiple subdirectories. --exclude-ext=[,[...]] Do not count files having the given file name extensions. --exclude-lang=[,L2[...]] Exclude the given comma separated languages L1, L2, L3, et cetera, from being counted. --exclude-list-file= Ignore files and/or directories whose names appear in . should have one file name per line. Only exact matches are ignored; relative path names will be resolved starting from the directory where cloc is invoked. See also --list-file. --fullpath Modifies the behavior of --match-f, --not-match-f, and --not-match-d to include the file's path in the regex, not just the file's basename. (This does not expand each file to include its absolute path, instead it uses as much of the path as is passed in to cloc.) Note: --match-d always looks at the full path and therefore is unaffected by --fullpath. --include-ext=[,ext2[...]] Count only languages having the given comma separated file extensions. Use --show-ext to see the recognized extensions. --include-lang=[,L2[...]] Count only the given comma separated languages L1, L2, L3, et cetera. Use --show-lang to see the list of recognized languages. --match-d= Only count files in directories matching the Perl regex. For example --match-d='/(src|include)/' only counts files in directories containing /src/ or /include/. Unlike --not-match-d, --match-f, and --not-match-f, --match-d always compares the fully qualified path against the regex. --not-match-d= Count all files except those in directories matching the Perl regex. Only the trailing directory name is compared, for example, when counting in /usr/local/lib, only 'lib' is compared to the regex. Add --fullpath to compare parent directories to the regex. Do not include file path separators at the beginning or end of the regex. --match-f= Only count files whose basenames match the Perl regex. For example --match-f='^[Ww]idget' only counts files that start with Widget or widget. Add --fullpath to include parent directories in the regex instead of just the basename. --not-match-f= Count all files except those whose basenames match the Perl regex. Add --fullpath to include parent directories in the regex instead of just the basename. --skip-archive= Ignore files that end with the given Perl regular expression. For example, if given --skip-archive='(zip|tar(.(gz|Z|bz2|xz|7z))?)' the code will skip files that end with .zip, .tar, .tar.gz, .tar.Z, .tar.bz2, .tar.xz, and .tar.7z. --skip-win-hidden On Windows, ignore hidden files. Debug Options --categorized= Save file sizes in bytes, identified languages and names of categorized files to . --counted= Save names of processed source files to . --diff-alignment= Write to a list of files and file pairs showing which files were added, removed, and/or compared during a run with --diff. This switch forces the --diff mode on. --explain= Print the filters used to remove comments for language and exit. In some cases the filters refer to Perl subroutines rather than regular expressions. An examination of the source code may be needed for further explanation. --help Print this usage information and exit. --found= Save names of every file found to . --ignored= Save names of ignored files and the reason they were ignored to . --print-filter-stages Print processed source code before and after each filter is applied. --show-ext[=] Print information about all known (or just the given) file extensions and exit. --show-lang[=] Print information about all known (or just the given) languages and exit. --show-os Print the value of the operating system mode and exit. See also --unix, --windows. -v[=] Verbose switch (optional numeric value). -verbose[=] Long form of -v. --version Print the version of this program and exit. --write-lang-def= Writes to the language processing filters then exits. Useful as a first step to creating custom language definitions. Note: languages which map to the same file extension will be excluded. (See also --force-lang-def, --read-lang-def). --write-lang-def-incl-dup= Same as --write-lang-def, but includes duplicated extensions. This generates a problematic language definition file because cloc will refuse to use it until duplicates are removed. Output Options --3 Print third-generation language output. (This option can cause report summation to fail if some reports were produced with this option while others were produced without it.) --by-percent X Instead of comment and blank line counts, show these values as percentages based on the value of X in the denominator: X = 'c' -> # lines of code X = 'cm' -> # lines of code + comments X = 'cb' -> # lines of code + blanks X = 'cmb' -> # lines of code + comments + blanks For example, if using method 'c' and your code has twice as many lines of comments as lines of code, the value in the comment column will be 200%. The code column remains a line count. --csv Write the results as comma separated values. --csv-delimiter= Use the character as the delimiter for comma separated files instead of ,. This switch forces --csv to be on. --file-encoding= Write output files using the encoding instead of the default ASCII ( = 'UTF-7'). Examples: 'UTF-16', 'euc-kr', 'iso-8859-16'. Known encodings can be printed with perl -MEncode -e 'print join("\n", Encode->encodings(":all")), "\n"' --hide-rate Do not show line and file processing rates in the output header. This makes output deterministic. --json Write the results as JavaScript Object Notation (JSON) formatted output. --md Write the results as Markdown-formatted text. --out= Synonym for --report-file=. --percent Show counts as percentages of sums for each column. Same as '--by-percent t'. --progress-rate= Show progress update after every files are processed (default =100). Set to 0 to suppress progress output (useful when redirecting output to STDOUT). --quiet Suppress all information messages except for the final report. --report-file= Write the results to instead of STDOUT. --sql= Write results as SQL create and insert statements which can be read by a database program such as SQLite. If is -, output is sent to STDOUT. --sql-append Append SQL insert statements to the file specified by --sql and do not generate table creation statements. Only valid with the --sql option. --sql-project= Use as the project identifier for the current run. Only valid with the --sql option. --sql-style=

';
    print "<- html_header\n" if $opt_v > 2;
} # 1}}}
sub html_end {                               # {{{1
return
'
'; } # 1}}} sub die_unknown_lang { # {{{1 my ($lang, $option_name) = @_; die "Unknown language '$lang' used with $option_name option. " . "The command\n $script --show-lang\n" . "will print all recognized languages. Language names are " . "case sensitive.\n" ; } # 1}}} sub unicode_file { # {{{1 my $file = shift @_; print "-> unicode_file($file)\n" if $opt_v > 2; return 0 if (get_size($file) > 2_000_000); # don't bother trying to test binary files bigger than 2 MB my $IN = open_file('<', $file, 1); if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; return 0; } my @lines = <$IN>; $IN->close; if (unicode_to_ascii( join('', @lines) )) { print "<- unicode_file()\n" if $opt_v > 2; return 1; } else { print "<- unicode_file()\n" if $opt_v > 2; return 0; } } # 1}}} sub unicode_to_ascii { # {{{1 my $string = shift @_; # A trivial attempt to convert UTF-16 little or big endian # files into ASCII. These files exhibit the following byte # sequence: # byte 1: 255 # byte 2: 254 # byte 3: ord of ASCII character # byte 4: 0 # byte 3+i: ord of ASCII character # byte 4+i: 0 # or # byte 1: 255 # byte 2: 254 # byte 3: 0 # byte 4: ord of ASCII character # byte 3+i: 0 # byte 4+i: ord of ASCII character # print "-> unicode_to_ascii()\n" if $opt_v > 2; my $length = length $string; #print "length=$length\n"; return '' if $length <= 3; my @unicode = split(//, $string); # check the first 100 characters (= 200 bytes) for big or # little endian UTF-16 encoding my $max_peek = $length < 200 ? $length : 200; my $max_for_pass = $length < 200 ? 0.9*$max_peek/2 : 90; my @view_1 = (); for (my $i = 2; $i < $max_peek; $i += 2) { push @view_1, $unicode[$i] } my @view_2 = (); for (my $i = 3; $i < $max_peek; $i += 2) { push @view_2, $unicode[$i] } my $points_1 = 0; foreach my $C (@view_1) { ++$points_1 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 or ord($C) == 10 or ord($C) == 9; } my $points_2 = 0; foreach my $C (@view_2) { ++$points_2 if (32 <= ord($C) and ord($C) <= 127) or ord($C) == 13 or ord($C) == 10 or ord($C) == 9; } #print "points 1: $points_1\n"; #print "points 2: $points_2\n"; #print "max_peek : $max_peek\n"; #print "max_for_pass: $max_for_pass\n"; my $offset = undef; if ($points_1 > $max_for_pass) { $offset = 2; } elsif ($points_2 > $max_for_pass) { $offset = 3; } else { print "<- unicode_to_ascii() a p1=$points_1 p2=$points_2\n" if $opt_v > 2; return ''; } # neither big or little endian UTF-16 my @ascii = (); for (my $i = $offset; $i < $length; $i += 2) { # some compound characters are made of HT (9), LF (10), or CR (13) # True HT, LF, CR are followed by 00; only add those. my $L = $unicode[$i]; if (ord($L) == 9 or ord($L) == 10 or ord($L) == 13) { my $companion; if ($points_1) { last if $i+1 >= $length; $companion = $unicode[$i+1]; } else { $companion = $unicode[$i-1]; } if (ord($companion) == 0) { push @ascii, $L; } else { push @ascii, " "; # no clue what this letter is } } else { push @ascii, $L; } } print "<- unicode_to_ascii() b p1=$points_1 p2=$points_2\n" if $opt_v > 2; return join("", @ascii); } # 1}}} sub uncompress_archive_cmd { # {{{1 my ($archive_file, ) = @_; # Wrap $archive_file in single or double quotes in the system # commands below to avoid filename chicanery (including # spaces in the names). print "-> uncompress_archive_cmd($archive_file)\n" if $opt_v > 2; my $extract_cmd = ""; my $missing = ""; if ($opt_extract_with) { ( $extract_cmd = $opt_extract_with ) =~ s/>FILE -"; } elsif ($archive_file =~ /\.tar$/ and $ON_WINDOWS) { $extract_cmd = "tar -xf \"$archive_file\""; } elsif (($archive_file =~ /\.tar\.(gz|Z)$/ or $archive_file =~ /\.tgz$/ ) and !$ON_WINDOWS) { if (external_utility_exists("gzip --version")) { if (external_utility_exists("tar --version")) { $extract_cmd = "gzip -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "gzip"; } } elsif ($archive_file =~ /\.tar\.bz2$/ and !$ON_WINDOWS) { if (external_utility_exists("bzip2 --help")) { if (external_utility_exists("tar --version")) { $extract_cmd = "bzip2 -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "bzip2"; } } elsif ($archive_file =~ /\.tar\.xz$/ and !$ON_WINDOWS) { if (external_utility_exists("unxz --version")) { if (external_utility_exists("tar --version")) { $extract_cmd = "unxz -dc '$archive_file' | tar xf -"; } else { $missing = "tar"; } } else { $missing = "bzip2"; } } elsif ($archive_file =~ /\.tar$/ and !$ON_WINDOWS) { $extract_cmd = "tar xf '$archive_file'"; } elsif ($archive_file =~ /\.src\.rpm$/i and !$ON_WINDOWS) { if (external_utility_exists("cpio --version")) { if (external_utility_exists("rpm2cpio")) { $extract_cmd = "rpm2cpio '$archive_file' | cpio -i"; } else { $missing = "rpm2cpio"; } } else { $missing = "cpio"; } } elsif ($archive_file =~ /\.(whl|zip)$/i and !$ON_WINDOWS) { if (external_utility_exists("unzip")) { $extract_cmd = "unzip -qq -d . '$archive_file'"; } else { $missing = "unzip"; } } elsif ($archive_file =~ /\.deb$/i and !$ON_WINDOWS) { # only useful if the .deb contains source code--most # .deb files just have compiled executables if (external_utility_exists("dpkg-deb")) { $extract_cmd = "dpkg-deb -x '$archive_file' ."; } else { $missing = "dpkg-deb"; } } elsif ($ON_WINDOWS and $archive_file =~ /\.(whl|zip)$/i) { # use unzip on Windows (comes with git-for-Windows) if (external_utility_exists("unzip")) { $extract_cmd = "unzip -qq -d . \"$archive_file\" "; } else { $missing = "unzip"; } } print "<- uncompress_archive_cmd\n" if $opt_v > 2; if ($missing) { die "Unable to expand $archive_file because external\n", "utility '$missing' is not available.\n", "Another possibility is to use the --extract-with option.\n"; } else { return $extract_cmd; } } # 1}}} sub read_list_file { # {{{1 my ($file, ) = @_; # reads filenames from a STDIN pipe if $file == "-" print "-> read_list_file($file)\n" if $opt_v > 2; my @entry = (); if ($file eq "-") { # read from a STDIN pipe my $IN; open($IN, $file); if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; return (); } while (<$IN>) { next if /^\s*$/ or /^\s*#/; # skip empty or commented lines s/\cM$//; # DOS to Unix chomp; push @entry, $_; } $IN->close; } else { # read from an actual file foreach my $line (read_file($file)) { next if $line =~ /^\s*$/ or $line =~ /^\s*#/; $line =~ s/\cM$//; # DOS to Unix chomp $line; push @entry, $line; } } print "<- read_list_file\n" if $opt_v > 2; return @entry; } # 1}}} sub external_utility_exists { # {{{1 my $exe = shift @_; # remove args, if any my $leading_exe = $exe; $leading_exe =~ s/^(\S+)\s*.*?$/$1/; my $success = 0; if ($ON_WINDOWS) { $success = 1 unless system $exe . ' > nul'; } else { $success = 1 unless system $exe . ' >/dev/null 2>&1'; if (!$success) { $success = 1 unless system "which" . " $leading_exe" . ' >/dev/null 2>&1'; } } return $success; } # 1}}} sub write_xsl_file { # {{{1 print "-> write_xsl_file\n" if $opt_v > 2; my $XSL = # {{{2 ' CLOC Results

'; # 2}}} if ($opt_by_file) { $XSL .= #
{{{2 ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= '
File Blank Comment Code Language3rd Generation Equivalent Scale
Total

'; # 2}}} } if (!$opt_by_file or $opt_by_file_by_lang) { $XSL .= #
{{{2 ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= ' '; $XSL .= ' ' if $opt_3; $XSL .= '
Language Files Blank Comment CodeScale 3rd Generation Equivalent
Total
'; # 2}}} } $XSL.= <<'EO_XSL'; # {{{2
EO_XSL # 2}}} my $XSL_DIFF = <<'EO_DIFF_XSL'; # {{{2 CLOC Results

EO_DIFF_XSL # 2}}} if ($opt_by_file) { $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
Same
File Blank Comment Code
Modified
File Blank Comment Code
Added
File Blank Comment Code
Removed
File Blank Comment Code
EO_DIFF_XSL # 2}}} } if (!$opt_by_file or $opt_by_file_by_lang) { $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
Same
Language Files Blank Comment Code
Modified
Language Files Blank Comment Code
Added
Language Files Blank Comment Code
Removed
Language Files Blank Comment Code
EO_DIFF_XSL # 2}}} } $XSL_DIFF.= <<'EO_DIFF_XSL'; # {{{2
EO_DIFF_XSL # 2}}} if ($opt_diff) { write_file($CLOC_XSL, {}, ( $XSL_DIFF ) ); } else { write_file($CLOC_XSL, {}, ( $XSL ) ); } print "<- write_xsl_file\n" if $opt_v > 2; } # 1}}} sub normalize_file_names { # {{{1 print "-> normalize_file_names\n" if $opt_v > 2; my (@files, ) = @_; # Returns a hash of file names reduced to a canonical form # (fully qualified file names, all path separators changed to /, # Windows file names lowercased). Hash values are the original # file name. my %normalized = (); foreach my $F (@files) { my $F_norm = $F; if ($ON_WINDOWS) { $F_norm = lc $F_norm; # for case insensitive file name comparisons $F_norm =~ s{\\}{/}g; # Windows directory separators to Unix $F_norm =~ s{^\./}{}g; # remove leading ./ if (($F_norm !~ m{^/}) and ($F_norm !~ m{^\w:/})) { # looks like a relative path; prefix with cwd $F_norm = lc "$cwd/$F_norm"; } } else { $F_norm =~ s{^\./}{}g; # remove leading ./ if ($F_norm !~ m{^/}) { # looks like a relative path; prefix with cwd $F_norm = "$cwd/$F_norm"; } } # Remove trailing / so it does not interfere with further regex code # that does not expect it $F_norm =~ s{/+$}{}; $normalized{ $F_norm } = $F; } print "<- normalize_file_names\n" if $opt_v > 2; return %normalized; } # 1}}} sub combine_diffs { # {{{1 # subroutine by Andy (awalshe@sf.net) # https://sourceforge.net/tracker/?func=detail&aid=3261017&group_id=174787&atid=870625 my ($ra_files) = @_; print "-> combine_diffs\n" if $opt_v > 2; my $res = "$URL v $VERSION\n"; my $dl = '-'; my $width = 79; # columns are in this order my @cols = ('files', 'blank', 'comment', 'code'); my %HoH = (); foreach my $file (@{$ra_files}) { my $IN = open_file('<', $file, 1); if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; next; } my $sec; while (<$IN>) { chomp; s/\cM$//; next if /^(http|Language|-----)/; if (/^[A-Za-z0-9]+/) { # section title $sec = $_; chomp($sec); $HoH{$sec} = () if ! exists $HoH{$sec}; next; } if (/^\s(same|modified|added|removed)/) { # calculated totals row my @ar = grep { $_ ne '' } split(/ /, $_); chomp(@ar); my $ttl = shift @ar; my $i = 0; foreach(@ar) { my $t = "${ttl}${dl}${cols[$i]}"; $HoH{$sec}{$t} = 0 if ! exists $HoH{$sec}{$t}; $HoH{$sec}{$t} += $_; $i++; } } } $IN->close; } # rows are in this order my @rows = ('same', 'modified', 'added', 'removed'); $res .= sprintf("%s\n", "-" x $width); $res .= sprintf("%-19s %14s %14s %14s %14s\n", 'Language', $cols[0], $cols[1], $cols[2], $cols[3]); $res .= sprintf("%s\n", "-" x $width); # no inputs? %HoH will be empty return $res unless %HoH; for my $sec ( keys %HoH ) { next if $sec =~ /SUM:/; next unless defined $HoH{$sec}; # eg, the header line $res .= "$sec\n"; foreach (@rows) { $res .= sprintf(" %-18s %14s %14s %14s %14s\n", $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, $HoH{$sec}{"${_}${dl}${cols[1]}"}, $HoH{$sec}{"${_}${dl}${cols[2]}"}, $HoH{$sec}{"${_}${dl}${cols[3]}"}); } } $res .= sprintf("%s\n", "-" x $width); my $sec = 'SUM:'; $res .= "$sec\n"; foreach (@rows) { $res .= sprintf(" %-18s %14s %14s %14s %14s\n", $_, $HoH{$sec}{"${_}${dl}${cols[0]}"}, $HoH{$sec}{"${_}${dl}${cols[1]}"}, $HoH{$sec}{"${_}${dl}${cols[2]}"}, $HoH{$sec}{"${_}${dl}${cols[3]}"}); } $res .= sprintf("%s\n", "-" x $width); print "<- combine_diffs\n" if $opt_v > 2; return $res; } # 1}}} sub combine_csv_diffs { # {{{1 my ($delimiter, $ra_files) = @_; print "-> combine_csv_diffs\n" if $opt_v > 2; my %sum = (); # sum{ language } = array of 17 values foreach my $file (@{$ra_files}) { my $IN = open_file('<', $file, 1); if (!defined $IN) { warn "Unable to read $file; ignoring.\n"; next; } my $sec; while (<$IN>) { next if /^Language${delimiter}\s==\sfiles${delimiter}/; chomp; my @words = split(/$delimiter/); my $n_col = scalar(@words); if ($n_col != 18) { warn "combine_csv_diffs(): Parse failure line $. of $file\n"; warn "Expected 18 columns, got $n_col\n"; die; } my $Lang = $words[0]; my @count = map { int($_) } @words[1..16]; if (defined $sum{$Lang}) { for (my $i = 0; $i < 16; $i++) { $sum{$Lang}[$i] += $count[$i]; } } else { @{$sum{$Lang}} = @count; } } $IN->close; } my @header = ("Language", "== files", "!= files", "+ files", "- files", "== blank", "!= blank", "+ blank", "- blank", "== comment", "!= comment", "+ comment", "- comment", "== code", "!= code", "+ code", "- code", "$URL v $VERSION" ); my $res = join("$delimiter ", @header) . "$delimiter\n"; foreach my $Lang (sort keys %sum) { $res .= $Lang . "$delimiter "; for (my $i = 0; $i < 16; $i++) { $res .= $sum{$Lang}[$i] . "$delimiter "; } $res .= "\n"; } print "<- combine_csv_diffs\n" if $opt_v > 2; return $res; } # 1}}} sub get_time { # {{{1 if ($HAVE_Time_HiRes) { return Time::HiRes::time(); } else { return time(); } } # 1}}} sub really_is_D { # {{{1 # Ref bug 131, files ending with .d could be init.d scripts # instead of D language source files. my ($file , # in $rh_Err , # in hash of error codes $raa_errors , # out ) = @_; print "-> really_is_D($file)\n" if $opt_v > 2; my ($possible_script, $L) = peek_at_first_line($file, $rh_Err, $raa_errors); print "<- really_is_D($file)\n" if $opt_v > 2; return $possible_script; # null string if D, otherwise a language } # 1}}} sub no_autogen_files { # {{{1 # ref https://github.com/AlDanial/cloc/issues/151 my ($print,) = @_; print "-> no_autogen($print)\n" if $opt_v > 2; # These sometimes created manually? # acinclude.m4 # configure.ac # Makefile.am my @files = qw ( aclocal.m4 announce-gen autogen.sh bootstrap compile config.guess config.h.in config.rpath config.status config.sub configure configure.in depcomp gendocs.sh gitlog-to-changelog git-version-gen gnupload gnu-web-doc-update install-sh libtool libtool.m4 link-warning.h ltmain.sh lt~obsolete.m4 ltoptions.m4 ltsugar.m4 ltversion.in ltversion.m4 Makefile.in mdate-sh missing mkinstalldirs test-driver texinfo.tex update-copyright useless-if-before-free vc-list-files ylwrap ); if ($print) { printf "cloc will ignore these %d files with --no-autogen:\n", scalar @files; foreach my $F (@files) { print " $F\n"; } print "Additionally, Go files with '// Code generated by .* DO NOT EDIT.'\n"; print "on the first line are ignored.\n"; } print "<- no_autogen()\n" if $opt_v > 2; return @files; } # 1}}} sub load_from_config_file { # {{{1 # Supports all options except --config itself which would # be pointless. my ($config_file, $rs_by_file , $rs_by_file_by_lang , $rs_categorized , $rs_counted , $rs_include_ext , $rs_include_lang , $rs_include_content , $rs_exclude_content , $rs_exclude_lang , $rs_exclude_dir , $rs_exclude_list_file , $rs_explain , $rs_extract_with , $rs_found , $rs_count_diff , $rs_diff_list_files , $rs_diff , $rs_diff_alignment , $rs_diff_timeout , $rs_timeout , $rs_html , $rs_ignored , $rs_unique , $rs_quiet , $rs_force_lang_def , $rs_read_lang_def , $rs_show_ext , $rs_show_lang , $rs_progress_rate , $rs_print_filter_stages , $rs_report_file , $ra_script_lang , $rs_sdir , $rs_skip_uniqueness , $rs_strip_code , $rs_strip_comments , $rs_original_dir , $rs_sum_reports , $rs_hide_rate , $rs_processes , $rs_unicode , $rs_3 , $rs_v , $rs_vcs , $rs_include_submodules , $rs_version , $rs_write_lang_def , $rs_write_lang_def_incl_dup, $rs_xml , $rs_xsl , $ra_force_lang , $rs_lang_no_ext , $rs_yaml , $rs_csv , $rs_csv_delimiter , $rs_json , $rs_md , $rs_fullpath , $rs_match_f , $ra_not_match_f , $rs_match_d , $ra_not_match_d , $rs_list_file , $rs_help , $rs_skip_win_hidden , $rs_read_binary_files , $rs_sql , $rs_sql_project , $rs_sql_append , $rs_sql_style , $rs_inline , $rs_exclude_ext , $rs_ignore_whitespace , $rs_ignore_case , $rs_ignore_case_ext , $ra_ignore_regex , $rs_follow_links , $rs_autoconf , $rs_sum_one , $rs_by_percent , $rs_stdin_name , $rs_force_on_windows , $rs_force_on_unix , $rs_show_os , $rs_skip_archive , $rs_max_file_size , $rs_use_sloccount , $rs_no_autogen , $rs_force_git , $rs_strip_str_comments , $rs_file_encoding , $rs_docstring_as_code , $rs_stat , $rs_thousands_delimiter , $rs_show_errors , ) = @_; # look for runtime configuration file in # $ENV{'HOME'}/.config/cloc/options.txt -> POSIX # $ENV{'APPDATA'} . 'cloc' print "-> load_from_config_file($config_file)\n" if $opt_v and $opt_v > 2; if (!is_file($config_file)) { print "<- load_from_config_file() (no such file: $config_file)\n" if $opt_v and $opt_v > 2; return; } elsif (!can_read($config_file)) { print "<- load_from_config_file() (unable to read $config_file)\n" if $opt_v and $opt_v > 2; return; } print "Reading options from $config_file.\n" if defined $opt_v; my $has_force_lang = @{$ra_force_lang}; my $has_script_lang = @{$ra_script_lang}; my @lines = read_file($config_file); foreach (@lines) { next if /^\s*$/ or /^\s*#/; s/\s*--//; s/^\s+//; if (!defined ${$rs_by_file} and /^(by_file|by-file)/) { ${$rs_by_file} = 1; } elsif (!defined ${$rs_by_file_by_lang} and /^(by_file_by_lang|by-file-by-lang)/) { ${$rs_by_file_by_lang} = 1; } elsif (!defined ${$rs_categorized} and /^categorized(=|\s+)(.*?)$/) { ${$rs_categorized} = $2; } elsif (!defined ${$rs_counted} and /^counted(=|\s+)(.*?)$/) { ${$rs_counted} = $2; } elsif (!defined ${$rs_include_ext} and /^(?:include_ext|include-ext)(=|\s+)(.*?)$/) { ${$rs_include_ext} = $2; } elsif (!defined ${$rs_include_lang} and /^(?:include_lang|include-lang)(=|\s+)(.*?)$/) { ${$rs_include_lang} = $2; } elsif (!defined ${$rs_include_content} and /^(?:include_content|include-content)(=|\s+)(.*?)$/) { ${$rs_include_content} = $2; } elsif (!defined ${$rs_exclude_content} and /^(?:exclude_content|exclude-content)(=|\s+)(.*?)$/) { ${$rs_exclude_content} = $2; } elsif (!defined ${$rs_exclude_lang} and /^(?:exclude_lang|exclude-lang)(=|\s+)(.*?)$/) { ${$rs_exclude_lang} = $2; } elsif (!defined ${$rs_exclude_dir} and /^(?:exclude_dir|exclude-dir)(=|\s+)(.*?)$/) { ${$rs_exclude_dir} = $2; } elsif (!defined ${$rs_explain} and /^explain(=|\s+)(.*?)$/) { ${$rs_explain} = $2; } elsif (!defined ${$rs_extract_with} and /^(?:extract_with|extract-with)(=|\s+)(.*?)$/) { ${$rs_extract_with} = $2; } elsif (!defined ${$rs_found} and /^found(=|\s+)(.*?)$/) { ${$rs_found} = $2; } elsif (!defined ${$rs_count_diff} and /^(count_and_diff|count-and-diff)/) { ${$rs_count_diff} = 1; } elsif (!defined ${$rs_diff_list_files} and /^(diff_list_files|diff-list-files)/) { ${$rs_diff_list_files} = 1; } elsif (!defined ${$rs_diff} and /^diff/) { ${$rs_diff} = 1; } elsif (!defined ${$rs_diff_alignment} and /^(?:diff-alignment|diff_alignment)(=|\s+)(.*?)$/) { ${$rs_diff_alignment} = $2; } elsif (!defined ${$rs_diff_timeout} and /^(?:diff-timeout|diff_timeout)(=|\s+)i/) { ${$rs_diff_timeout} = $1; } elsif (!defined ${$rs_timeout} and /^timeout(=|\s+)i/) { ${$rs_timeout} = $1; } elsif (!defined ${$rs_html} and /^html/) { ${$rs_html} = 1; } elsif (!defined ${$rs_ignored} and /^ignored(=|\s+)(.*?)$/) { ${$rs_ignored} = $2; } elsif (!defined ${$rs_unique} and /^unique(=|\s+)(.*?)$/) { ${$rs_unique} = $2; } elsif (!defined ${$rs_quiet} and /^quiet/) { ${$rs_quiet} = 1; } elsif (!defined ${$rs_force_lang_def} and /^(?:force_lang_def|force-lang-def)(=|\s+)(.*?)$/) { ${$rs_force_lang_def} = $2; } elsif (!defined ${$rs_read_lang_def} and /^(?:read_lang_def|read-lang-def)(=|\s+)(.*?)$/) { ${$rs_read_lang_def} = $2; } elsif (!defined ${$rs_progress_rate} and /^(?:progress_rate|progress-rate)(=|\s+)(\d+)/) { ${$rs_progress_rate} = $2; } elsif (!defined ${$rs_print_filter_stages} and /^(print_filter_stages|print-filter-stages)/) { ${$rs_print_filter_stages}= 1; } elsif (!defined ${$rs_report_file} and /^(?:report_file|report-file)(=|\s+)(.*?)$/) { ${$rs_report_file} = $2; } elsif (!defined ${$rs_report_file} and /^out(=|\s+)(.*?)$/) { ${$rs_report_file} = $2; } elsif (!defined ${$rs_sdir} and /^sdir(=|\s+)(.*?)$/) { ${$rs_sdir} = $2; } elsif (!defined ${$rs_skip_uniqueness} and /^(skip_uniqueness|skip-uniqueness)/) { ${$rs_skip_uniqueness} = 1; } elsif (!defined ${$rs_strip_code} and /^(?:strip_code|strip-code)(=|\s+)(.*?)$/) { ${$rs_strip_code} = $2; } elsif (!defined ${$rs_strip_comments} and /^(?:strip_comments|strip-comments)(=|\s+)(.*?)$/) { ${$rs_strip_comments} = $2; } elsif (!defined ${$rs_original_dir} and /^(original_dir|original-dir)/) { ${$rs_original_dir} = 1; } elsif (!defined ${$rs_sum_reports} and /^(sum_reports|sum-reports)/) { ${$rs_sum_reports} = 1; } elsif (!defined ${$rs_hide_rate} and /^(hid_rate|hide-rate)/) { ${$rs_hide_rate} = 1; } elsif (!defined ${$rs_processes} and /^processes(=|\s+)(\d+)/) { ${$rs_processes} = $2; } elsif (!defined ${$rs_unicode} and /^unicode/) { ${$rs_unicode} = 1; } elsif (!defined ${$rs_3} and /^3/) { ${$rs_3} = 1; } elsif (!defined ${$rs_vcs} and /^vcs(=|\s+)(\S+)/) { ${$rs_vcs} = $2; } elsif (!defined ${$rs_include_submodules} and /^include-submodules/) { ${$rs_include_submodules} = 1; } elsif (!defined ${$rs_version} and /^version/) { ${$rs_version} = 1; } elsif (!defined ${$rs_write_lang_def} and /^(?:write_lang_def|write-lang-def)(=|\s+)(.*?)$/) { ${$rs_write_lang_def} = $2; } elsif (!defined ${$rs_write_lang_def_incl_dup} and /^(?:write_lang_def_incl_dup|write-lang-def-incl-dup)(=|\s+)(.*?)$/) { ${$rs_write_lang_def_incl_dup} = $2; } elsif (!defined ${$rs_xml} and /^xml/) { ${$rs_xml} = 1; } elsif (!defined ${$rs_xsl} and /^xsl(=|\s+)(.*?)$/) { ${$rs_xsl} = $2; } elsif (!defined ${$rs_lang_no_ext} and /^(?:lang_no_ext|lang-no-ext)(=|\s+)(.*?)$/) { ${$rs_lang_no_ext} = $2; } elsif (!defined ${$rs_yaml} and /^yaml/) { ${$rs_yaml} = 1; } elsif (!defined ${$rs_csv} and /^csv/) { ${$rs_csv} = 1; } elsif (!defined ${$rs_csv_delimiter} and /^(?:csv_delimiter|csv-delimiter)(=|\s+)(.*?)$/) { ${$rs_csv_delimiter} = $2; } elsif (!defined ${$rs_json} and /^json/) { ${$rs_json} = 1; } elsif (!defined ${$rs_md} and /^md/) { ${$rs_md} = 1; } elsif (!defined ${$rs_fullpath} and /^fullpath/) { ${$rs_fullpath} = 1; } elsif (!defined ${$rs_match_f} and /^(?:match_f|match-f)(=|\s+)['"]?(.*?)['"]?$/) { ${$rs_match_f} = $2; } elsif (! @{$ra_not_match_f} and /^(?:not_match_f|not-match-f)(=|\s+)['"]?(.*?)['"]?$/) { push @{$ra_not_match_f} , $2; } elsif (!defined ${$rs_match_d} and /^(?:match_d|match-d)(=|\s+)['"]?(.*?)['"]?$/) { ${$rs_match_d} = $2; } elsif (! @{$ra_not_match_d} and /^(?:not_match_d|not-match-d)(=|\s+)['"]?(.*?)['"]?$/) { push @{$ra_not_match_d} , $2; } elsif (!defined ${$rs_list_file} and /^(?:list_file|list-file)(=|\s+)(.*?)$/) { ${$rs_list_file} = $2; } elsif (!defined ${$rs_help} and /^help/) { ${$rs_help} = 1; } elsif (!defined ${$rs_skip_win_hidden} and /^(skip_win_hidden|skip-win-hidden)/) { ${$rs_skip_win_hidden} = 1; } elsif (!defined ${$rs_read_binary_files} and /^(read_binary_files|read-binary-files)/) { ${$rs_read_binary_files} = 1; } elsif (!defined ${$rs_sql} and /^sql(=|\s+)(.*?)$/) { ${$rs_sql} = $2; } elsif (!defined ${$rs_sql_project} and /^(?:sql_project|sql-project)(=|\s+)(.*?)$/) { ${$rs_sql_project} = $2; } elsif (!defined ${$rs_sql_append} and /^(sql_append|sql-append)/) { ${$rs_sql_append} = 1; } elsif (!defined ${$rs_sql_style} and /^(?:sql_style|sql-style)(=|\s+)(.*?)$/) { ${$rs_sql_style} = $2; } elsif (!defined ${$rs_inline} and /^inline/) { ${$rs_inline} = 1; } elsif (!defined ${$rs_exclude_ext} and /^(?:exclude_ext|exclude-ext)(=|\s+)(.*?)$/) { ${$rs_exclude_ext} = $2; } elsif (!defined ${$rs_ignore_whitespace} and /^(ignore_whitespace|ignore-whitespace)/) { ${$rs_ignore_whitespace} = 1; } elsif (!defined ${$rs_ignore_case_ext} and /^(ignore_case_ext|ignore-case-ext)/) { ${$rs_ignore_case_ext} = 1; } elsif (!defined ${$rs_ignore_case} and /^(ignore_case|ignore-case)/) { ${$rs_ignore_case} = 1; } elsif (! @{$ra_ignore_regex} and /^(?:ignore_regex|ignore-regex)(=|\s+)['"]?(.*?)['"]?$/) { push @{$ra_ignore_regex}, $2; } elsif (!defined ${$rs_follow_links} and /^(follow_links|follow-links)/) { ${$rs_follow_links} = 1; } elsif (!defined ${$rs_autoconf} and /^autoconf/) { ${$rs_autoconf} = 1; } elsif (!defined ${$rs_sum_one} and /^(sum_one|sum-one)/) { ${$rs_sum_one} = 1; } elsif (!defined ${$rs_by_percent} and /^(?:by_percent|by-percent)(=|\s+)(.*?)$/) { ${$rs_by_percent} = $2; } elsif (!defined ${$rs_stdin_name} and /^(?:stdin_name|stdin-name)(=|\s+)(.*?)$/) { ${$rs_stdin_name} = $2; } elsif (!defined ${$rs_force_on_windows} and /^windows/) { ${$rs_force_on_windows} = 1; } elsif (!defined ${$rs_force_on_unix} and /^unix/) { ${$rs_force_on_unix} = 1; } elsif (!defined ${$rs_show_os} and /^(show_os|show-os)/) { ${$rs_show_os} = 1; } elsif (!defined ${$rs_skip_archive} and /^(?:skip_archive|skip-archive)(=|\s+)(.*?)$/) { ${$rs_skip_archive} = $2; } elsif (!defined ${$rs_max_file_size} and /^(?:max_file_size|max-file-size)(=|\s+)(\d+)/) { ${$rs_max_file_size} = $2; } elsif (!defined ${$rs_use_sloccount} and /^(use_sloccount|use-sloccount)/) { ${$rs_use_sloccount} = 1; } elsif (!defined ${$rs_no_autogen} and /^(no_autogen|no-autogen)/) { ${$rs_no_autogen} = 1; } elsif (!defined ${$rs_force_git} and /^git/) { ${$rs_force_git} = 1; } elsif (!defined ${$rs_exclude_list_file} and /^(?:exclude_list_file|exclude-list-file)(=|\s+)(.*?)$/) { ${$rs_exclude_list_file} = $2; } elsif (!defined ${$rs_v} and /^(verbose|v)((=|\s+)(\d+))?/) { if (!defined $4) { ${$rs_v} = 0; } else { ${$rs_v} = $4; } } elsif (!$has_script_lang and /^(?:script_lang|script-lang)(=|\s+)(.*?)$/) { push @{$ra_script_lang} , $2; } elsif (!$has_force_lang and /^(?:force_lang|force-lang)(=|\s+)(.*?)$/) { push @{$ra_force_lang} , $2; } elsif (!defined ${$rs_show_ext} and /^(show_ext|show-ext)((=|\s+)(.*))?$/) { if (!defined $4) { ${$rs_show_ext} = 0; } else { ${$rs_show_ext} = $4; } } elsif (!defined ${$rs_show_lang} and /^(show_lang|show-lang)((=|\s+)(.*))?s/){ if (!defined $4) { ${$rs_show_lang} = 0; } else { ${$rs_show_lang} = $4; } } elsif (!defined ${$rs_strip_str_comments} and /^(strip_str_comments|strip-str-comments)/) { ${$rs_strip_str_comments} = 1; } elsif (!defined ${$rs_file_encoding} and /^(?:file_encoding|file-encoding)(=|\s+)(\S+)/) { ${$rs_file_encoding} = $2; } elsif (!defined ${$rs_docstring_as_code} and /^(docstring_as_code|docstring-as-code)/) { ${$rs_docstring_as_code} = 1; } elsif (!defined ${$rs_stat} and /stat/) { ${$rs_stat} = 1; } elsif (!defined ${$rs_thousands_delimiter} and /^ksep|thousands-delimiter(=|\s+)(.*?)$/) { ${$rs_thousands_delimiter}= $2; } elsif (!defined ${$rs_show_errors} and /show_errors|show-errors/) { ${$rs_show_errors} = 1; } } } # 1}}} sub trick_pp_packer_encode { # {{{1 use Encode; # PAR::Packer gives 'Unknown PerlIO layer "encoding"' unless it is # forced into using this module. my ($OUT, $JunkFile) = tempfile(UNLINK => 1); # delete on exit open($OUT, "> :encoding(utf8)", $JunkFile); close($OUT); } # 1}}} sub really_is_smarty { # {{{1 # Given filename, returns TRUE if its contents look like Smarty template my ($filename, ) = @_; print "-> really_is_smarty($filename)\n" if $opt_v > 2; my @lines = read_file($filename); my $points = 0; foreach my $L (@lines) { if (($L =~ /\{(if|include)\s/) or ($L =~ /\{\/if\}/) or ($L =~ /(\{\*|\*\})/) or ($L =~ /\{\$\w/)) { ++$points; } last if $points >= 2; } print "<- really_is_smarty(points=$points)\n" if $opt_v > 2; return $points >= 2; } # 1}}} sub check_alternate_config_files { # {{{1 my ($list_file, $exclude_list_file, $read_lang_def, $force_lang_def, $diff_list_file, ) = @_; my $found_it = ""; foreach my $file ($list_file, $exclude_list_file, $read_lang_def, $force_lang_def, $diff_list_file ) { next unless defined $file; my $dir = dirname $file; next unless can_read($dir) and is_dir($dir); my $bn = basename $config_file; if (can_read("$dir/$bn")) { $found_it = "$dir/$bn"; print "Using configuration file $found_it\n" if $opt_v; last; } } return $found_it; } # 1}}} sub write_null_results { # {{{ my ($json, $xml, $report_file,) = @_; print "-> write_null_results\n" if $opt_v > 2; if ((defined $json) or (defined $xml)) { my $line = ""; if (defined $json) { $line = "{}"; } else { $line = ''; } if (defined $report_file) { open OUT, ">$report_file" or die "Cannot write to $report_file $!\n"; print OUT "$line\n"; close OUT; } else { print "$line\n"; } } print "<- write_null_results\n" if $opt_v > 2; } # }}} sub glob2regex { # {{{ # convert simple xpath-style glob pattern to a regex my $globstr = shift; my $re = $globstr; $re =~ s{^["']}{}; $re =~ s{^\.\/}{}; $re =~ s{["']$}{}; $re =~ s{\.}{\\.}g; $re =~ s{\*\*}{\cx}g; # ctrl x = .*? $re =~ s{\*}{\cy}g; # ctrl y = [^/]* $re =~ s{\cx}{.*?}g; $re =~ s{\cy}{[^/]*}g; return '^' . $re . '$'; } # }}} sub load_json { # {{{1 # # Load a cloc-generated JSON string into %contents # $contents{filename}{blank|comment|code|language} = value # then print in a variety of formats. # my ($json_string, ) = @_; print "-> load_json()\n" if $opt_v > 2; my %contents = (); my $heading = undef; foreach (split /\n/, $json_string) { if (/^{?"(.*?)"/) { $heading = $1; } else { if (/^\s+"(.*?)"\s*:\s+(\d+(\.\d+)?)\b/) { # numeric value $contents{$heading}{$1} = $2; } elsif (/^\s+"(.*?)"\s*:\s+"(.*?)"/) { $contents{$heading}{$1} = $2; } } } my $url = $contents{'header'}{'cloc_url'}; my $ver = $contents{'header'}{'cloc_version'}; my $sec = $contents{'header'}{'elapsed_seconds'}; my $n_file = $contents{'header'}{'n_files'}; my $n_line = $contents{'header'}{'n_lines'}; $sec = $sec == 0 ? 1.0e-3 : $sec; my $header = sprintf "%s v %s T=%.2f s (%.1f files/s, %.1f lines/s)", $url, $ver, $sec, $n_file/$sec, $n_line/$sec; delete $contents{'header'}; delete $contents{'SUM'}; my @file_list = (sort { $contents{$b}{'code'} <=> $contents{$a}{'code'} } keys %contents ); #die Dumper(\%contents); # Determine column widths for output my $file_len = 0; my $lang_len = 0; foreach my $file (keys %contents) { my $flen = length $file; my $llen = length $contents{$file}{'language'}; $file_len = $file_len > $flen ? $file_len : $flen; $lang_len = $lang_len > $llen ? $lang_len : $llen; } print "<- load_json()\n" if $opt_v > 2; return $file_len, $lang_len, $header, %contents; } # 1}}} sub print_format_n { # {{{1 # by file with # format 1 : Language | files | blank | comment | code # format 2 : Language | files | blank | comment | code | total # format 3 : File | Language | blank | comment | code # format 4 : File | blank | comment | code | total # format 5 : File | Language | blank | comment | code | total my ($format, $file_len, $lang_len, $header, %contents) = @_; print "-> print_format_n($format)\n" if $opt_v > 2; my @prt_lines = (); # 8 = characters in "Language" $lang_len = max(8, $lang_len); my %str_fmt = ( 1 => sprintf("%%-%ds %%7s %%7s %%7s %%7s\n", $lang_len), 2 => sprintf("%%-%ds %%7s %%7s %%7s %%7s %%7s\n", $lang_len), 3 => sprintf("%%-%ds %%-%ds %%7s %%7s %%7s\n", $file_len, $lang_len), 4 => sprintf("%%-%ds %%7s %%7s %%7s %%7s\n", $file_len), 5 => sprintf("%%-%ds %%-%ds %%7s %%7s %%7s %%7s\n", $file_len, $lang_len), ); my %val_fmt = ( 1 => sprintf("%%-%ds %%7s %%7s %%7s %%7s\n", $lang_len), 2 => sprintf("%%-%ds %%7s %%7s %%7s %%7s %%7s\n", $lang_len), 3 => sprintf("%%-%ds %%-%ds %%7s %%7s %%7s\n", $file_len, $lang_len), 4 => sprintf("%%-%ds %%7s %%7s %%7s %%7s\n", $file_len), 5 => sprintf("%%-%ds %%-%ds %%7d %%7s %%7s %%7s\n", $file_len, $lang_len), ); my %language = (); foreach my $file (keys %contents) { my $lang = $contents{$file}{'language'}; $language{$lang}{'files'} += 1; foreach my $category ('blank', 'comment', 'code',) { $language{$lang}{$category} += $contents{$file}{$category}; $language{$lang}{'total'} += $contents{$file}{$category}; } } my @file_list = (sort { $contents{$b}{'code'} <=> $contents{$a}{'code'} } keys %contents ); my @lang_list = (sort { $language{$b}{'code'} <=> $language{$a}{'code'} } keys %language ); my %hyphens = ( 1 => "-" x ($lang_len + 4*9), 2 => "-" x ($lang_len + 5*9), 3 => "-" x ($lang_len + $file_len + 2 + 3*9), 4 => "-" x ($file_len + 4*9), 5 => "-" x ($lang_len + $file_len + 2 + 4*9), ); my %col_headings = ( 1 => ["Language", "files", "blank", "comment", "code"], 2 => ["Language", "files", "blank", "comment", "code", "Total"], 3 => ["File", "Language", "blank", "comment", "code"], 4 => ["File", "blank", "comment", "code", "Total"], 5 => ["File", "Language", "blank", "comment", "code", "Total"], ); push @prt_lines, "$header\n"; push @prt_lines, "$hyphens{$format}\n"; push @prt_lines, sprintf $str_fmt{$format}, @{$col_headings{$format}}; push @prt_lines, "$hyphens{$format}\n"; my ($n_files, $n_blank, $n_comment, $n_code, $n_total) = (0, 0, 0, 0, 0); my @out; my $sum; if ($format < 3) { # by language foreach my $lang (@lang_list) { my ($nF, $nB, $nCm, $nCo) = ($language{$lang}{'files'}, $language{$lang}{'blank'}, $language{$lang}{'comment'}, $language{$lang}{'code'}); $n_files += $nF; $n_blank += $nB; $n_comment += $nCm; $n_code += $nCo; $n_total += $nB + $nCm + $nCo; $sum = $nB + $nCm + $nCo; if ($opt_thousands_delimiter) { $sum = separate_thousands($sum, $opt_thousands_delimiter); $nF = separate_thousands($nF, $opt_thousands_delimiter); $nB = separate_thousands($nB, $opt_thousands_delimiter); $nCm = separate_thousands($nCm, $opt_thousands_delimiter); $nCo = separate_thousands($nCo, $opt_thousands_delimiter); } if ($format == 1) { @out = ($lang, $nF, $nB, $nCm, $nCo); } else { @out = ($lang, $nF, $nB, $nCm, $nCo, $sum); } push @prt_lines, sprintf $str_fmt{$format}, @out; } } else { # by file foreach my $file (@file_list) { my ($nB, $nCm, $nCo) = ($contents{$file}{'blank'}, $contents{$file}{'comment'}, $contents{$file}{'code'}); $n_blank += $nB; $n_comment += $nCm; $n_code += $nCo; $n_total += $nB + $nCm + $nCo; $sum = $nB + $nCm + $nCo; if ($opt_thousands_delimiter) { $sum = separate_thousands($sum, $opt_thousands_delimiter); $nB = separate_thousands($nB, $opt_thousands_delimiter); $nCm = separate_thousands($nCm, $opt_thousands_delimiter); $nCo = separate_thousands($nCo, $opt_thousands_delimiter); } my $lang = $contents{$file}{'language'}; if ($format == 1) { } elsif ($format == 3) { @out = ($file, $lang, $nB, $nCm, $nCo); } elsif ($format == 4) { @out = ($file, $nB, $nCm, $nCo, $sum); } else { @out = ($file, $lang, $nB, $nCm, $nCo, $sum); } push @prt_lines, sprintf $str_fmt{$format}, @out; } } push @prt_lines, "$hyphens{$format}\n"; if (scalar @file_list > 1) { if ($opt_thousands_delimiter) { $n_files = separate_thousands($n_files, $opt_thousands_delimiter); $n_blank = separate_thousands($n_blank, $opt_thousands_delimiter); $n_comment = separate_thousands($n_comment, $opt_thousands_delimiter); $n_code = separate_thousands($n_code, $opt_thousands_delimiter); $n_total = separate_thousands($n_total, $opt_thousands_delimiter); } if ($format == 1) { @out = ( "SUM", $n_files, $n_blank, $n_comment, $n_code); } elsif ($format == 2) { @out = ( "SUM", $n_files, $n_blank, $n_comment, $n_code, $n_total); } elsif ($format == 3) { @out = ( "SUM", " ", $n_blank, $n_comment, $n_code); } elsif ($format == 4) { @out = ( "SUM", $n_blank, $n_comment, $n_code, $n_total); } else { @out = ( "SUM", " ", $n_blank, $n_comment, $n_code, $n_total); } push @prt_lines, sprintf $str_fmt{$format}, @out; push @prt_lines, "$hyphens{$format}\n"; } return @prt_lines; print "<- print_format_n()\n" if $opt_v > 2; } # 1}}} sub parse_ignore_regex { # {{{1 # # Convert the list of "language(s)|regex" into a hash # $ignore_regex{language} = [list of regex] my ($ra_lang_regex , # in, as given on command line $rhaa_Filters_by_Language, # in, hash of filters by language $rha_ignore_regex) = @_; print "-> parse_ignore_regex()\n" if $opt_v > 2; foreach my $lang_regex (@{$ra_lang_regex}) { die "Missing '|' character in --ignore-regex '$lang_regex'\n" unless $lang_regex =~ /\|/; my ($lang, $regex) = split(/\|/, $lang_regex, 2); die "Invalid --ignore-regex: $lang_regex\n" unless defined $lang and defined $regex; my @languages = split(/,/, $lang); foreach my $lang (@languages) { if ($lang eq '*') { foreach my $lang (keys %{$rhaa_Filters_by_Language}) { push @{$rha_ignore_regex->{$lang}}, $regex; } } else { die "Unknown language '$lang' in --ignore-regex '$lang_regex'\n" unless defined $rhaa_Filters_by_Language->{$lang}; push @{$rha_ignore_regex->{$lang}}, $regex; } #print "lang=$lang regex=[$regex]\n"; } } #use Data::Dumper; #print Dumper($rha_ignore_regex); print "<- parse_ignore_regex()\n" if $opt_v > 2; } # 1}}} # really_is_pascal, really_is_incpascal, really_is_php from SLOCCount my %php_files = (); # really_is_php() sub really_is_pascal { # {{{1 # Given filename, returns TRUE if its contents really are Pascal. # This isn't as obvious as it seems. # Many ".p" files are Perl files # (such as /usr/src/redhat/BUILD/ispell-3.1/dicts/czech/glob.p), # others are C extractions # (such as /usr/src/redhat/BUILD/linux/include/linux/umsdos_fs.p # and some files in linuxconf). # However, test files in "p2c" really are Pascal, for example. # Note that /usr/src/redhat/BUILD/ucd-snmp-4.1.1/ov/bitmaps/UCD.20.p # is actually C code. The heuristics determine that they're not Pascal, # but because it ends in ".p" it's not counted as C code either. # I believe this is actually correct behavior, because frankly it # looks like it's automatically generated (it's a bitmap expressed as code). # Rather than guess otherwise, we don't include it in a list of # source files. Let's face it, someone who creates C files ending in ".p" # and expects them to be counted by default as C files in SLOCCount needs # their head examined. I suggest examining their head # with a sucker rod (see syslogd(8) for more on sucker rods). # This heuristic counts as Pascal such files such as: # /usr/src/redhat/BUILD/teTeX-1.0/texk/web2c/tangleboot.p # Which is hand-generated. We don't count woven documents now anyway, # so this is justifiable. my $filename = shift; chomp($filename); # The heuristic is as follows: it's Pascal _IF_ it has all of the following # (ignoring {...} and (*...*) comments): # 1. "^..program NAME" or "^..unit NAME", # 2. "procedure", "function", "^..interface", or "^..implementation", # 3. a "begin", and # 4. it ends with "end.", # # Or it has all of the following: # 1. "^..module NAME" and # 2. it ends with "end.". # # Or it has all of the following: # 1. "^..program NAME", # 2. a "begin", and # 3. it ends with "end.". # # The "end." requirements in particular filter out non-Pascal. # # Note (jgb): this does not detect Pascal main files in fpc, like # fpc-1.0.4/api/test/testterminfo.pas, which does not have "program" in # it my $is_pascal = 0; # Value to determine. my $has_program = 0; my $has_unit = 0; my $has_module = 0; my $has_procedure_or_function = 0; my $found_begin = 0; my $found_terminating_end = 0; my $has_begin = 0; my $PASCAL_FILE = open_file('<', $filename, 0); die "Can't open $filename to determine if it's pascal.\n" if !defined $PASCAL_FILE; while(<$PASCAL_FILE>) { s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. if (m/\bprogram\s+[A-Za-z]/i) {$has_program=1;} if (m/\bunit\s+[A-Za-z]/i) {$has_unit=1;} if (m/\bmodule\s+[A-Za-z]/i) {$has_module=1;} if (m/\bprocedure\b/i) { $has_procedure_or_function = 1; } if (m/\bfunction\b/i) { $has_procedure_or_function = 1; } if (m/^\s*interface\s+/i) { $has_procedure_or_function = 1; } if (m/^\s*implementation\s+/i) { $has_procedure_or_function = 1; } if (m/\bbegin\b/i) { $has_begin = 1; } # Originally I said: # "This heuristic fails if there are multi-line comments after # "end."; I haven't seen that in real Pascal programs:" # But jgb found there are a good quantity of them in Debian, specially in # fpc (at the end of a lot of files there is a multiline comment # with the changelog for the file). # Therefore, assume Pascal if "end." appears anywhere in the file. if (m/end\.\s*$/i) {$found_terminating_end = 1;} # elsif (m/\S/) {$found_terminating_end = 0;} } close($PASCAL_FILE); # Okay, we've examined the entire file looking for clues; # let's use those clues to determine if it's really Pascal: if ( ( ($has_unit || $has_program) && $has_procedure_or_function && $has_begin && $found_terminating_end ) || ( $has_module && $found_terminating_end ) || ( $has_program && $has_begin && $found_terminating_end ) ) {$is_pascal = 1;} return $is_pascal; } # 1}}} sub really_is_incpascal { # {{{1 # Given filename, returns TRUE if its contents really are Pascal. # For .inc files (mainly seen in fpc) my $filename = shift; chomp($filename); # The heuristic is as follows: it is Pascal if any of the following: # 1. really_is_pascal returns true # 2. Any usual reserved word is found (program, unit, const, begin...) # If the general routine for Pascal files works, we have it if (really_is_pascal($filename)) { return 1; } my $is_pascal = 0; # Value to determine. my $found_begin = 0; my $PASCAL_FILE = open_file('<', $filename, 0); die "Can't open $filename to determine if it's pascal.\n" if !defined $PASCAL_FILE; while(<$PASCAL_FILE>) { s/\{.*?\}//g; # Ignore {...} comments on this line; imperfect, but effective. s/\(\*.*?\*\)//g; # Ignore (*...*) comments on this line; imperfect, but effective. if (m/\bprogram\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bunit\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bmodule\s+[A-Za-z]/i) {$is_pascal=1;} if (m/\bprocedure\b/i) {$is_pascal = 1; } if (m/\bfunction\b/i) {$is_pascal = 1; } if (m/^\s*interface\s+/i) {$is_pascal = 1; } if (m/^\s*implementation\s+/i) {$is_pascal = 1; } if (m/\bconstant\s+/i) {$is_pascal=1;} if (m/\bbegin\b/i) { $found_begin = 1; } if ((m/end\.\s*$/i) && ($found_begin = 1)) {$is_pascal = 1;} if ($is_pascal) { last; } } close($PASCAL_FILE); return $is_pascal; } # 1}}} sub really_is_php { # {{{1 # Given filename, returns TRUE if its contents really is php. my $filename = shift; chomp($filename); my $is_php = 0; # Value to determine. # Need to find a matching pair of surrounds, with ending after beginning: my $normal_surround = 0; # my $script_surround = 0; # ; bit 0 = ================================================ FILE: tests/inputs/Java.java ================================================ // from http://www.roesler-ac.de/wolfram/hello.htm // Hello World in Java // 2016-12-02: additional code by https://github.com/filippucher1 // to test /* within quoted string github issue #140 @Controller @RequestMapping( "/path/*" ) public class ControllerClass { /** * javadoc * style */ /* block comment 1 - on one line */ /* block comment 2 */ /* * block comment 3 */ import java.io.*; class HelloWorld { static public void main( String args[] ) { System.out.println( "Hello World!" ); } } ================================================ FILE: tests/inputs/JetCar.cls ================================================ ' https://github.com/badcodes/vb6.git NextPage/JetCar.cls VERSION 1.0 CLASS BEGIN MultiUse = -1 'True Persistable = 0 'NotPersistable DataBindingBehavior = 0 'vbNone DataSourceBehavior = 0 'vbNone MTSTransactionMode = 0 'NotAnMTSObject END Attribute VB_Name = "JetCar" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = True Attribute VB_PredeclaredId = False Attribute VB_Exposed = True Option Explicit Public Sub AddUrlList(params) Dim l As Long Dim pCount As Long Dim fTmp As String Do fTmp = BuildPath(Environ$("temp"), "NextPage." & Int(Rnd(Time) * 1000 + 1)) Loop While PathExists(fTmp) If PathExists(fTmp) Then Kill fTmp Open fTmp For Output As #10 pCount = UBound(params) For l = 0 To pCount Print #10, params(l) Next Close #10 Shell BuildPath(App.Path, "NextPage.exe") & " " & fTmp, vbNormalFocus 'JetCarCatch.AddUrlList params End Sub Public Sub AddUrl(URL) Dim fTmp As String Do fTmp = BuildPath(Environ$("temp"), "NextPage." & Int(Rnd(Time) * 1000 + 1)) Loop While PathExists(fTmp) If PathExists(fTmp) Then Kill fTmp Open fTmp For Output As #10 Print #10, URL Close #10 Shell BuildPath(App.Path, "NextPage.exe") & " " & fTmp, vbNormalFocus End Sub ================================================ FILE: tests/inputs/LaTeX.tex ================================================ % ftp://tug.ctan.org/tex-archive/macros/latex/base/sample2e.tex % This is a sample LaTeX input file. (Version of 12 August 2004.) % % A '%' character causes TeX to ignore all remaining text on the line, % and is used for comments like this one. \documentclass{article} % Specifies the document class % The preamble begins here. \title{An Example Document} % Declares the document's title. \author{Leslie Lamport} % Declares the author's name. \date{January 21, 1994} % Deleting this command produces today's date. \newcommand{\ip}[2]{(#1, #2)} % Defines \ip{arg1}{arg2} to mean % (arg1, arg2). %\newcommand{\ip}[2]{\langle #1 | #2\rangle} % This is an alternative definition of % \ip that is commented out. \begin{document} % End of preamble and beginning of text. \maketitle % Produces the title. This is an example input file. Comparing it with the output it generates can show you how to produce a simple document of your own. \section{Ordinary Text} % Produces section heading. Lower-level % sections are begun with similar % \subsection and \subsubsection commands. The ends of words and sentences are marked by spaces. It doesn't matter how many spaces you type; one is as good as 100. The end of a line counts as a space. One or more blank lines denote the end of a paragraph. Since any number of consecutive spaces are treated like a single one, the formatting of the input file makes no difference to \LaTeX, % The \LaTeX command generates the LaTeX logo. but it makes a difference to you. When you use \LaTeX, making your input file as easy to read as possible will be a great help as you write your document and when you change it. This sample file shows how you can add comments to your own input file. Because printing is different from typewriting, there are a number of things that you have to do differently when preparing an input file than if you were just typing the document directly. Quotation marks like ``this'' have to be handled specially, as do quotes within quotes: ``\,`this' % \, separates the double and single quote. is what I just wrote, not `that'\,''. Dashes come in three sizes: an intra-word dash, a medium dash for number ranges like 1--2, and a punctuation dash---like this. A sentence-ending space should be larger than the space between words within a sentence. You sometimes have to type special commands in conjunction with punctuation characters to get this right, as in the following sentence. Gnats, gnus, etc.\ all % `\ ' makes an inter-word space. begin with G\@. % \@ marks end-of-sentence punctuation. You should check the spaces after periods when reading your output to make sure you haven't forgotten any special cases. Generating an ellipsis \ldots\ % `\ ' is needed after `\ldots' because TeX % ignores spaces after command names like \ldots % made from \ + letters. % % Note how a `%' character causes TeX to ignore % the end of the input line, so these blank lines % do not start a new paragraph. % with the right spacing around the periods requires a special command. \LaTeX\ interprets some common characters as commands, so you must type special commands to generate them. These characters include the following: \$ \& \% \# \{ and \}. In printing, text is usually emphasized with an \emph{italic} type style. \begin{em} A long segment of text can also be emphasized in this way. Text within such a segment can be given \emph{additional} emphasis. \end{em} It is sometimes necessary to prevent \LaTeX\ from breaking a line where it might otherwise do so. This may be at a space, as between the ``Mr.''\ and ``Jones'' in ``Mr.~Jones'', % ~ produces an unbreakable interword space. or within a word---especially when the word is a symbol like \mbox{\emph{itemnum}} that makes little sense when hyphenated across lines. Footnotes\footnote{This is an example of a footnote.} pose no problem. \LaTeX\ is good at typesetting mathematical formulas like \( x-3y + z = 7 \) or \( a_{1} > x^{2n} + y^{2n} > x' \) or \( \ip{A}{B} = \sum_{i} a_{i} b_{i} \). The spaces you type in a formula are ignored. Remember that a letter like $x$ % $ ... $ and \( ... \) are equivalent is a formula when it denotes a mathematical symbol, and it should be typed as one. \section{Displayed Text} Text is displayed by indenting it from the left margin. Quotations are commonly displayed. There are short quotations \begin{quote} This is a short quotation. It consists of a single paragraph of text. See how it is formatted. \end{quote} and longer ones. \begin{quotation} This is a longer quotation. It consists of two paragraphs of text, neither of which are particularly interesting. This is the second paragraph of the quotation. It is just as dull as the first paragraph. \end{quotation} Another frequently-displayed structure is a list. The following is an example of an \emph{itemized} list. \begin{itemize} \item This is the first item of an itemized list. Each item in the list is marked with a ``tick''. You don't have to worry about what kind of tick mark is used. \item This is the second item of the list. It contains another list nested inside it. The inner list is an \emph{enumerated} list. \begin{enumerate} \item This is the first item of an enumerated list that is nested within the itemized list. \item This is the second item of the inner list. \LaTeX\ allows you to nest lists deeper than you really should. \end{enumerate} This is the rest of the second item of the outer list. It is no more interesting than any other part of the item. \item This is the third item of the list. \end{itemize} You can even display poetry. \begin{verse} There is an environment for verse \\ % The \\ command separates lines Whose features some poets % within a stanza. will curse. % One or more blank lines separate stanzas. For instead of making\\ Them do \emph{all} line breaking, \\ It allows them to put too many words on a line when they'd rather be forced to be terse. \end{verse} Mathematical formulas may also be displayed. A displayed formula is one-line long; multiline formulas require special formatting instructions. \[ \ip{\Gamma}{\psi'} = x'' + y^{2} + z_{i}^{n}\] Don't start a paragraph with a displayed equation, nor make one a paragraph by itself. \end{document} % End of document. ================================================ FILE: tests/inputs/Lanczos.m ================================================ function [phiKM, AscendingLambda] = Lanczos(K, M, sigma, Jmax) [rows,cols] = size(K); if (rows ~= cols) fprintf('Lanczos needs square matrices'); end Z = K - sigma*M; % initialize some Q = zeros(rows,Jmax+1); % variables T = zeros(Jmax,Jmax); % rRand = randn(rows,1); % rOld = rRand; betaOld = sqrt(rOld'*M*rOld); % for j = 1:Jmax, % Q(:,j+1) = rOld/betaOld; % u = Z \ (M*Q(:,j+1) - Z*Q(:,j)*betaOld); % D.S.Scott's formulation alpha = Q(:,j+1)'*M*u; % of the recurrence r = u - alpha*Q(:,j+1); % for i=1:3, % sum = zeros(rows,1); % repeat a full orhto- for k=2:j+1, % gonalization three sum = sum + (Q(:,k)'*M*r)*Q(:,k); % times to ensure end; % high quality r = r - sum; % solutions end; % beta = sqrt(r'*M*r); % T(j,j) = alpha; % if (j ~= Jmax) % augment [T] with new T(j+1,j) = beta; % alpha_i, beta_i+1 T(j,j+1) = beta; % end; % Jactual = j; % if (abs(beta) < 1.0e-12) % singular beta; going break % any more will introduce end % spurious modes betaOld = beta; % rOld = r; % end % [phiT,lambdaT] = eig(T(1:Jactual,1:Jactual)); % solve [T]{y} = L{y} lambdaKM = zeros(Jactual,1); % for j = 1:Jactual, % invert and shift the lambdaKM(j) = sigma + 1/lambdaT(j,j); % eigenvalues to the end % user's domain [AscendingLambda, ordering] = sort(lambdaKM); % phiKM = zeros(rows,Jactual); % sort the eigenvalues UnOrdphiKM = zeros(rows,Jactual); % in ascending order UnOrdphiKM = Q(:,2:Jactual+1)*phiT; % for j = 1:Jactual, % resequence the e-vectors phiKM(:,j) = UnOrdphiKM(:,ordering(j)); % to correspond to the end % e-values ================================================ FILE: tests/inputs/LogMain.re ================================================ /* LogMain.re */ /* * Example from http://2ality.com/2017/12/modules-reasonml.html */ let () = Log.make() |> Log.logStr(" /* Hello") /* another comment */ |> Log.logStr("everyone") |> Log.print; /* Output: Hello everyone */ ================================================ FILE: tests/inputs/Lookup.agda ================================================ {- https://raw.githubusercontent.com/agda/agda/master/examples/Lookup.agda -} module Lookup where data Bool : Set where false : Bool true : Bool data IsTrue : Bool -> Set where isTrue : IsTrue true data List (A : Set) : Set where [] : List A _::_ : A -> List A -> List A data _×_ (A B : Set) : Set where _,_ : A -> B -> A × B module Map {- comment -} (Key : Set) (_==_ : Key -> Key -> Bool) (Code : Set) (Val : Code -> Set) where infixr 40 _⟼_,_ infix 20 _∈_ data Map : List Code -> Set where ε : Map [] _⟼_,_ : forall {c cs} -> Key -> Val c -> Map cs -> Map (c :: cs) _∈_ : forall {cs} -> Key -> Map cs -> Bool k ∈ ε = false k ∈ (k' ⟼ _ , m) with k == k' ... | true = true ... | false = k ∈ m Lookup : forall {cs} -> (k : Key)(m : Map cs) -> IsTrue (k ∈ m) -> Set Lookup k ε () Lookup k (_⟼_,_ {c} k' _ m) p with k == k' ... | true = Val c ... | false = Lookup k m p lookup : {cs : List Code}(k : Key)(m : Map cs)(p : IsTrue (k ∈ m)) -> Lookup k m p lookup k ε () lookup k (k' ⟼ v , m) p with k == k' ... | true = v ... | false = lookup k m p ================================================ FILE: tests/inputs/MSDOS.bat ================================================ REM from http://www.roesler-ac.de/wolfram/hello.htm @ECHO OFF REM Hello World for DOS batch ECHO Hello World! ================================================ FILE: tests/inputs/Makefile ================================================ ############################################################################ # # Program: ARPACK # # Module: Makefile # # Purpose: Sources Makefile # # Creation date: February 22, 1996 # # Modified:a September 9, 1996 # # Send bug reports, comments or suggestions to arpack.caam.rice.edu # ############################################################################ #\SCCS Information: @(#) # FILE: Makefile SID: 2.2 DATE OF SID: 9/24/96 RELEASE: 2 include ../ARmake.inc ############################################################################ # To create or add to the library, enter make followed by one or # more of the precisions desired. Targets sdrv, ddrv, cdrv, # zdrv are used to add to the library LAPACK routines needed by driver # programs in the EXAMPLES directory. # # Some examples: # make single # make single sdrv # make single complex # make single double complex complex16 # Alternatively, the command # make # without any arguments creates a library of all four precisions. # The library also contains all extra BLAS routines used by driver # programs in the EXAMPLES directory. # # The name of the library is defined by $(ARPACKLIB) in # ../ARmake.inc and is created at the next higher directory level. # # SOBJ = sgeqr2.o slabad.o slacon.o slacpy.o sladiv.o slae2.o slaev2.o\ slaexc.o slagtm.o slahqr.o slaln2.o slamch.o slange.o slanhs.o\ slanst.o slanv2.o slaptm.o slapy2.o slapy3.o slaran.o slarf.o\ slarfg.o slarfx.o slarnd.o slarnv.o slartg.o slaruv.o slascl.o\ slaset.o slasr.o slasrt.o slassq.o slasy2.o sorm2r.o ssteqr.o\ strevc.o strexc.o strsen.o strsyl.o DOBJ = dgeqr2.o dlabad.o dlacon.o dlacpy.o dladiv.o dlae2.o dlaev2.o\ dlaexc.o dlagtm.o dlahqr.o dlaln2.o dlamch.o dlange.o dlanhs.o\ dlanst.o dlanv2.o dlaptm.o dlapy2.o dlapy3.o dlaran.o dlarf.o\ dlarfg.o dlarfx.o dlarnd.o dlarnv.o dlartg.o dlaruv.o dlascl.o\ dlaset.o dlasr.o dlasrt.o dlassq.o dlasy2.o dorm2r.o dsteqr.o\ dtrevc.o dtrexc.o dtrsen.o dtrsyl.o IOBJ = ilaenv.o lsame.o lsamen.o xerbla.o xlaenv.o CIOBJ = icmax1.o ZIOBJ = izmax1.o COBJ = cgeqr2.o clacon.o clacpy.o cladiv.o clahqr.o clange.o clanhs.o\ clarf.o clarfg.o clarnv.o clartg.o clascl.o claset.o classq.o\ clatrs.o cmach.o crot.o ctrevc.o ctrexc.o ctrsen.o ctrsyl.o\ cunm2r.o\ scsum1.o slabad.o sladiv.o slamch.o slapy2.o slapy3.o slaruv.o ZOBJ = zgeqr2.o zlacon.o zlacpy.o zladiv.o zlahqr.o zlange.o zlanhs.o\ zlarf.o zlarfg.o zlarnv.o zlartg.o zlascl.o zlaset.o zlassq.o\ zlatrs.o zmach.o zrot.o ztrevc.o ztrexc.o ztrsen.o ztrsyl.o\ zunm2r.o\ dzsum1.o dlabad.o dladiv.o dlamch.o dlapy2.o dlapy3.o dlaruv.o # # The following LAPACK routines are not needed by ARPACK # source code. They are used by the drivers in EXAMPLES # directory. # SDRVOBJ = sgbtf2.o sgbtrf.o sgbtrs.o sgttrf.o sgttrs.o spttrf.o spttrs.o\ slaswp.o DDRVOBJ = dgbtf2.o dgbtrf.o dgbtrs.o dgttrf.o dgttrs.o dpttrf.o dpttrs.o\ dlaswp.o CDRVOBJ = cgbtf2.o cgbtrf.o cgbtrs.o cgttrf.o cgttrs.o claswp.o clacgv.o ZDRVOBJ = zgbtrf.o zgbtrs.o zgbtf2.o zgttrf.o zgttrs.o zlaswp.o zlacgv.o .SUFFIXES: .o .F .f .f.o: $(FC) $(FFLAGS) -c $< all: single double complex complex16 sdrv ddrv cdrv zdrv single: $(SOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(SOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) double: $(DOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(DOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) complex: $(COBJ) $(CIOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(COBJ) $(CIOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) complex16: $(ZOBJ) $(ZIOBJ) $(IOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(ZOBJ) $(ZIOBJ) $(IOBJ) $(RANLIB) $(ARPACKLIB) # # Add routines needed by driver programs (in the EXAMPLES # directory) to $(ARPACKLIB). # sdrv: $(SDRVOBJ) $(CDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(SDRVOBJ) $(CDRVOBJ) $(RANLIB) $(ARPACKLIB) ddrv: $(DDRVOBJ) $(ZDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(DDRVOBJ) $(ZDRVOBJ) $(RANLIB) $(ARPACKLIB) cdrv: $(CDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(CDRVOBJ) $(RANLIB) $(ARPACKLIB) zdrv: $(ZDRVOBJ) $(AR) $(ARFLAGS) $(ARPACKLIB) $(ZDRVOBJ) $(RANLIB) $(ARPACKLIB) # clean - remove all object files # clean: rm -f *.o a.out core ================================================ FILE: tests/inputs/Mako.mako ================================================ ## This is the test file for mako extenstion ## As Mako can be used as a template to render almost any other ## language we only count mako comments as comments.
    % for x in range(10):
  1. ${strong(x)}
  2. % endfor
<%def name="strong(x)"> ${x} ## Result: ## Lines: 20 ## Code: 9 ## Comment: 8 ## Blank: 3 ================================================ FILE: tests/inputs/Mathematica_1.m ================================================ (* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html *) image = Import["denise.png","PNG"] (* or *) image = Import["denise.gif","GIF"] A = image[[1,1]]/255.; ListDensityPlot[A,Mesh->False, AspectRatio->Automatic] (* -- or -- *) Show[Graphics[Raster[A]], AspectRatio->Automatic] blurA = ListConvolve[Table[1/25,{5},{5}],A]; Show[Graphics[Raster[blurA]], AspectRatio->Automatic] B = Fourier[A]; (* delete higher frequencies *) B[[Range[30,278],All]]=0; B[[All,Range[30,202]]]=0; Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic] ================================================ FILE: tests/inputs/Mathematica_2.wlt ================================================ (* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html *) image = Import["denise.png","PNG"] (* or *) image = Import["denise.gif","GIF"] A = image[[1,1]]/255.; ListDensityPlot[A,Mesh->False, AspectRatio->Automatic] (* -- or -- *) Show[Graphics[Raster[A]], AspectRatio->Automatic] blurA = ListConvolve[Table[1/25,{5},{5}],A]; Show[Graphics[Raster[blurA]], AspectRatio->Automatic] B = Fourier[A]; (* delete higher frequencies *) B[[Range[30,278],All]]=0; B[[All,Range[30,202]]]=0; Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic] ================================================ FILE: tests/inputs/Mojo.mojom ================================================ // Mojo files usually start with a multiline comment and/or copyright // statement. They are otherwise quite close to C++ files. module example_service.mojom; import "mojo/public/mojom/base/time.mojom"; import "some/other/project/base.mojom"; enum BasicEnum { kField1, kField2, }; struct BasicStruct { // Comment about a field. mojo_base.mojom.TimeDelta duration; }; [annotation] interface ExampleInterface { // Returns a thing from a place using its arguments. DecodeInput(array input_data, BasicEnum value, bool flag, int64 size_of_the_thing) => (BasicStruct? result_maybe); Frobnicate(map?>?>?> ridiculous) => (array guid); }; ================================================ FILE: tests/inputs/Mumps.mps ================================================ ; from http://www.roesler-ac.de/wolfram/hello.htm ; Hello World in Mumps-M w !,"Hello World" ================================================ FILE: tests/inputs/Octave.m ================================================ % from http://www.roesler-ac.de/wolfram/hello.htm #Hello World in Octave (http://www.octave.org/) printf("Hello World\n"); ================================================ FILE: tests/inputs/Once.HC ================================================ /* https://raw.githubusercontent.com/cia-foundation/TempleOS/archive/Once.HC */ //Place this file in /Home and change //anything you want. //This file is executed by the //first terminal window upon start-up. //See $LK,"Once",A="FF:~/HomeSys.HC,Once"$ and $LK,"Home Files",A="FF:::/Doc/GuideLines.DD,/Home Files"$. //Delete the rest from this file. U0 Tmp() { OnceExe; switch (sys_boot_src.u16[0]) { case BOOT_SRC_ROM: "Continue booting hard drive "; if (YorN) { DocBottom; ExeFile("C:/Home/Once"); } break; case BOOT_SRC_DVD: "\nIf you answer 'No' you can play with\n" "the live CD without installing.\n\n" "Install onto hard drive "; if (YorN) { DocBottom; RunFile("::/Misc/OSInstall",,TRUE); } if (FileFind("::/Misc/Tour")) { "\nTake Tour"; if (YorN) { DocBottom; Cd("::/Misc/Tour"); InFile("Tour"); } } break; /* case BOOT_SRC_RAM: case BOOT_SRC_HARDDRV: "$$PURPLE$$$$TX+CX,\"Tip of the Day\"$$$$FG$$\n"; TipOfDay; Type("::/Doc/Customize.DD"); if */ (FileFind("::/Misc/Tour")) { "\nTake Tour"; if (YorN) { DocBottom; Cd("::/Misc/Tour"); InFile("Tour"); } } break; } } Tmp; ================================================ FILE: tests/inputs/Pascal.p ================================================ (* from http://www.roesler-ac.de/wolfram/hello.htm *) {Hello World in Pascal} program HelloWorld(output); begin WriteLn('Hello World!'); end. ================================================ FILE: tests/inputs/Pascal.pas ================================================ (* from http://www.roesler-ac.de/wolfram/hello.htm *) {Hello World in Pascal} program HelloWorld(output); begin WriteLn('Hello World!'); end. ================================================ FILE: tests/inputs/Pascal.pp ================================================ (* from http://www.roesler-ac.de/wolfram/hello.htm *) {Hello World in Pascal} {! compiler directive, not a comment} program HelloWorld(output); begin WriteLn('Hello World!'); (* *) end. ================================================ FILE: tests/inputs/PlusCalExample.tla ================================================ ---- MODULE PlusCalExample ---- (* TLA+/PlusCal example program. *) (* Multi-line (* nested *) comment *) \* Single-line comment \* The code below appears to be a TLA+ comment but is PlusCal code which should \* always be line-counted. \* Grammar rules for PlusCal are specified in appendices A and C of A PlusCal \* User's Manual: https://lamport.azurewebsites.net/tla/c-manual.pdf (* PlusCal options (-sf) --algorithm Example { process (A = 0) { Start: skip; } } This is a comment line. *) \* The code between BEGIN( )TRANSLATION and END( )TRANSLATION should be \* line-counted as generated code. \* BEGIN TRANSLATION (chksum(pcal) = "7bf2389f" /\ chksum(tla) = "dd78b4d4") VARIABLE pc vars == << pc >> ProcSet == {0} Init == /\ pc = [self \in ProcSet |-> "Start"] Start == /\ pc[0] = "Start" /\ TRUE /\ pc' = [pc EXCEPT ![0] = "Done"] A == Start (* Allow infinite stuttering to prevent deadlock on termination. *) Terminating == /\ \A self \in ProcSet: pc[self] = "Done" /\ UNCHANGED vars Next == A \/ Terminating Spec == /\ Init /\ [][Next]_vars /\ SF_vars(A) Termination == <>(\A self \in ProcSet: pc[self] = "Done") \* END TRANSLATION ==== ================================================ FILE: tests/inputs/Prelude.dhall ================================================ {- https://github.com/dhall-lang/dhall-nethack/raw/master/Prelude.dhall This file provides a central `Prelude` import for the rest of the library to use so that the integrity check only needs to be updated in one place whenever upgrading the interpreter. This allows the user to provide their own Prelude import using the `DHALL_PRELUDE` environment variable, like this: ``` $ export DHALL_PRELUDE='https://prelude.dhall-lang.org/package.dhall sha256:...' ``` Note that overriding the Prelude in this way only works if this repository is imported locally. Remote imports do not have access to environment variables and any attempt to import one will fall back to the next available import. To learn more, read: * https://github.com/dhall-lang/dhall-lang/wiki/Safety-guarantees#cross-site-scripting-xss This file also provides an import without the integrity check as a slower fallback if the user is using a different version of the Dhall interpreter. -} env:DHALL_PRELUDE ? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v8.0.0/Prelude/package.dhall sha256:0c04cbe34f1f2d408e8c8b8cb0aa3ff4d5656336910f7e86190a6d14326f966d ? https://raw.githubusercontent.com/dhall-lang/dhall-lang/v8.0.0/Prelude/package.dhall ================================================ FILE: tests/inputs/ProcessPO.odx ================================================ #if __DESIGNER_DATA #error Do not define __DESIGNER_DATA. #endif // __DESIGNER_DATA [Microsoft.XLANGs.BaseTypes.BPELExportable(false)] module BTSJSON { internal porttype PortType_1 { oneway Operation_1 { PO }; }; internal porttype PortType_2 { oneway Operation_1 { Invoice }; }; [Microsoft.XLANGs.BaseTypes.BPELExportable(false)] internal service ProcessPO { [Microsoft.XLANGs.BaseTypes.LogicalBinding()] port implements PortType_1 ReceiveJSONPO; [Microsoft.XLANGs.BaseTypes.LogicalBinding()] port uses PortType_2 SendJSONInvoice; message PO PurchaseOrder; message Invoice InvoiceMsg; body () { [Microsoft.XLANGs.BaseTypes.DesignerPosition("d478ac91-37ac-418c-b2c8-2f778319667c")] activate receive (ReceiveJSONPO.Operation_1, PurchaseOrder); [Microsoft.XLANGs.BaseTypes.DesignerPosition("959a30c2-92c8-47d1-8df6-7243e961bb23")] construct InvoiceMsg { [Microsoft.XLANGs.BaseTypes.DesignerPosition("ac70f963-dad1-4533-85c1-e8ecd4117659")] transform (InvoiceMsg) = BTSJSON.POToInvoice (PurchaseOrder); } [Microsoft.XLANGs.BaseTypes.DesignerPosition("61187953-153a-45c9-bc90-b537e4765026")] send (SendJSONInvoice.Operation_1, InvoiceMsg); } } } ================================================ FILE: tests/inputs/RedBlackTree.res ================================================ // a portion of https://github.com/github/linguist/raw/master/samples/ReScript/RedBlackTree.res /* Credit to Wikipedia's article on [Red-black tree](http://en.wikipedia.org/wiki/Red–black_tree) **Note:** doesn't handle duplicate entries. This is by design. ## Overview example: ``` var rbt = new RedBlackTree([7, 5, 1, 8]) rbt.add(2) // => 2 rbt.add(10) // => 10 rbt.has(5) // => true rbt.remove(8) // => 8 ``` ## Properties: - size: The total number of items. */ type nodeColor = | Red | Black /* Property of a red-black tree, taken from Wikipedia: 1. A node is either red or black. 2. Root is black. 3. Leaves are all null and considered black. 4. Both children of a red node are black. 5. Every path from a node to any of its descendent leaves contains the same number of black nodes. */ type rec node<'value> = { mutable left: option>, mutable right: option>, mutable parent: option>, mutable sum: float, mutable color : nodeColor, mutable height: float, mutable value: 'value, } type t<'value> = { mutable size: int, mutable root: option>, compare: (. 'value, 'value) => int, } let createNode = (~color, ~value, ~height) => {left:None, right:None, parent:None, sum:0., height, value, color} external castNotOption: option<'a> => 'a = "%identity" let updateSum = (node) => { let leftSum = switch node.left { | None => 0. | Some(left) => left.sum } let rightSum = switch node.right { | None => 0. | Some(right) => right.sum } node.sum = leftSum +. rightSum +. node.height } /* Update the sum for the node and parents recursively. */ let rec updateSumRecursive = (rbt, node) => { updateSum(node) switch node.parent { | None => () | Some(parent) => rbt->updateSumRecursive(parent) } } let grandParentOf = node => { switch node.parent { | None => None | Some(ref_) => ref_.parent } } let isLeft = node => { switch node.parent { | None => false | Some(parent) => Some(node) === parent.left } } let leftOrRightSet = (~node, x, value) => { isLeft(node) ? x.left=value : x.right=value } let siblingOf = node => { if isLeft(node) { castNotOption(node.parent).right } else { castNotOption(node.parent).left } } let uncleOf = node => { switch grandParentOf(node) { | None => None | Some(grandParentOfNode) => if isLeft(castNotOption(node.parent)) { grandParentOfNode.right } else { grandParentOfNode.left } } } let rec findNode = (rbt, node, value) => { switch node { | None => None | Some(node) => let cmp = rbt.compare(. value, node.value) if cmp === 0 { Some(node) } else if cmp < 0 { findNode(rbt, node.left, value) } else { findNode(rbt, node.right, value) } } } let has = (rbt, value) => findNode(rbt, rbt.root, value) !== None let rec peekMinNode = node => switch node { | None => None | Some(node) => node.left === None ? Some(node) : node.left->peekMinNode } let rec peekMaxNode = node => switch node { | None => None | Some(node) => node.right === None ? Some(node) : node.right->peekMaxNode } let rotateLeft = (rbt, node) => { let parent = node.parent let right = node.right switch parent { | Some(parent) => parent->leftOrRightSet(~node, right) | None => rbt.root = right } node.parent = right let right = right->castNotOption // precondition let rightLeft = right.left node.right = rightLeft switch rightLeft { | Some(rightLeft) => rightLeft.parent = Some(node) | None => () } right.parent = parent right.left = Some(node) updateSum(node) updateSum(right) } // After adding the node, we need to operate on it to preserve the tree's // properties by filtering it through a series of cases. It'd be easier if // there's tail recursion in JavaScript, as some cases fix the node but // restart the cases on the node's ancestor. We'll have to use loops for now. let rec _addLoop = (rbt, currentNode) => { // Case 1: node is root. Violates 1. Paint it black. if Some(currentNode) === rbt.root { currentNode.color = Black } // Case 2: parent black. No properties violated. After that, parent is sure // to be red. else if (currentNode.parent->castNotOption).color === Black { () } // Case 3: if node's parent and uncle are red, they are painted black. // Their parent (node's grandparent) should be painted red, and the // grandparent red. Note that node certainly has a grandparent, since at // this point, its parent's red, which can't be the root. // After the painting, the grandparent might violate 2 or 4. else if({ let uncle = uncleOf(currentNode) uncle !== None && (uncle->castNotOption).color === Red }) { (currentNode.parent->castNotOption).color = Black (uncleOf(currentNode)->castNotOption).color = Black (grandParentOf(currentNode)->castNotOption).color = Red _addLoop(rbt, grandParentOf(currentNode)->castNotOption) } else { // At this point, uncle is either black or doesn't exist. // Case 4: parent red, uncle black, node is right child, parent is left // child. Do a left rotation. Then, former parent passes through case 5. let currentNode = if !isLeft(currentNode) && isLeft(currentNode.parent->castNotOption) { rotateLeft(rbt, currentNode.parent->castNotOption) currentNode.left->castNotOption } else if isLeft(currentNode) && !isLeft(currentNode.parent->castNotOption) { rotateRight(rbt, currentNode.parent->castNotOption) currentNode.right->castNotOption } else { currentNode } // Case 5: parent red, uncle black, node is left child, parent is left // child. Right rotation. Switch parent and grandparent's color. (currentNode.parent->castNotOption).color = Black (grandParentOf(currentNode)->castNotOption).color = Red if isLeft(currentNode) { rotateRight(rbt, grandParentOf(currentNode)->castNotOption) } else { rotateLeft(rbt, grandParentOf(currentNode)->castNotOption) } } } ================================================ FILE: tests/inputs/RemoteSiteHelperTest.cls ================================================ // https://github.com/financialforcedev/apex-mdapi.git // apex-mdapi/apex-mdapi/src/classes/RemoteSiteHelperTest.cls @IsTest private class RemoteSiteHelperTest { @IsTest private static void testCheckMetadataAPIConnection() { // Metadata API web Service mock implementation for tests Test.setMock(WebServiceMock.class, new WebServiceMockImpl()); RemoteSiteHelperController controller = new RemoteSiteHelperController(); System.assertEquals(true, controller.MetadataConnectionWarning); controller.MetadataResponse = ''; controller.displayMetadataResponse(); System.assertEquals(false, controller.MetadataConnectionWarning); controller.MetadataResponse = 'Some Error Creating Remote Site Setting'; controller.displayMetadataResponse(); System.assertEquals(true, controller.MetadataConnectionWarning); } /** * Metadata API web service mock class for tests above **/ private class WebServiceMockImpl implements WebServiceMock { public void doInvoke( Object stub, Object request, Map response, String endpoint, String soapAction, String requestName, String responseNS, String responseName, String responseType) { throw new TestException(); } } public class TestException extends Exception { } } ================================================ FILE: tests/inputs/RenderTest.metal ================================================ // // RenderTest.metal // RenderTest // #include using namespace metal; #include "RenderTest.h" // Vertex Shader Output struct RenderTestVertexOut { float4 position [[position]]; float pointSize [[point_size]]; float3 color; }; vertex RenderTestVertexOut renderPointVertex(uint vertexID [[vertex_id]], constant RenderTestUniforms &uniforms [[buffer(0)]], constant TestPoint *points [[buffer(1)]]) { RenderPointVertexOut out; out.position = points[vertexID].position; out.pointSize = uniforms.particleSize; out.color = float3(1,0,0); return out; } fragment float4 renderTestFragment(RenderTestVertexOut in [[stage_in]]) { return float4(in.color, 1); } // // RenderTest.metal // RenderTest // #include using namespace metal; #include "RenderTest.h" // Vertex Shader Output struct RenderTestVertexOut { float4 position [[position]]; float pointSize [[point_size]]; float3 color; }; vertex RenderTestVertexOut renderPointVertex(uint vertexID [[vertex_id]], constant RenderTestUniforms &uniforms [[buffer(0)]], constant TestPoint *points [[buffer(1)]]) { RenderPointVertexOut out; out.position = points[vertexID].position; out.pointSize = uniforms.particleSize; out.color = float3(1,0,0); return out; } fragment float4 renderTestFragment(RenderTestVertexOut in [[stage_in]]) { return float4(in.color, 1); } ================================================ FILE: tests/inputs/Rounds.scad ================================================ // https://raw.githubusercontent.com/UBaer21/UB.scad/main/examples/UBexamples/Rounds.scad include//https://github.com/UBaer21/UB.scad /*[Hidden]*/ useVersion=22.016; designVersion=1.1; info=true; /*[ Round Objects ]*/ r=[16,8,4,2]; // corner 1-4 radius - can also be just a number LinEx(20) Quad(20); LinEx() Quad([25,30],r=r); Tz(20)LinEx2()Rund(1,2)Stern(5,r1=12,r2=5); Rundrum(x=30,y=40,r=r)Quad(x=15,y=20,r=r/2,center=false); Tz(30)Rundrum(x=15,eck=3,r=3)Quad(x=5,y=3,r=1,center=false); T(50)Pille(l=20,d=10); T(65)Pille(l=20,d=10,rad=[1,15]); T(80)Pille(l=20,d=10,rad=1); T(-50) { RotEx()T(10)Pille(); RotEx()T(-8)Pille(); } T(-80) Kassette(gon=3,r=5,help=1); T(-80,30) Kassette(gon=4,r=[5,2,4,1],mitte=false,help=1); T(-80,60)Rundrum(20,20,r=5,grad=60,grad2=120)rotate(90)Vollwelle(extrude=1); T(-50,30) RotEx()T(10)Quad(5); T(y=-60){ Prisma(10,20,30,c1=5,s=3); T(15)Prisma(10,20,30,x2=5,y2=10,c1=5,s=3); T(30)Prisma(10,20,30,x2=5,y2=10,x2d=10,c1=5,s=3); T(60) Box(20,z=20,eck=5,s=5,c=10,outer=false);// outer = x= side radius or edge T(-30) Tz(15)Superellipse(r=[10,20,30]/2,help=1); T(-50) Tz(15)Superellipse(r=[10,20,30]/2,n=10); T(-70) Tz(15)Superellipse(r=[10,20,30]/2,n=4,n3=20); } T(y=90){ Torus(trx=5,help=1); Torus(dia=30,d=5,end=true); Torus(dia=43,d=5,end=1,grad=270); Torus(dia=59,d=5,end=+10,grad=270)Quad($d,10); Torus(dia=79,trxEnd=-9,d=5,end=1,grad=270)Quad($d,10); T(80) Polar(3)RingSeg(120,r=15,help=1,size=3,h=5,fn2=16); } T(y=160){ RStern(); T(x=50) RStern(messpunkt=0)circle(); } ================================================ FILE: tests/inputs/Sample.mc ================================================ ; /* http://msdn.microsoft.com/en-us/library/windows/desktop/dd996907%28v=vs.85%29.aspx ; more comments ; */ ; // ***** Sample.mc ***** ; // This is the header section. MessageIdTypedef=DWORD SeverityNames=(Success=0x0:STATUS_SEVERITY_SUCCESS Informational=0x1:STATUS_SEVERITY_INFORMATIONAL Warning=0x2:STATUS_SEVERITY_WARNING Error=0x3:STATUS_SEVERITY_ERROR ) FacilityNames=(System=0x0:FACILITY_SYSTEM Runtime=0x2:FACILITY_RUNTIME Stubs=0x3:FACILITY_STUBS Io=0x4:FACILITY_IO_ERROR_CODE ) LanguageNames=(English=0x409:MSG00409) LanguageNames=(Japanese=0x411:MSG00411) ; // The following are message definitions. MessageId=0x1 Severity=Error Facility=Runtime SymbolicName=MSG_BAD_COMMAND Language=English You have chosen an incorrect command. . Language=Japanese . MessageId=0x2 Severity=Warning Facility=Io SymbolicName=MSG_BAD_PARM1 Language=English Cannot reconnect to the server. . Language=Japanese . MessageId=0x3 Severity=Success Facility=System SymbolicName=MSG_STRIKE_ANY_KEY Language=English Press any key to continue . . . %0 . Language=Japanese . MessageId=0x4 Severity=Error Facility=System SymbolicName=MSG_CMD_DELETE Language=English File %1 contains %2 which is in error. . Language=Japanese . MessageId=0x5 Severity=Informational Facility=System SymbolicName=MSG_RETRYS Language=English There have been %1!d! attempts with %2!d!%% success%! Disconnect from the server and try again later. . Language=Japanese . ================================================ FILE: tests/inputs/SimpleODE.mo ================================================ /* based on https://raw.githubusercontent.com/casella/ScalableTestSuite/master/ScalableTestSuite/Elementary/SimpleODE.mo */ within ScalableTestSuite.Elementary; package SimpleODE "Models with simple ODE systems" package Models model CascadedFirstOrder "N cascaded first order systems, approximating a pure delay" parameter Integer N = 10 "Order of the system"; parameter Modelica.Units.SI.Time T=1 "System delay"; final parameter Modelica.Units.SI.Time tau=T/N "Individual time constant"; Real x[N]( each start = 0, each fixed = true) "State array"; Real u = 1 "Cascaded system input"; equation tau*der(x[1]) = u - x[1]; for i in 2:N loop tau*der(x[i]) = x[i-1] - x[i]; end for; annotation( experiment(StopTime = 2,Tolerance = 1e-6), Documentation(info = "

This model is meant to try out the tool performance with ODE systems of possibly very large size, with high sparsity degree.

The model is a cascaded connection of first order linear systems, approximating a pure delay of T seconds as N approaches infinity. It contains exactly N state variables and N differential equations.

")); end CascadedFirstOrder; end Models; package ScaledExperiments model CascadedFirstOrder_N_100 extends Models.CascadedFirstOrder(N=100); annotation(experiment(StopTime = 2, Tolerance = 1e-6), __OpenModelica_simulationFlags(s = "ida")); end CascadedFirstOrder_N_100; // model CascadedFirstOrder_N_200 // extends Models.CascadedFirstOrder(N=200); // annotation(experiment(StopTime = 2, Tolerance = 1e-6), // __OpenModelica_simulationFlags(s = "ida")); // end CascadedFirstOrder_N_200; model CascadedFirstOrder_N_400 extends Models.CascadedFirstOrder(N=400); annotation(experiment(StopTime = 2, Tolerance = 1e-6), __OpenModelica_simulationFlags(s = "ida")); end CascadedFirstOrder_N_400; model CascadedFirstOrder_N_25600 extends Models.CascadedFirstOrder(N=25600); annotation(experiment(StopTime = 2, Tolerance = 1e-6), __OpenModelica_simulationFlags(s = "ida")); end CascadedFirstOrder_N_25600; end ScaledExperiments; end SimpleODE; ================================================ FILE: tests/inputs/Slim.html.slim ================================================
================================================ FILE: tests/inputs/Slint-helloworld.slint ================================================ component MyButton inherits Text { color: black; // ... } export component MyApp inherits Window { preferred-width: 200px; preferred-height: 100px; Rectangle { width: 200px; height: 100px; background: green; }/* */ MyButton { x:0;y:0; // hello text: "hello"; } MyButton { // world y:0; x: 50px; text: "world"; } } ================================================ FILE: tests/inputs/Snakefile ================================================ """ A sample Snakefile for testing line counting """ SAMPLES = ["A", "B"] # This is a # multiline # comment rule all: input: "plots/quals.svg" rule bwa_map: input: "data/genome.fa", # Inline comments are also supported "data/samples/{sample}.fastq" output: "mapped_reads/{sample}.bam" shell: "bwa mem {input} | samtools view -Sb - > {output}" rule samtools_sort: input: "mapped_reads/{sample}.bam" output: "sorted_reads/{sample}.bam" shell: "samtools sort -T sorted_reads/{wildcards.sample} " "-O bam {input} > {output}" rule samtools_index: input: "sorted_reads/{sample}.bam" output: "sorted_reads/{sample}.bam.bai" shell: "samtools index {input}" rule bcftools_call: input: fa="data/genome.fa", bam=expand("sorted_reads/{sample}.bam", sample=SAMPLES), bai=expand("sorted_reads/{sample}.bam.bai", sample=SAMPLES) output: "calls/all.vcf" shell: "bcftools mpileup -f {input.fa} {input.bam} | " "bcftools call -mv - > {output}" rule plot_quals: input: "calls/all.vcf" output: "plots/quals.svg" script: "scripts/plot-quals.py" ================================================ FILE: tests/inputs/Splice.hs-boot ================================================ -- https://gitlab.haskell.org/ghc/ghc.git -- ghc/compiler/GHC/Tc/Gen/Splice.hs-boot {-# LANGUAGE TypeFamilies #-} module GHC.Tc.Gen.Splice where import GHC.Prelude import GHC.Types.Name import GHC.Hs.Expr ( PendingRnSplice, DelayedSplice ) import GHC.Tc.Types( TcM , SpliceType ) import GHC.Tc.Utils.TcType ( ExpRhoType ) import GHC.Types.Annotations ( Annotation, CoreAnnTarget ) import GHC.Hs.Extension ( GhcRn, GhcPs, GhcTc ) import GHC.Hs ( HsQuote, HsExpr, LHsExpr, LHsType, LPat, LHsDecl, ThModFinalizers, HsUntypedSpliceResult, HsTypedSpliceResult, HsTypedSplice ) import qualified GHC.Boot.TH.Syntax as TH import qualified GHC.Boot.TH.Monad as TH tcTypedSplice :: HsTypedSpliceResult -> HsTypedSplice GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) tcTypedBracket :: HsExpr GhcRn -> LHsExpr GhcRn -> ExpRhoType -> TcM (HsExpr GhcTc) tcUntypedBracket :: HsExpr GhcRn -> HsQuote GhcRn -> [PendingRnSplice] -> ExpRhoType -> TcM (HsExpr GhcTc) runTopSplice :: DelayedSplice -> TcM (HsExpr GhcTc) runAnnotation :: CoreAnnTarget -> LHsExpr GhcRn -> TcM Annotation getUntypedSpliceBody :: HsUntypedSpliceResult (HsExpr GhcRn) -> TcM (HsExpr GhcRn) tcTopSpliceExpr :: SpliceType -> TcM (LHsExpr GhcTc) -> TcM (LHsExpr GhcTc) runMetaE :: LHsExpr GhcTc -> TcM (LHsExpr GhcPs) runMetaP :: LHsExpr GhcTc -> TcM (LPat GhcPs) runMetaT :: LHsExpr GhcTc -> TcM (LHsType GhcPs) runMetaD :: LHsExpr GhcTc -> TcM [LHsDecl GhcPs] lookupThName_maybe :: TH.Name -> TcM (Maybe Name) runQuasi :: TH.Q a -> TcM a runRemoteModFinalizers :: ThModFinalizers -> TcM () finishTH :: TcM () ================================================ FILE: tests/inputs/Sys.hx ================================================ /* https://raw.githubusercontent.com/HaxeFoundation/haxe/development/std/Sys.hx * Copyright (C)2005-2016 Haxe Foundation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, including without limitation * the rights to use, copy, modify, merge, publish, distribute, sublicense, * and/or sell copies of the Software, and to permit persons to whom the * Software is furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ /** This class gives you access to many base functionalities of system platforms. Looks in `sys` sub packages for more system APIs. **/ @:require(sys) extern class Sys { /** Print any value on the standard output. **/ static function print( v : Dynamic ) : Void; /** Print any value on the standard output, followed by a newline. **/ static function println( v : Dynamic ) : Void; /** Returns all the arguments that were passed by the commandline. **/ static function args() : Array; /** Returns the value of the given environment variable. **/ static function getEnv( s : String ) : String; /** Set the value of the given environment variable. **/ static function putEnv( s : String, v : String ) : Void; /** Returns the whole environement variables. **/ static function environment() : Map; /** Suspend the current execution for the given time (in seconds). **/ static function sleep( seconds : Float ) : Void; /** Change the current time locale, which will affect `DateTools.format` date formating. Returns true if the locale was successfully changed **/ static function setTimeLocale( loc : String ) : Bool; /** Get the current working directory (usually the one in which the program was started) **/ static function getCwd() : String; /** Change the current working directory. **/ static function setCwd( s : String ) : Void; /** Returns the name of the system you are running on. For instance : "Windows", "Linux", "BSD" and "Mac" depending on your desktop OS. **/ static function systemName() : String; /** Run the given command. The command output will be printed on the same output as the current process. The current process will block until the command terminates and it will return the command result (0 if there was no error). Command arguments can be passed in two ways: 1. using `args`, 2. appending to `cmd` and leaving `args` as `null`. 1. When using `args` to pass command arguments, each argument will be automatically quoted, and shell meta-characters will be escaped if needed. `cmd` should be an executable name that can be located in the `PATH` environment variable, or a path to an executable. 2. When `args` is not given or is `null`, command arguments can be appended to `cmd`. No automatic quoting/escaping will be performed. `cmd` should be formatted exactly as it would be when typed at the command line. It can run executables, as well as shell commands that are not executables (e.g. on Windows: `dir`, `cd`, `echo` etc). Read the `sys.io.Process` api for a more complete way to start background processes. **/ static function command( cmd : String, ?args : Array ) : Int; /** Exit the current process with the given error code. **/ static function exit( code : Int ) : Void; /** Gives the most precise timestamp value (in seconds). **/ static function time() : Float; /** Gives the most precise timestamp value (in seconds) but only account for the actual time spent running on the CPU for the current thread/process. **/ static function cpuTime() : Float; /** Returns the path to the current executable that we are running. **/ @:deprecated("Use programPath instead") static function executablePath() : String; /** Returns the absolute path to the current program file that we are running. Concretely, for an executable binary, it returns the path to the binary. For a script (e.g. a PHP file), it returns the path to the script. **/ static function programPath() : String; /** Read a single input character from the standard input (without blocking) and returns it. Setting `echo` to true will also display it on the output. **/ static function getChar( echo : Bool ) : Int; /** Returns the process standard input, from which you can read what user enters. Usually it will block until the user send a full input line. See `getChar` for an alternative. **/ static function stdin() : haxe.io.Input; /** Returns the process standard output on which you can write. **/ static function stdout() : haxe.io.Output; /** Returns the process standard error on which you can write. **/ static function stderr() : haxe.io.Output; } ================================================ FILE: tests/inputs/TLAExample.tla ================================================ ---- MODULE TLAExample ---- (* TLA+ example program. *) (* Multi-line (* nested *) comment *) \* Single-line comment VARIABLES tlaIsCool Init == tlaIsCool = TRUE Next == tlaIsCool = TRUE /\ tlaIsCool' = TRUE ==== ================================================ FILE: tests/inputs/TableGen-ARM.td ================================================ //===-- ARM.td - Describe the ARM Target Machine -----------*- tablegen -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // // //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // Target-independent interfaces which we are implementing //===----------------------------------------------------------------------===// include "llvm/Target/Target.td" //===----------------------------------------------------------------------===// // ARM Subtarget state. // def ModeThumb : SubtargetFeature<"thumb-mode", "InThumbMode", "true", "Thumb mode">; def ModeSoftFloat : SubtargetFeature<"soft-float","UseSoftFloat", "true", "Use software floating " "point features.">; //===----------------------------------------------------------------------===// // ARM Subtarget features. // // Floating Point, HW Division and Neon Support // FP loads/stores/moves, shared between VFP and MVE (even in the integer-only // version). def FeatureFPRegs : SubtargetFeature<"fpregs", "HasFPRegs", "true", "Enable FP registers">; // 16-bit FP loads/stores/moves, shared between VFP (with the v8.2A FP16 // extension) and MVE (even in the integer-only version). def FeatureFPRegs16 : SubtargetFeature<"fpregs16", "HasFPRegs16", "true", "Enable 16-bit FP registers", [FeatureFPRegs]>; def FeatureFPRegs64 : SubtargetFeature<"fpregs64", "HasFPRegs64", "true", "Enable 64-bit FP registers", [FeatureFPRegs]>; def FeatureFP64 : SubtargetFeature<"fp64", "HasFP64", "true", "Floating point unit supports " "double precision", [FeatureFPRegs64]>; def FeatureD32 : SubtargetFeature<"d32", "HasD32", "true", "Extend FP to 32 double registers">; multiclass VFPver prev, list otherimplies, list vfp2prev = []> { def _D16_SP: SubtargetFeature< name#"d16sp", query#"D16SP", "true", description#" with only 16 d-registers and no double precision", !foreach(v, prev, !cast(v # "_D16_SP")) # !foreach(v, vfp2prev, !cast(v # "_SP")) # otherimplies>; def _SP: SubtargetFeature< name#"sp", query#"SP", "true", description#" with no double precision", !foreach(v, prev, !cast(v # "_SP")) # otherimplies # [FeatureD32, !cast(NAME # "_D16_SP")]>; def _D16: SubtargetFeature< name#"d16", query#"D16", "true", description#" with only 16 d-registers", !foreach(v, prev, !cast(v # "_D16")) # vfp2prev # otherimplies # [FeatureFP64, !cast(NAME # "_D16_SP")]>; def "": SubtargetFeature< name, query, "true", description, prev # otherimplies # [ !cast(NAME # "_D16"), !cast(NAME # "_SP")]>; } def FeatureVFP2_SP : SubtargetFeature<"vfp2sp", "HasVFPv2SP", "true", "Enable VFP2 instructions with " "no double precision", [FeatureFPRegs]>; def FeatureVFP2 : SubtargetFeature<"vfp2", "HasVFPv2", "true", "Enable VFP2 instructions", [FeatureFP64, FeatureVFP2_SP]>; defm FeatureVFP3: VFPver<"vfp3", "HasVFPv3", "Enable VFP3 instructions", [], [], [FeatureVFP2]>; def FeatureNEON : SubtargetFeature<"neon", "HasNEON", "true", "Enable NEON instructions", [FeatureVFP3]>; def FeatureFP16 : SubtargetFeature<"fp16", "HasFP16", "true", "Enable half-precision " "floating point">; defm FeatureVFP4: VFPver<"vfp4", "HasVFPv4", "Enable VFP4 instructions", [FeatureVFP3], [FeatureFP16]>; defm FeatureFPARMv8: VFPver<"fp-armv8", "HasFPARMv8", "Enable ARMv8 FP", [FeatureVFP4], []>; def FeatureFullFP16 : SubtargetFeature<"fullfp16", "HasFullFP16", "true", "Enable full half-precision " "floating point", [FeatureFPARMv8_D16_SP, FeatureFPRegs16]>; def FeatureFP16FML : SubtargetFeature<"fp16fml", "HasFP16FML", "true", "Enable full half-precision " "floating point fml instructions", [FeatureFullFP16]>; def FeatureHWDivThumb : SubtargetFeature<"hwdiv", "HasHardwareDivideInThumb", "true", "Enable divide instructions in Thumb">; def FeatureHWDivARM : SubtargetFeature<"hwdiv-arm", "HasHardwareDivideInARM", "true", "Enable divide instructions in ARM mode">; // Atomic Support def FeatureDB : SubtargetFeature<"db", "HasDataBarrier", "true", "Has data barrier (dmb/dsb) instructions">; def FeatureV7Clrex : SubtargetFeature<"v7clrex", "HasV7Clrex", "true", "Has v7 clrex instruction">; def FeatureDFB : SubtargetFeature<"dfb", "HasFullDataBarrier", "true", "Has full data barrier (dfb) instruction">; def FeatureAcquireRelease : SubtargetFeature<"acquire-release", "HasAcquireRelease", "true", "Has v8 acquire/release (lda/ldaex " " etc) instructions">; def FeatureSlowFPBrcc : SubtargetFeature<"slow-fp-brcc", "SlowFPBrcc", "true", "FP compare + branch is slow">; def FeaturePerfMon : SubtargetFeature<"perfmon", "HasPerfMon", "true", "Enable support for Performance " "Monitor extensions">; // TrustZone Security Extensions def FeatureTrustZone : SubtargetFeature<"trustzone", "HasTrustZone", "true", "Enable support for TrustZone " "security extensions">; def Feature8MSecExt : SubtargetFeature<"8msecext", "Has8MSecExt", "true", "Enable support for ARMv8-M " "Security Extensions">; def FeatureSHA2 : SubtargetFeature<"sha2", "HasSHA2", "true", "Enable SHA1 and SHA256 support", [FeatureNEON]>; def FeatureAES : SubtargetFeature<"aes", "HasAES", "true", "Enable AES support", [FeatureNEON]>; def FeatureCrypto : SubtargetFeature<"crypto", "HasCrypto", "true", "Enable support for " "Cryptography extensions", [FeatureNEON, FeatureSHA2, FeatureAES]>; def FeatureCRC : SubtargetFeature<"crc", "HasCRC", "true", "Enable support for CRC instructions">; def FeatureDotProd : SubtargetFeature<"dotprod", "HasDotProd", "true", "Enable support for dot product instructions", [FeatureNEON]>; // Not to be confused with FeatureHasRetAddrStack (return address stack) def FeatureRAS : SubtargetFeature<"ras", "HasRAS", "true", "Enable Reliability, Availability " "and Serviceability extensions">; // Fast computation of non-negative address offsets def FeatureFPAO : SubtargetFeature<"fpao", "HasFPAO", "true", "Enable fast computation of " "positive address offsets">; // Fast execution of AES crypto operations def FeatureFuseAES : SubtargetFeature<"fuse-aes", "HasFuseAES", "true", "CPU fuses AES crypto operations">; // Fast execution of bottom and top halves of literal generation def FeatureFuseLiterals : SubtargetFeature<"fuse-literals", "HasFuseLiterals", "true", "CPU fuses literal generation operations">; // The way of reading thread pointer def FeatureReadTp : SubtargetFeature<"read-tp-hard", "ReadTPHard", "true", "Reading thread pointer from register">; // Cyclone can zero VFP registers in 0 cycles. def FeatureZCZeroing : SubtargetFeature<"zcz", "HasZeroCycleZeroing", "true", "Has zero-cycle zeroing instructions">; // Whether it is profitable to unpredicate certain instructions during if-conversion def FeatureProfUnpredicate : SubtargetFeature<"prof-unpr", "IsProfitableToUnpredicate", "true", "Is profitable to unpredicate">; // Some targets (e.g. Swift) have microcoded VGETLNi32. def FeatureSlowVGETLNi32 : SubtargetFeature<"slow-vgetlni32", "HasSlowVGETLNi32", "true", "Has slow VGETLNi32 - prefer VMOV">; // Some targets (e.g. Swift) have microcoded VDUP32. def FeatureSlowVDUP32 : SubtargetFeature<"slow-vdup32", "HasSlowVDUP32", "true", "Has slow VDUP32 - prefer VMOV">; // Some targets (e.g. Cortex-A9) prefer VMOVSR to VMOVDRR even when using NEON // for scalar FP, as this allows more effective execution domain optimization. def FeaturePreferVMOVSR : SubtargetFeature<"prefer-vmovsr", "PreferVMOVSR", "true", "Prefer VMOVSR">; // Swift has ISHST barriers compatible with Atomic Release semantics but weaker // than ISH def FeaturePrefISHSTBarrier : SubtargetFeature<"prefer-ishst", "PreferISHST", "true", "Prefer ISHST barriers">; // Some targets (e.g. Cortex-A9) have muxed AGU and NEON/FPU. def FeatureMuxedUnits : SubtargetFeature<"muxed-units", "HasMuxedUnits", "true", "Has muxed AGU and NEON/FPU">; // Whether VLDM/VSTM starting with odd register number need more microops // than single VLDRS def FeatureSlowOddRegister : SubtargetFeature<"slow-odd-reg", "SlowOddRegister", "true", "VLDM/VSTM starting " "with an odd register is slow">; // Some targets have a renaming dependency when loading into D subregisters. def FeatureSlowLoadDSubreg : SubtargetFeature<"slow-load-D-subreg", "SlowLoadDSubregister", "true", "Loading into D subregs is slow">; def FeatureUseWideStrideVFP : SubtargetFeature<"wide-stride-vfp", "UseWideStrideVFP", "true", "Use a wide stride when allocating VFP registers">; // Some targets (e.g. Cortex-A15) never want VMOVS to be widened to VMOVD. def FeatureDontWidenVMOVS : SubtargetFeature<"dont-widen-vmovs", "DontWidenVMOVS", "true", "Don't widen VMOVS to VMOVD">; // Some targets (e.g. Cortex-A15) prefer to avoid mixing operations on different // VFP register widths. def FeatureSplatVFPToNeon : SubtargetFeature<"splat-vfp-neon", "SplatVFPToNeon", "true", "Splat register from VFP to NEON", [FeatureDontWidenVMOVS]>; // Whether or not it is profitable to expand VFP/NEON MLA/MLS instructions. def FeatureExpandMLx : SubtargetFeature<"expand-fp-mlx", "ExpandMLx", "true", "Expand VFP/NEON MLA/MLS instructions">; // Some targets have special RAW hazards for VFP/NEON VMLA/VMLS. def FeatureHasVMLxHazards : SubtargetFeature<"vmlx-hazards", "HasVMLxHazards", "true", "Has VMLx hazards">; // Some targets (e.g. Cortex-A9) want to convert VMOVRS, VMOVSR and VMOVS from // VFP to NEON, as an execution domain optimization. def FeatureNEONForFPMovs : SubtargetFeature<"neon-fpmovs", "UseNEONForFPMovs", "true", "Convert VMOVSR, VMOVRS, " "VMOVS to NEON">; // Some processors benefit from using NEON instructions for scalar // single-precision FP operations. This affects instruction selection and should // only be enabled if the handling of denormals is not important. def FeatureNEONForFP : SubtargetFeature<"neonfp", "UseNEONForSinglePrecisionFP", "true", "Use NEON for single precision FP">; // On some processors, VLDn instructions that access unaligned data take one // extra cycle. Take that into account when computing operand latencies. def FeatureCheckVLDnAlign : SubtargetFeature<"vldn-align", "CheckVLDnAlign", "true", "Check for VLDn unaligned access">; // Some processors have a nonpipelined VFP coprocessor. def FeatureNonpipelinedVFP : SubtargetFeature<"nonpipelined-vfp", "NonpipelinedVFP", "true", "VFP instructions are not pipelined">; // Some processors have FP multiply-accumulate instructions that don't // play nicely with other VFP / NEON instructions, and it's generally better // to just not use them. def FeatureHasSlowFPVMLx : SubtargetFeature<"slowfpvmlx", "SlowFPVMLx", "true", "Disable VFP / NEON MAC instructions">; // VFPv4 added VFMA instructions that can similar be fast or slow. def FeatureHasSlowFPVFMx : SubtargetFeature<"slowfpvfmx", "SlowFPVFMx", "true", "Disable VFP / NEON FMA instructions">; // Cortex-A8 / A9 Advanced SIMD has multiplier accumulator forwarding. def FeatureVMLxForwarding : SubtargetFeature<"vmlx-forwarding", "HasVMLxForwarding", "true", "Has multiplier accumulator forwarding">; // Disable 32-bit to 16-bit narrowing for experimentation. def FeaturePref32BitThumb : SubtargetFeature<"32bit", "Pref32BitThumb", "true", "Prefer 32-bit Thumb instrs">; def FeaturePrefLoopAlign32 : SubtargetFeature<"loop-align", "PrefLoopLogAlignment","2", "Prefer 32-bit alignment for loops">; def FeatureMVEVectorCostFactor1 : SubtargetFeature<"mve1beat", "MVEVectorCostFactor", "1", "Model MVE instructions as a 1 beat per tick architecture">; def FeatureMVEVectorCostFactor2 : SubtargetFeature<"mve2beat", "MVEVectorCostFactor", "2", "Model MVE instructions as a 2 beats per tick architecture">; def FeatureMVEVectorCostFactor4 : SubtargetFeature<"mve4beat", "MVEVectorCostFactor", "4", "Model MVE instructions as a 4 beats per tick architecture">; /// Some instructions update CPSR partially, which can add false dependency for /// out-of-order implementation, e.g. Cortex-A9, unless each individual bit is /// mapped to a separate physical register. Avoid partial CPSR update for these /// processors. def FeatureAvoidPartialCPSR : SubtargetFeature<"avoid-partial-cpsr", "AvoidCPSRPartialUpdate", "true", "Avoid CPSR partial update for OOO execution">; /// Disable +1 predication cost for instructions updating CPSR. /// Enabled for Cortex-A57. def FeatureCheapPredicableCPSR : SubtargetFeature<"cheap-predicable-cpsr", "CheapPredicableCPSRDef", "true", "Disable +1 predication cost for instructions updating CPSR">; def FeatureAvoidMOVsShOp : SubtargetFeature<"avoid-movs-shop", "AvoidMOVsShifterOperand", "true", "Avoid movs instructions with " "shifter operand">; // Some processors perform return stack prediction. CodeGen should avoid issue // "normal" call instructions to callees which do not return. def FeatureHasRetAddrStack : SubtargetFeature<"ret-addr-stack", "HasRetAddrStack", "true", "Has return address stack">; // Some processors have no branch predictor, which changes the expected cost of // taking a branch which affects the choice of whether to use predicated // instructions. def FeatureHasNoBranchPredictor : SubtargetFeature<"no-branch-predictor", "HasBranchPredictor", "false", "Has no branch predictor">; /// DSP extension. def FeatureDSP : SubtargetFeature<"dsp", "HasDSP", "true", "Supports DSP instructions in " "ARM and/or Thumb2">; // Multiprocessing extension. def FeatureMP : SubtargetFeature<"mp", "HasMPExtension", "true", "Supports Multiprocessing extension">; // Virtualization extension - requires HW divide (ARMv7-AR ARMARM - 4.4.8). def FeatureVirtualization : SubtargetFeature<"virtualization", "HasVirtualization", "true", "Supports Virtualization extension", [FeatureHWDivThumb, FeatureHWDivARM]>; // Special TRAP encoding for NaCl, which looks like a TRAP in Thumb too. // See ARMInstrInfo.td for details. def FeatureNaClTrap : SubtargetFeature<"nacl-trap", "UseNaClTrap", "true", "NaCl trap">; def FeatureStrictAlign : SubtargetFeature<"strict-align", "StrictAlign", "true", "Disallow all unaligned memory " "access">; def FeatureLongCalls : SubtargetFeature<"long-calls", "GenLongCalls", "true", "Generate calls via indirect call " "instructions">; def FeatureExecuteOnly : SubtargetFeature<"execute-only", "GenExecuteOnly", "true", "Enable the generation of " "execute only code.">; def FeatureReserveR9 : SubtargetFeature<"reserve-r9", "ReserveR9", "true", "Reserve R9, making it unavailable" " as GPR">; def FeatureNoMovt : SubtargetFeature<"no-movt", "NoMovt", "true", "Don't use movt/movw pairs for " "32-bit imms">; def FeatureNoNegativeImmediates : SubtargetFeature<"no-neg-immediates", "NegativeImmediates", "false", "Convert immediates and instructions " "to their negated or complemented " "equivalent when the immediate does " "not fit in the encoding.">; // Use the MachineScheduler for instruction scheduling for the subtarget. def FeatureUseMISched: SubtargetFeature<"use-misched", "UseMISched", "true", "Use the MachineScheduler">; def FeatureNoPostRASched : SubtargetFeature<"disable-postra-scheduler", "DisablePostRAScheduler", "true", "Don't schedule again after register allocation">; // Armv8.5-A extensions def FeatureSB : SubtargetFeature<"sb", "HasSB", "true", "Enable v8.5a Speculation Barrier" >; // Armv8.6-A extensions def FeatureBF16 : SubtargetFeature<"bf16", "HasBF16", "true", "Enable support for BFloat16 instructions", [FeatureNEON]>; def FeatureMatMulInt8 : SubtargetFeature<"i8mm", "HasMatMulInt8", "true", "Enable Matrix Multiply Int8 Extension", [FeatureNEON]>; // Armv8.1-M extensions def FeatureLOB : SubtargetFeature<"lob", "HasLOB", "true", "Enable Low Overhead Branch " "extensions">; def FeatureFixCMSE_CVE_2021_35465 : SubtargetFeature<"fix-cmse-cve-2021-35465", "FixCMSE_CVE_2021_35465", "true", "Mitigate against the cve-2021-35465 " "security vulnurability">; def FeaturePACBTI : SubtargetFeature<"pacbti", "HasPACBTI", "true", "Enable Pointer Authentication and Branch " "Target Identification">; def FeatureNoBTIAtReturnTwice : SubtargetFeature<"no-bti-at-return-twice", "NoBTIAtReturnTwice", "true", "Don't place a BTI instruction " "after a return-twice">; //===----------------------------------------------------------------------===// // ARM architecture class // // A-series ISA def FeatureAClass : SubtargetFeature<"aclass", "ARMProcClass", "AClass", "Is application profile ('A' series)">; // R-series ISA def FeatureRClass : SubtargetFeature<"rclass", "ARMProcClass", "RClass", "Is realtime profile ('R' series)">; // M-series ISA def FeatureMClass : SubtargetFeature<"mclass", "ARMProcClass", "MClass", "Is microcontroller profile ('M' series)">; def FeatureThumb2 : SubtargetFeature<"thumb2", "HasThumb2", "true", "Enable Thumb2 instructions">; def FeatureNoARM : SubtargetFeature<"noarm", "NoARM", "true", "Does not support ARM mode execution">; //===----------------------------------------------------------------------===// // ARM ISAa. // def HasV4TOps : SubtargetFeature<"v4t", "HasV4TOps", "true", "Support ARM v4T instructions">; def HasV5TOps : SubtargetFeature<"v5t", "HasV5TOps", "true", "Support ARM v5T instructions", [HasV4TOps]>; def HasV5TEOps : SubtargetFeature<"v5te", "HasV5TEOps", "true", "Support ARM v5TE, v5TEj, and " "v5TExp instructions", [HasV5TOps]>; def HasV6Ops : SubtargetFeature<"v6", "HasV6Ops", "true", "Support ARM v6 instructions", [HasV5TEOps]>; def HasV6MOps : SubtargetFeature<"v6m", "HasV6MOps", "true", "Support ARM v6M instructions", [HasV6Ops]>; def HasV8MBaselineOps : SubtargetFeature<"v8m", "HasV8MBaselineOps", "true", "Support ARM v8M Baseline instructions", [HasV6MOps]>; def HasV6KOps : SubtargetFeature<"v6k", "HasV6KOps", "true", "Support ARM v6k instructions", [HasV6Ops]>; def HasV6T2Ops : SubtargetFeature<"v6t2", "HasV6T2Ops", "true", "Support ARM v6t2 instructions", [HasV8MBaselineOps, HasV6KOps, FeatureThumb2]>; def HasV7Ops : SubtargetFeature<"v7", "HasV7Ops", "true", "Support ARM v7 instructions", [HasV6T2Ops, FeaturePerfMon, FeatureV7Clrex]>; def HasV8MMainlineOps : SubtargetFeature<"v8m.main", "HasV8MMainlineOps", "true", "Support ARM v8M Mainline instructions", [HasV7Ops]>; def HasV8Ops : SubtargetFeature<"v8", "HasV8Ops", "true", "Support ARM v8 instructions", [HasV7Ops, FeatureAcquireRelease]>; def HasV8_1aOps : SubtargetFeature<"v8.1a", "HasV8_1aOps", "true", "Support ARM v8.1a instructions", [HasV8Ops]>; def HasV8_2aOps : SubtargetFeature<"v8.2a", "HasV8_2aOps", "true", "Support ARM v8.2a instructions", [HasV8_1aOps]>; def HasV8_3aOps : SubtargetFeature<"v8.3a", "HasV8_3aOps", "true", "Support ARM v8.3a instructions", [HasV8_2aOps]>; def HasV8_4aOps : SubtargetFeature<"v8.4a", "HasV8_4aOps", "true", "Support ARM v8.4a instructions", [HasV8_3aOps, FeatureDotProd]>; def HasV8_5aOps : SubtargetFeature<"v8.5a", "HasV8_5aOps", "true", "Support ARM v8.5a instructions", [HasV8_4aOps, FeatureSB]>; def HasV8_6aOps : SubtargetFeature<"v8.6a", "HasV8_6aOps", "true", "Support ARM v8.6a instructions", [HasV8_5aOps, FeatureBF16, FeatureMatMulInt8]>; def HasV8_7aOps : SubtargetFeature<"v8.7a", "HasV8_7aOps", "true", "Support ARM v8.7a instructions", [HasV8_6aOps]>; def HasV9_0aOps : SubtargetFeature<"v9a", "HasV9_0aOps", "true", "Support ARM v9a instructions", [HasV8_5aOps]>; def HasV9_1aOps : SubtargetFeature<"v9.1a", "HasV9_1aOps", "true", "Support ARM v9.1a instructions", [HasV8_6aOps, HasV9_0aOps]>; def HasV9_2aOps : SubtargetFeature<"v9.2a", "HasV9_2aOps", "true", "Support ARM v9.2a instructions", [HasV8_7aOps, HasV9_1aOps]>; def HasV8_1MMainlineOps : SubtargetFeature< "v8.1m.main", "HasV8_1MMainlineOps", "true", "Support ARM v8-1M Mainline instructions", [HasV8MMainlineOps]>; def HasMVEIntegerOps : SubtargetFeature< "mve", "HasMVEIntegerOps", "true", "Support M-Class Vector Extension with integer ops", [HasV8_1MMainlineOps, FeatureDSP, FeatureFPRegs16, FeatureFPRegs64]>; def HasMVEFloatOps : SubtargetFeature< "mve.fp", "HasMVEFloatOps", "true", "Support M-Class Vector Extension with integer and floating ops", [HasMVEIntegerOps, FeatureFPARMv8_D16_SP, FeatureFullFP16]>; def HasCDEOps : SubtargetFeature<"cde", "HasCDEOps", "true", "Support CDE instructions", [HasV8MMainlineOps]>; foreach i = {0-7} in def FeatureCoprocCDE#i : SubtargetFeature<"cdecp"#i, "CoprocCDE["#i#"]", "true", "Coprocessor "#i#" ISA is CDEv1", [HasCDEOps]>; //===----------------------------------------------------------------------===// // Control codegen mitigation against Straight Line Speculation vulnerability. //===----------------------------------------------------------------------===// def FeatureHardenSlsRetBr : SubtargetFeature<"harden-sls-retbr", "HardenSlsRetBr", "true", "Harden against straight line speculation across RETurn and BranchRegister " "instructions">; def FeatureHardenSlsBlr : SubtargetFeature<"harden-sls-blr", "HardenSlsBlr", "true", "Harden against straight line speculation across indirect calls">; def FeatureHardenSlsNoComdat : SubtargetFeature<"harden-sls-nocomdat", "HardenSlsNoComdat", "true", "Generate thunk code for SLS mitigation in the normal text section">; //===----------------------------------------------------------------------===// // ARM Processor subtarget features. // def ProcA5 : SubtargetFeature<"a5", "ARMProcFamily", "CortexA5", "Cortex-A5 ARM processors", []>; def ProcA7 : SubtargetFeature<"a7", "ARMProcFamily", "CortexA7", "Cortex-A7 ARM processors", []>; def ProcA8 : SubtargetFeature<"a8", "ARMProcFamily", "CortexA8", "Cortex-A8 ARM processors", []>; def ProcA9 : SubtargetFeature<"a9", "ARMProcFamily", "CortexA9", "Cortex-A9 ARM processors", []>; def ProcA12 : SubtargetFeature<"a12", "ARMProcFamily", "CortexA12", "Cortex-A12 ARM processors", []>; def ProcA15 : SubtargetFeature<"a15", "ARMProcFamily", "CortexA15", "Cortex-A15 ARM processors", []>; def ProcA17 : SubtargetFeature<"a17", "ARMProcFamily", "CortexA17", "Cortex-A17 ARM processors", []>; def ProcA32 : SubtargetFeature<"a32", "ARMProcFamily", "CortexA32", "Cortex-A32 ARM processors", []>; def ProcA35 : SubtargetFeature<"a35", "ARMProcFamily", "CortexA35", "Cortex-A35 ARM processors", []>; def ProcA53 : SubtargetFeature<"a53", "ARMProcFamily", "CortexA53", "Cortex-A53 ARM processors", []>; def ProcA55 : SubtargetFeature<"a55", "ARMProcFamily", "CortexA55", "Cortex-A55 ARM processors", []>; def ProcA57 : SubtargetFeature<"a57", "ARMProcFamily", "CortexA57", "Cortex-A57 ARM processors", []>; def ProcA72 : SubtargetFeature<"a72", "ARMProcFamily", "CortexA72", "Cortex-A72 ARM processors", []>; def ProcA73 : SubtargetFeature<"a73", "ARMProcFamily", "CortexA73", "Cortex-A73 ARM processors", []>; def ProcA75 : SubtargetFeature<"a75", "ARMProcFamily", "CortexA75", "Cortex-A75 ARM processors", []>; def ProcA76 : SubtargetFeature<"a76", "ARMProcFamily", "CortexA76", "Cortex-A76 ARM processors", []>; def ProcA77 : SubtargetFeature<"a77", "ARMProcFamily", "CortexA77", "Cortex-A77 ARM processors", []>; def ProcA78 : SubtargetFeature<"cortex-a78", "ARMProcFamily", "CortexA78", "Cortex-A78 ARM processors", []>; def ProcA78C : SubtargetFeature<"a78c", "ARMProcFamily", "CortexA78C", "Cortex-A78C ARM processors", []>; def ProcA710 : SubtargetFeature<"cortex-a710", "ARMProcFamily", "CortexA710", "Cortex-A710 ARM processors", []>; def ProcX1 : SubtargetFeature<"cortex-x1", "ARMProcFamily", "CortexX1", "Cortex-X1 ARM processors", []>; def ProcV1 : SubtargetFeature<"neoverse-v1", "ARMProcFamily", "NeoverseV1", "Neoverse-V1 ARM processors", []>; def ProcKrait : SubtargetFeature<"krait", "ARMProcFamily", "Krait", "Qualcomm Krait processors", []>; def ProcKryo : SubtargetFeature<"kryo", "ARMProcFamily", "Kryo", "Qualcomm Kryo processors", []>; def ProcSwift : SubtargetFeature<"swift", "ARMProcFamily", "Swift", "Swift ARM processors", []>; def ProcExynos : SubtargetFeature<"exynos", "ARMProcFamily", "Exynos", "Samsung Exynos processors", [FeatureZCZeroing, FeatureUseWideStrideVFP, FeatureSplatVFPToNeon, FeatureSlowVGETLNi32, FeatureSlowVDUP32, FeatureSlowFPBrcc, FeatureProfUnpredicate, FeatureHWDivThumb, FeatureHWDivARM, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureHasRetAddrStack, FeatureFuseLiterals, FeatureFuseAES, FeatureExpandMLx, FeatureCrypto, FeatureCRC]>; def ProcR4 : SubtargetFeature<"r4", "ARMProcFamily", "CortexR4", "Cortex-R4 ARM processors", []>; def ProcR5 : SubtargetFeature<"r5", "ARMProcFamily", "CortexR5", "Cortex-R5 ARM processors", []>; def ProcR7 : SubtargetFeature<"r7", "ARMProcFamily", "CortexR7", "Cortex-R7 ARM processors", []>; def ProcR52 : SubtargetFeature<"r52", "ARMProcFamily", "CortexR52", "Cortex-R52 ARM processors", []>; def ProcM3 : SubtargetFeature<"m3", "ARMProcFamily", "CortexM3", "Cortex-M3 ARM processors", []>; def ProcM7 : SubtargetFeature<"m7", "ARMProcFamily", "CortexM7", "Cortex-M7 ARM processors", []>; //===----------------------------------------------------------------------===// // ARM Helper classes. // class Architecture features> : SubtargetFeature; class ProcNoItin Features> : Processor; //===----------------------------------------------------------------------===// // ARM architectures // def ARMv2 : Architecture<"armv2", "ARMv2", []>; def ARMv2a : Architecture<"armv2a", "ARMv2a", []>; def ARMv3 : Architecture<"armv3", "ARMv3", []>; def ARMv3m : Architecture<"armv3m", "ARMv3m", []>; def ARMv4 : Architecture<"armv4", "ARMv4", []>; def ARMv4t : Architecture<"armv4t", "ARMv4t", [HasV4TOps]>; def ARMv5t : Architecture<"armv5t", "ARMv5t", [HasV5TOps]>; def ARMv5te : Architecture<"armv5te", "ARMv5te", [HasV5TEOps]>; def ARMv5tej : Architecture<"armv5tej", "ARMv5tej", [HasV5TEOps]>; def ARMv6 : Architecture<"armv6", "ARMv6", [HasV6Ops, FeatureDSP]>; def ARMv6t2 : Architecture<"armv6t2", "ARMv6t2", [HasV6T2Ops, FeatureDSP]>; def ARMv6k : Architecture<"armv6k", "ARMv6k", [HasV6KOps]>; def ARMv6kz : Architecture<"armv6kz", "ARMv6kz", [HasV6KOps, FeatureTrustZone]>; def ARMv6m : Architecture<"armv6-m", "ARMv6m", [HasV6MOps, FeatureNoARM, ModeThumb, FeatureDB, FeatureMClass, FeatureStrictAlign]>; def ARMv6sm : Architecture<"armv6s-m", "ARMv6sm", [HasV6MOps, FeatureNoARM, ModeThumb, FeatureDB, FeatureMClass, FeatureStrictAlign]>; def ARMv7a : Architecture<"armv7-a", "ARMv7a", [HasV7Ops, FeatureNEON, FeatureDB, FeatureDSP, FeatureAClass]>; def ARMv7ve : Architecture<"armv7ve", "ARMv7ve", [HasV7Ops, FeatureNEON, FeatureDB, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureAClass]>; def ARMv7r : Architecture<"armv7-r", "ARMv7r", [HasV7Ops, FeatureDB, FeatureDSP, FeatureHWDivThumb, FeatureRClass]>; def ARMv7m : Architecture<"armv7-m", "ARMv7m", [HasV7Ops, FeatureThumb2, FeatureNoARM, ModeThumb, FeatureDB, FeatureHWDivThumb, FeatureMClass]>; def ARMv7em : Architecture<"armv7e-m", "ARMv7em", [HasV7Ops, FeatureThumb2, FeatureNoARM, ModeThumb, FeatureDB, FeatureHWDivThumb, FeatureMClass, FeatureDSP]>; def ARMv8a : Architecture<"armv8-a", "ARMv8a", [HasV8Ops, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC]>; def ARMv81a : Architecture<"armv8.1-a", "ARMv81a", [HasV8_1aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC]>; def ARMv82a : Architecture<"armv8.2-a", "ARMv82a", [HasV8_2aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS]>; def ARMv83a : Architecture<"armv8.3-a", "ARMv83a", [HasV8_3aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS]>; def ARMv84a : Architecture<"armv8.4-a", "ARMv84a", [HasV8_4aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv85a : Architecture<"armv8.5-a", "ARMv85a", [HasV8_5aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv86a : Architecture<"armv8.6-a", "ARMv86a", [HasV8_6aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv87a : Architecture<"armv8.7-a", "ARMv87a", [HasV8_7aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCrypto, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv9a : Architecture<"armv9-a", "ARMv9a", [HasV9_0aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv91a : Architecture<"armv9.1-a", "ARMv91a", [HasV9_1aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv92a : Architecture<"armv9.2-a", "ARMv92a", [HasV9_2aOps, FeatureAClass, FeatureDB, FeatureFPARMv8, FeatureNEON, FeatureDSP, FeatureTrustZone, FeatureMP, FeatureVirtualization, FeatureCRC, FeatureRAS, FeatureDotProd]>; def ARMv8r : Architecture<"armv8-r", "ARMv8r", [HasV8Ops, FeatureRClass, FeatureDB, FeatureDFB, FeatureDSP, FeatureCRC, FeatureMP, FeatureVirtualization, FeatureFPARMv8, FeatureNEON]>; def ARMv8mBaseline : Architecture<"armv8-m.base", "ARMv8mBaseline", [HasV8MBaselineOps, FeatureNoARM, ModeThumb, FeatureDB, FeatureHWDivThumb, FeatureV7Clrex, Feature8MSecExt, FeatureAcquireRelease, FeatureMClass, FeatureStrictAlign]>; def ARMv8mMainline : Architecture<"armv8-m.main", "ARMv8mMainline", [HasV8MMainlineOps, FeatureNoARM, ModeThumb, FeatureDB, FeatureHWDivThumb, Feature8MSecExt, FeatureAcquireRelease, FeatureMClass]>; def ARMv81mMainline : Architecture<"armv8.1-m.main", "ARMv81mMainline", [HasV8_1MMainlineOps, FeatureNoARM, ModeThumb, FeatureDB, FeatureHWDivThumb, Feature8MSecExt, FeatureAcquireRelease, FeatureMClass, FeatureRAS, FeatureLOB]>; // Aliases def IWMMXT : Architecture<"iwmmxt", "ARMv5te", [ARMv5te]>; def IWMMXT2 : Architecture<"iwmmxt2", "ARMv5te", [ARMv5te]>; def XScale : Architecture<"xscale", "ARMv5te", [ARMv5te]>; def ARMv6j : Architecture<"armv6j", "ARMv7a", [ARMv6]>; def ARMv7k : Architecture<"armv7k", "ARMv7a", [ARMv7a]>; def ARMv7s : Architecture<"armv7s", "ARMv7a", [ARMv7a]>; //===----------------------------------------------------------------------===// // Register File Description //===----------------------------------------------------------------------===// include "ARMRegisterInfo.td" include "ARMRegisterBanks.td" include "ARMCallingConv.td" //===----------------------------------------------------------------------===// // ARM schedules. //===----------------------------------------------------------------------===// // include "ARMPredicates.td" include "ARMSchedule.td" //===----------------------------------------------------------------------===// // Instruction Descriptions //===----------------------------------------------------------------------===// include "ARMInstrInfo.td" def ARMInstrInfo : InstrInfo; //===----------------------------------------------------------------------===// // ARM schedules // include "ARMScheduleV6.td" include "ARMScheduleA8.td" include "ARMScheduleA9.td" include "ARMScheduleSwift.td" include "ARMScheduleR52.td" include "ARMScheduleA57.td" include "ARMScheduleM4.td" include "ARMScheduleM7.td" //===----------------------------------------------------------------------===// // ARM processors // // Dummy CPU, used to target architectures def : ProcessorModel<"generic", CortexA8Model, []>; // FIXME: Several processors below are not using their own scheduler // model, but one of similar/previous processor. These should be fixed. def : ProcNoItin<"arm8", [ARMv4]>; def : ProcNoItin<"arm810", [ARMv4]>; def : ProcNoItin<"strongarm", [ARMv4]>; def : ProcNoItin<"strongarm110", [ARMv4]>; def : ProcNoItin<"strongarm1100", [ARMv4]>; def : ProcNoItin<"strongarm1110", [ARMv4]>; def : ProcNoItin<"arm7tdmi", [ARMv4t]>; def : ProcNoItin<"arm7tdmi-s", [ARMv4t]>; def : ProcNoItin<"arm710t", [ARMv4t]>; def : ProcNoItin<"arm720t", [ARMv4t]>; def : ProcNoItin<"arm9", [ARMv4t]>; def : ProcNoItin<"arm9tdmi", [ARMv4t]>; def : ProcNoItin<"arm920", [ARMv4t]>; def : ProcNoItin<"arm920t", [ARMv4t]>; def : ProcNoItin<"arm922t", [ARMv4t]>; def : ProcNoItin<"arm940t", [ARMv4t]>; def : ProcNoItin<"ep9312", [ARMv4t]>; def : ProcNoItin<"arm10tdmi", [ARMv5t]>; def : ProcNoItin<"arm1020t", [ARMv5t]>; def : ProcNoItin<"arm9e", [ARMv5te]>; def : ProcNoItin<"arm926ej-s", [ARMv5te]>; def : ProcNoItin<"arm946e-s", [ARMv5te]>; def : ProcNoItin<"arm966e-s", [ARMv5te]>; def : ProcNoItin<"arm968e-s", [ARMv5te]>; def : ProcNoItin<"arm10e", [ARMv5te]>; def : ProcNoItin<"arm1020e", [ARMv5te]>; def : ProcNoItin<"arm1022e", [ARMv5te]>; def : ProcNoItin<"xscale", [ARMv5te]>; def : ProcNoItin<"iwmmxt", [ARMv5te]>; def : Processor<"arm1136j-s", ARMV6Itineraries, [ARMv6]>; def : Processor<"arm1136jf-s", ARMV6Itineraries, [ARMv6, FeatureVFP2, FeatureHasSlowFPVMLx]>; def : Processor<"cortex-m0", ARMV6Itineraries, [ARMv6m, FeatureHasNoBranchPredictor]>; def : Processor<"cortex-m0plus", ARMV6Itineraries, [ARMv6m, FeatureHasNoBranchPredictor]>; def : Processor<"cortex-m1", ARMV6Itineraries, [ARMv6m, FeatureHasNoBranchPredictor]>; def : Processor<"sc000", ARMV6Itineraries, [ARMv6m, FeatureHasNoBranchPredictor]>; def : Processor<"arm1176jz-s", ARMV6Itineraries, [ARMv6kz]>; def : Processor<"arm1176jzf-s", ARMV6Itineraries, [ARMv6kz, FeatureVFP2, FeatureHasSlowFPVMLx]>; def : Processor<"mpcorenovfp", ARMV6Itineraries, [ARMv6k]>; def : Processor<"mpcore", ARMV6Itineraries, [ARMv6k, FeatureVFP2, FeatureHasSlowFPVMLx]>; def : Processor<"arm1156t2-s", ARMV6Itineraries, [ARMv6t2]>; def : Processor<"arm1156t2f-s", ARMV6Itineraries, [ARMv6t2, FeatureVFP2, FeatureHasSlowFPVMLx]>; def : ProcessorModel<"cortex-a5", CortexA8Model, [ARMv7a, ProcA5, FeatureHasRetAddrStack, FeatureTrustZone, FeatureSlowFPBrcc, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureVMLxForwarding, FeatureMP, FeatureVFP4]>; def : ProcessorModel<"cortex-a7", CortexA8Model, [ARMv7a, ProcA7, FeatureHasRetAddrStack, FeatureTrustZone, FeatureSlowFPBrcc, FeatureHasVMLxHazards, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureVMLxForwarding, FeatureMP, FeatureVFP4, FeatureVirtualization]>; def : ProcessorModel<"cortex-a8", CortexA8Model, [ARMv7a, ProcA8, FeatureHasRetAddrStack, FeatureNonpipelinedVFP, FeatureTrustZone, FeatureSlowFPBrcc, FeatureHasVMLxHazards, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureVMLxForwarding]>; def : ProcessorModel<"cortex-a9", CortexA9Model, [ARMv7a, ProcA9, FeatureHasRetAddrStack, FeatureTrustZone, FeatureHasVMLxHazards, FeatureVMLxForwarding, FeatureFP16, FeatureAvoidPartialCPSR, FeatureExpandMLx, FeaturePreferVMOVSR, FeatureMuxedUnits, FeatureNEONForFPMovs, FeatureCheckVLDnAlign, FeatureMP]>; def : ProcessorModel<"cortex-a12", CortexA9Model, [ARMv7a, ProcA12, FeatureHasRetAddrStack, FeatureTrustZone, FeatureVMLxForwarding, FeatureVFP4, FeatureAvoidPartialCPSR, FeatureVirtualization, FeatureMP]>; def : ProcessorModel<"cortex-a15", CortexA9Model, [ARMv7a, ProcA15, FeatureDontWidenVMOVS, FeatureSplatVFPToNeon, FeatureHasRetAddrStack, FeatureMuxedUnits, FeatureTrustZone, FeatureVFP4, FeatureMP, FeatureCheckVLDnAlign, FeatureAvoidPartialCPSR, FeatureVirtualization]>; def : ProcessorModel<"cortex-a17", CortexA9Model, [ARMv7a, ProcA17, FeatureHasRetAddrStack, FeatureTrustZone, FeatureMP, FeatureVMLxForwarding, FeatureVFP4, FeatureAvoidPartialCPSR, FeatureVirtualization]>; // FIXME: krait has currently the same features as A9 plus VFP4 and HWDiv def : ProcessorModel<"krait", CortexA9Model, [ARMv7a, ProcKrait, FeatureHasRetAddrStack, FeatureMuxedUnits, FeatureCheckVLDnAlign, FeatureVMLxForwarding, FeatureFP16, FeatureAvoidPartialCPSR, FeatureVFP4, FeatureHWDivThumb, FeatureHWDivARM]>; def : ProcessorModel<"swift", SwiftModel, [ARMv7a, ProcSwift, FeatureHasRetAddrStack, FeatureNEONForFP, FeatureVFP4, FeatureUseWideStrideVFP, FeatureMP, FeatureHWDivThumb, FeatureHWDivARM, FeatureAvoidPartialCPSR, FeatureAvoidMOVsShOp, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureHasVMLxHazards, FeatureProfUnpredicate, FeaturePrefISHSTBarrier, FeatureSlowOddRegister, FeatureSlowLoadDSubreg, FeatureSlowVGETLNi32, FeatureSlowVDUP32, FeatureUseMISched, FeatureNoPostRASched]>; def : ProcessorModel<"cortex-r4", CortexA8Model, [ARMv7r, ProcR4, FeatureHasRetAddrStack, FeatureAvoidPartialCPSR]>; def : ProcessorModel<"cortex-r4f", CortexA8Model, [ARMv7r, ProcR4, FeatureHasRetAddrStack, FeatureSlowFPBrcc, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureVFP3_D16, FeatureAvoidPartialCPSR]>; def : ProcessorModel<"cortex-r5", CortexA8Model, [ARMv7r, ProcR5, FeatureHasRetAddrStack, FeatureVFP3_D16, FeatureSlowFPBrcc, FeatureHWDivARM, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureAvoidPartialCPSR]>; def : ProcessorModel<"cortex-r7", CortexA8Model, [ARMv7r, ProcR7, FeatureHasRetAddrStack, FeatureVFP3_D16, FeatureFP16, FeatureMP, FeatureSlowFPBrcc, FeatureHWDivARM, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureAvoidPartialCPSR]>; def : ProcessorModel<"cortex-r8", CortexA8Model, [ARMv7r, FeatureHasRetAddrStack, FeatureVFP3_D16, FeatureFP16, FeatureMP, FeatureSlowFPBrcc, FeatureHWDivARM, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureAvoidPartialCPSR]>; def : ProcessorModel<"cortex-m3", CortexM4Model, [ARMv7m, ProcM3, FeaturePrefLoopAlign32, FeatureUseMISched, FeatureHasNoBranchPredictor]>; def : ProcessorModel<"sc300", CortexM4Model, [ARMv7m, ProcM3, FeatureUseMISched, FeatureHasNoBranchPredictor]>; def : ProcessorModel<"cortex-m4", CortexM4Model, [ARMv7em, FeatureVFP4_D16_SP, FeaturePrefLoopAlign32, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureUseMISched, FeatureHasNoBranchPredictor]>; def : ProcessorModel<"cortex-m7", CortexM7Model, [ARMv7em, ProcM7, FeatureFPARMv8_D16, FeatureUseMISched]>; def : ProcNoItin<"cortex-m23", [ARMv8mBaseline, FeatureNoMovt, FeatureHasNoBranchPredictor]>; def : ProcessorModel<"cortex-m33", CortexM4Model, [ARMv8mMainline, FeatureDSP, FeatureFPARMv8_D16_SP, FeaturePrefLoopAlign32, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureUseMISched, FeatureHasNoBranchPredictor, FeatureFixCMSE_CVE_2021_35465]>; def : ProcessorModel<"cortex-m35p", CortexM4Model, [ARMv8mMainline, FeatureDSP, FeatureFPARMv8_D16_SP, FeaturePrefLoopAlign32, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureUseMISched, FeatureHasNoBranchPredictor, FeatureFixCMSE_CVE_2021_35465]>; def : ProcessorModel<"cortex-m55", CortexM4Model, [ARMv81mMainline, FeatureDSP, FeatureFPARMv8_D16, FeatureUseMISched, FeatureHasNoBranchPredictor, FeaturePrefLoopAlign32, FeatureHasSlowFPVMLx, HasMVEFloatOps, FeatureFixCMSE_CVE_2021_35465]>; def : ProcNoItin<"cortex-a32", [ARMv8a, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC]>; def : ProcNoItin<"cortex-a35", [ARMv8a, ProcA35, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC]>; def : ProcNoItin<"cortex-a53", [ARMv8a, ProcA53, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFPAO]>; def : ProcNoItin<"cortex-a55", [ARMv82a, ProcA55, FeatureHWDivThumb, FeatureHWDivARM, FeatureDotProd]>; def : ProcessorModel<"cortex-a57", CortexA57Model, [ARMv8a, ProcA57, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFPAO, FeatureAvoidPartialCPSR, FeatureCheapPredicableCPSR]>; def : ProcessorModel<"cortex-a72", CortexA57Model, [ARMv8a, ProcA72, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC]>; def : ProcNoItin<"cortex-a73", [ARMv8a, ProcA73, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC]>; def : ProcNoItin<"cortex-a75", [ARMv82a, ProcA75, FeatureHWDivThumb, FeatureHWDivARM, FeatureDotProd]>; def : ProcNoItin<"cortex-a76", [ARMv82a, ProcA76, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"cortex-a76ae", [ARMv82a, ProcA76, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"cortex-a77", [ARMv82a, ProcA77, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"cortex-a78", [ARMv82a, ProcA78, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"cortex-a78c", [ARMv82a, ProcA78C, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureDotProd, FeatureFullFP16]>; def : ProcNoItin<"cortex-a710", [ARMv9a, ProcA710, FeatureHWDivThumb, FeatureHWDivARM, FeatureFP16FML, FeatureBF16, FeatureMatMulInt8, FeatureSB]>; def : ProcNoItin<"cortex-x1", [ARMv82a, ProcX1, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"neoverse-v1", [ARMv84a, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureFullFP16, FeatureBF16, FeatureMatMulInt8]>; def : ProcNoItin<"neoverse-n1", [ARMv82a, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC, FeatureDotProd]>; def : ProcNoItin<"neoverse-n2", [ARMv85a, FeatureBF16, FeatureMatMulInt8, FeaturePerfMon]>; def : ProcessorModel<"cyclone", SwiftModel, [ARMv8a, ProcSwift, FeatureHasRetAddrStack, FeatureNEONForFP, FeatureVFP4, FeatureMP, FeatureHWDivThumb, FeatureHWDivARM, FeatureAvoidPartialCPSR, FeatureAvoidMOVsShOp, FeatureHasSlowFPVMLx, FeatureHasSlowFPVFMx, FeatureCrypto, FeatureUseMISched, FeatureZCZeroing, FeatureNoPostRASched]>; def : ProcNoItin<"exynos-m3", [ARMv8a, ProcExynos]>; def : ProcNoItin<"exynos-m4", [ARMv82a, ProcExynos, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"exynos-m5", [ARMv82a, ProcExynos, FeatureFullFP16, FeatureDotProd]>; def : ProcNoItin<"kryo", [ARMv8a, ProcKryo, FeatureHWDivThumb, FeatureHWDivARM, FeatureCrypto, FeatureCRC]>; def : ProcessorModel<"cortex-r52", CortexR52Model, [ARMv8r, ProcR52, FeatureUseMISched, FeatureFPAO]>; //===----------------------------------------------------------------------===// // Declare the target which we are implementing //===----------------------------------------------------------------------===// def ARMAsmWriter : AsmWriter { string AsmWriterClassName = "InstPrinter"; int PassSubtarget = 1; int Variant = 0; bit isMCAsmWriter = 1; } def ARMAsmParser : AsmParser { bit ReportMultipleNearMisses = 1; } def ARMAsmParserVariant : AsmParserVariant { int Variant = 0; string Name = "ARM"; string BreakCharacters = "."; } def ARM : Target { // Pull in Instruction Info. let InstructionSet = ARMInstrInfo; let AssemblyWriters = [ARMAsmWriter]; let AssemblyParsers = [ARMAsmParser]; let AssemblyParserVariants = [ARMAsmParserVariant]; let AllowRegisterRenaming = 1; } ================================================ FILE: tests/inputs/Test.daml ================================================ -- https://raw.githubusercontent.com/digital-asset/daml/refs/heads/main/sdk/test-common/src/main/daml/model/Test.daml -- (truncated) -- Copyright (c) 2025 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. -- SPDX-License-Identifier: Apache-2.0 {-# LANGUAGE CPP #-} -- file that contains the declarations used in the sandbox tests module Test where import Iou() import IouTrade() template Dummy with operator : Party where signatory operator choice DummyChoice1 : () controller operator do return () choice FailingChoice : () controller operator do assert False nonconsuming choice Clone: ContractId Dummy controller operator do create Dummy with operator nonconsuming choice FailingClone : () controller operator do clone <- exercise self Clone exercise self FailingChoice choice ConsumeIfTimeIsBetween : () with begin : Time end : Time controller operator do currentTime <- getTime assert (begin <= currentTime) assert (currentTime <= end) choice WrapWithAddress : ContractId AddressWrapper with address : Address controller operator do create AddressWrapper with operator; address choice PublicChoice: () with anyParty: Party controller anyParty do return () data Address = Address { street: Text , city: Text , state: Text , zip: Text } deriving (Eq, Show) -- DEL-4615 template AddressWrapper with operator: Party address: Address where signatory operator ================================================ FILE: tests/inputs/Tk ================================================ #!/usr/local/bin/wish -f # from http://www.roesler-ac.de/wolfram/hello.htm # Hello World in Tk label .l -text "Hello World!" pack .l ================================================ FILE: tests/inputs/Trapezoid_Rule.ipynb ================================================ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Basic Numerical Integration: the Trapezoid Rule" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "A simple illustration of the trapezoid rule for definite integration:\n", "\n", "$$\n", "\\int_{a}^{b} f(x)\\, dx \\approx \\frac{1}{2} \\sum_{k=1}^{N} \\left( x_{k} - x_{k-1} \\right) \\left( f(x_{k}) + f(x_{k-1}) \\right).\n", "$$\n", "
\n", "First, we define a simple function and sample it between 0 and 10 at 200 points" ] }, { "cell_type": "code", "execution_count": 1, "metadata": { "collapsed": false }, "outputs": [], "source": [ "%matplotlib inline\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "collapsed": false }, "outputs": [], "source": [ "def f(x):\n", " return (x-3)*(x-5)*(x-7)+85\n", "\n", "x = np.linspace(0, 10, 200)\n", "y = f(x)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Choose a region to integrate over and take only a few points in that region" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "collapsed": true }, "outputs": [], "source": [ "a, b = 1, 8 # the left and right boundaries\n", "N = 5 # the number of points\n", "xint = np.linspace(a, b, N)\n", "yint = f(xint)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Plot both the function and the area below it in the trapezoid approximation" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "collapsed": false }, "outputs": [], "source": [ "plt.plot(x, y, lw=2)\n", "plt.axis([0, 9, 0, 140])\n", "plt.fill_between(xint, 0, yint, facecolor='gray', alpha=0.4)\n", "plt.text(0.5 * (a + b), 30,r\"$\\int_a^b f(x)dx$\", horizontalalignment='center', fontsize=20);" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Compute the integral both at high accuracy and with the trapezoid approximation" ] }, { "cell_type": "code", "execution_count": 5, "metadata": { "collapsed": false }, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "The integral is: 565.2499999999999 +/- 6.275535646693696e-12\n", "The trapezoid approximation with 5 points is: 559.890625\n" ] } ], "source": [ "from __future__ import print_function\n", "from scipy.integrate import quad\n", "integral, error = quad(f, a, b)\n", "integral_trapezoid = sum( (xint[1:] - xint[:-1]) * (yint[1:] + yint[:-1]) ) / 2\n", "print(\"The integral is:\", integral, \"+/-\", error)\n", "print(\"The trapezoid approximation with\", len(xint), \"points is:\", integral_trapezoid)" ] } ], "metadata": { "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.4.2" } }, "nbformat": 4, "nbformat_minor": 0 } ================================================ FILE: tests/inputs/TypeScript.ts ================================================ // // Copyright (c) Microsoft Corporation. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // module TypeScript { class Base64Format { static encodedValues = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; static encode(inValue: number) { if (inValue < 64) { return Base64Format.encodedValues.charAt(inValue); } throw TypeError(inValue + ": not a 64 based value"); } static decodeChar(inChar: string) { if (inChar.length === 1) { return Base64Format.encodedValues.indexOf(inChar); } else { throw TypeError('"' + inChar + '" must have length 1'); } } } export class Base64VLQFormat { static encode(inValue: number) { // Add a new least significant bit that has the sign of the value. // if negative number the least significant bit that gets added to the number has value 1 // else least significant bit value that gets added is 0 // eg. -1 changes to binary : 01 [1] => 3 // +1 changes to binary : 01 [0] => 2 if (inValue < 0) { inValue = ((-inValue) << 1) + 1; } else { inValue = inValue << 1; } // Encode 5 bits at a time starting from least significant bits var encodedStr = ""; do { var currentDigit = inValue & 31; // 11111 inValue = inValue >> 5; if (inValue > 0) { // There are still more digits to decode, set the msb (6th bit) currentDigit = currentDigit | 32; } encodedStr = encodedStr + Base64Format.encode(currentDigit); } while (inValue > 0); return encodedStr; } static decode(inString: string) { var result = 0; var negative = false; var shift = 0; for (var i = 0; i < inString.length; i++) { var byte = Base64Format.decodeChar(inString[i]); if (i === 0) { // Sign bit appears in the LSBit of the first value if ((byte & 1) === 1) { negative = true; } result = (byte >> 1) & 15; // 1111x } else { result = result | ((byte & 31) << shift); // 11111 } shift += (i === 0) ? 4 : 5; if ((byte & 32) === 32) { // Continue } else { return { value: negative ? -(result) : result, rest: inString.substr(i + 1) }; } } throw new Error(getDiagnosticMessage(DiagnosticCode.Base64_value_0_finished_with_a_continuation_bit, [inString])); } } } ================================================ FILE: tests/inputs/TypeScript_2.ts ================================================ import { createServer } from 'http' // from @frankdugan3, an example of TypeScript code export const server = createServer((req, res) => { // that was misidentified as Qt Linguist in cloc res.writeHead(200, { 'Content-type': 'text/plain' }) // versions before 1.78 res.write('Hello world!') res.end() }).listen(8080) ================================================ FILE: tests/inputs/USS.uss ================================================ /* https://github.com/AlDanial/cloc/pull/919 */ /* name selector (like ID selector in CSS) */ #root { /* some style this is an example of a multiline comment */ } /* class selector (like in CSS) */ .hidden { display: none; } ================================================ FILE: tests/inputs/UXML.uxml ================================================ {% endblock %} {% block content %}

Index

#}

Welcome to my awesome homepage.

{% endblock %} ================================================ FILE: tests/inputs/child_template.njk ================================================ {# https://jinja.palletsprojects.com/en/2.11.x/templates/#comments #} se.html" %} {% block title %}Index{% endblock %} {% block head %} {{ super() }} {% endblock %} {% block content %}

Index

#}

Welcome to my awesome homepage.

{% endblock %} ================================================ FILE: tests/inputs/clarityfiles.clar ================================================ ;; Test fixture for Clarity language ;; This file covers various comment and code patterns (define-constant TEST_CONSTANT u100) ;; Full line comment before code (define-read-only (test-function (param uint)) (ok param) ) ;; Another comment (define-map test-map uint bool ) (define-public (public-function) ;; Inline comment in function (begin ;; Nested comment (ok true) ) ) ;; Trailing comment on code line (define-data-var counter uint u0) ;; end of line comment ;; Multiple blank lines above (define-constant ANOTHER_CONSTANT u200) ================================================ FILE: tests/inputs/class.imba ================================================ # https://github.com/imba/imba/raw/master/test/syntax/class.imba extern describe, test, ok, eq, it class Organism var lvar = 10 def self.type 'organism' def initialize @ivar = 1 def lineage 'organism' def name 'organism' def speak 'ghaarg' def alive yes def lvar lvar # hmm, maybe we shouldnt allow this? # class Other # # def inner # yes class Virus < Organism def initialize @ivar = 2 def lineage "{name}.{super.lineage}" def name 'virus' class Animal < Organism # def self.type # "animal.{super}" def lineage "animal.{super.lineage}" class Cat < Animal # def self.type # "cat.{super}" def lineage "cat.{super.lineage}" def speak 'miau' class Dog < Animal # def self.type # "dog.{super}" def lineage "dog.{super.lineage}" def speak 'woff' class Human < Animal def lineage "human.{super.lineage}" def speak 'hello' class Zombie < Human def lineage "zombie.{super.lineage}" def alive no describe 'Syntax - Class' do # test 'nested classes work' do # ok !!Organism.Other test 'should' do # you can define variables local to classbody var obj = Organism.new eq obj.lvar, 10 describe 'Methods' do it 'should define class methods' do eq Organism.type, 'organism' it 'should inherit class methods' do eq Virus:type, Organism:type # it 'should call super in class methods' do # eq Dog.type, "dog.animal.organism" # eq Cat.type, "cat.animal.organism" describe 'Instance' do it 'should call the parent constructor by default' do var obj = Cat.new eq obj.@ivar, 1 it 'should define instance methods' do var obj = Organism.new var val = obj.alive # eq val, true ok obj.alive eq obj.speak, 'ghaarg' it 'should inherit instance methods' do var obj = Virus.new ok obj.alive it 'should override instance methods' do eq Organism.new.name, 'organism' eq Virus.new.name, 'virus' it 'should call super in instance methods' do # Should not refer to the prototype directly? eq Virus.new.lineage, 'virus.organism' eq Zombie.new.lineage, 'zombie.human.animal.organism' test 'define methods outside scope' do class Cls def self.a do 1 def a do 2 def Cls.b 1 extend class Cls def b 2 eq Cls.a, 1 eq Cls.b, 1 eq Cls.new.a, 2 eq Cls.new.b, 2 test 'Scoping' do var variable = 1 local class A var variable = 2 def self.base variable def self.add add variable += add def initialize add @sum = variable + add self def base variable def sum @sum eq variable, 1 eq A.base, 2 eq A.new.base, 2 eq A.new(5).sum, 7 A.add(2) eq variable, 1 ### eq A.base, 4 ### ### test 'issue #71' do var res var def ping cb res = cb() class A ping do self eq res, A ### ================================================ FILE: tests/inputs/cli-args.nf ================================================ #!/usr/bin/env nextflow // https://github.com/nextflow-io/nextflow/raw/refs/heads/master/tests/cli-args.nf /* * Copyright 2013-2024, Seqera Labs * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ println "alpha: ${params.alpha}" println "beta : ${params.beta}" println "delta: ${params.delta}" println "gamma: ${params.gamma}" println "omega: ${params.omega}" println "args : ${args.join('_')}" ================================================ FILE: tests/inputs/cloc-dev.code-workspace ================================================ { // this is a comment "folders": [ { "path": "." }, { "path": "tests" }, { "path": "Unix" } /* more comments */ ], "settings": {} } ================================================ FILE: tests/inputs/cloc_counts.csv ================================================ files,language,blank,comment,code,"github.com/AlDanial/cloc v 1.89 T=0.15 s (1625.6 files/s, 119625.7 lines/s)" 2,ANTLR Grammar,200,59,1012 3,R,95,312,698 1,C/C++ Header,191,780,617 11,C++,132,183,603 2,Forth,17,84,529 4,TypeScript,53,39,416 1,Logtalk,59,57,368 7,C,110,72,354 2,Windows Message File,89,9,348 2,TeX,36,64,265 1,Racket,32,159,247 1,SVG,19,4,242 1,Glade,0,22,232 1,DIET,10,4,230 1,Windows Resource File,42,45,218 3,Assembly,40,140,204 2,make,49,85,139 1,Zig,2,10,128 5,Bourne Shell,17,7,123 2,Idris,38,90,117 1,ECPP,26,34,116 2,Prolog,43,8,114 1,Ruby,11,30,111 1,Hoon,0,10,110 1,Imba,71,30,108 1,Thrift,57,134,97 1,Xtend,17,52,91 1,Lean,36,20,90 1,Odin,32,56,90 2,Smalltalk,19,5,85 1,Vuejs Component,10,2,85 5,Java,13,28,81 1,Scheme,10,18,78 1,MXML,23,5,74 2,Perl,44,72,73 3,Visual Basic,48,57,72 3,MATLAB,3,11,68 1,Oracle PL/SQL,0,15,67 1,Haml,5,16,66 1,Swift,23,13,65 1,Fish Shell,14,47,62 1,RAML,5,3,62 1,Verilog-SystemVerilog,4,20,62 1,Clean,10,30,58 1,Qt Linguist,0,4,57 1,SaltStack,6,1,55 1,Dockerfile,4,1,53 1,Meson,13,9,48 1,Fennel,6,3,44 1,JCL,0,18,44 1,HCL,14,36,43 1,Nim,5,13,43 1,Nix,15,15,43 1,Sass,14,0,43 3,Go,14,41,40 1,Raku,19,12,39 3,SQL,24,36,39 1,Agda,10,3,38 3,COBOL,5,8,35 4,Haskell,23,26,35 1,RobotFramework,9,5,35 1,AsciiDoc,17,27,34 1,EJS,0,11,34 1,IPL,6,15,33 1,PO File,9,18,33 1,GLSL,10,14,32 1,WebAssembly,8,20,32 2,Mustache,5,7,31 2,Specman e,4,12,31 1,Squirrel,6,4,31 7,Python,16,54,30 1,ASP.NET,8,0,29 1,Apex Class,3,6,28 1,Cucumber,3,2,28 1,Drools,7,16,28 1,Freemarker Template,0,2,27 1,Puppet,2,2,27 1,Bazel,7,1,26 2,PHP,11,13,26 1,LFE,15,21,25 1,Objective-C,11,11,25 1,Scala,8,8,25 1,Brainfuck,1,3,24 6,Fortran 90,1,18,24 1,Haxe,26,99,24 1,Lisp,5,26,24 3,C#,8,7,23 1,Blade,10,5,22 1,JSON,0,0,22 1,JSON5,0,4,22 2,Mathematica,24,17,22 1,Stata,7,7,22 1,TOML,8,4,22 1,Jupyter Notebook,0,126,21 1,Smarty,1,1,21 1,YAML,0,1,20 1,BrightScript,0,3,19 1,Igor Pro,4,6,19 1,PL/M,1,5,19 1,Solidity,0,2,19 1,TTCN,11,16,19 2,XSLT,0,4,19 4,Pascal,4,15,18 1,Windows Module Definition,1,1,18 1,Gradle,0,2,17 1,Mojo,6,4,17 2,Razor,6,7,17 2,Logos,6,3,16 1,Gencat NLS,1,4,15 5,JavaScript,3,0,15 1,Pig Latin,19,40,15 1,SWIG,4,4,15 1,TNSDL,5,3,15 1,Embedded Crystal,4,4,14 1,F#,3,6,14 1,GraphQL,1,2,14 2,IDL,25,7,14 1,SugarSS,5,4,13 1,Velocity Template Language,0,20,13 1,Starlark,3,4,11 1,Jinja Template,0,6,10 1,Slim,0,3,10 1,reStructuredText,6,4,10 1,Kotlin,0,3,9 1,Mako,3,8,9 1,Svelte,2,2,9 1,Vala,0,5,9 3,XML,0,5,9 1,F# Script,1,2,8 1,FXML,2,3,8 1,SparForte,6,8,8 1,WXML,3,2,8 1,Elixir,3,10,7 2,Fortran 77,1,8,7 1,INI,2,3,7 3,Lua,9,33,7 1,Chapel,7,35,6 2,Julia,4,15,5 1,PL/I,0,7,5 1,APL,3,6,4 1,Arduino Sketch,1,5,4 1,ReasonML,2,8,4 1,Rmd,10,19,4 1,WXSS,0,0,4 1,Groovy,0,3,3 1,LLVM IR,2,6,3 1,Literate Idris,2,2,3 1,ProGuard,7,14,3 1,Tcl/Tk,1,2,3 1,dhall,6,17,3 1,ColdFusion,1,2,2 1,DOS Batch,1,2,2 1,Focus,1,2,1 1,MUMPS,0,2,1 1,XQuery,0,1,1 1,xBase,0,9,1 243,SUM,2381,4182,11319 ================================================ FILE: tests/inputs/clusterConf.ttcn ================================================ // http://www.wiley.com/legacy/wileychi/ttcn-3/supp/clusterConf.ttcn /* ------------------------------------------------------------ * * $Id: clusterConf.ttcn,v 1.5 2005/02/10 07:33:55 deiss Exp $ * * @author Thomas Deiss * @remark Copyright: Nokia, 2004, 2005 * * @remark DISCLAIMER: This TTCN-3 code is experimental code. * Its purpose is to highlight strengths and weaknesses of * TTCN-3, but it is not intended to be directly added to * real test suites. The reader is strongly advised to check the code * whether it fits the readers purpose and adapt it accordingly. * * @desc This module contains type definitions for clusters of components. */ module clusterConf { group g_ports { type port AnyPort mixed { inout all } } // endgroup g_ports group g_components { type component Server { port AnyPort pt_servers } type component Supervisor { port AnyPort pt_servers; port AnyPort pt_cluster } type component Worker { port AnyPort pt_servers } } // endgroup g_components } //endmodule clusterConf ================================================ FILE: tests/inputs/comments.rhai ================================================ // https://github.com/rhaiscript/rhai/raw/refs/heads/main/scripts/comments.rhai // Note: nested /* */ comments, as below, are not handled correctly by cloc // I am a single line comment! let /* I am a spy in a variable declaration! */ x = 5; /* I am a simple multi-line comment */ /* look /* at /* that, /* multi-line */ comments */ can be */ nested */ /* surrounded by */ let this_is_not_a_comment = true // comments ================================================ FILE: tests/inputs/comments_in_str.svelte ================================================
Hello
================================================ FILE: tests/inputs/comp.ecpp ================================================

Calling subcomponents

Ecpp-pages can embed other pages. These embedded pages are called subcomponents. They come in 2 variants: local and external. Local subcomponents are defined inside another component with <%def componentname> and closed with </def>. External subcomponents are normal components.

A subcomponentcall starts with <& and ends with &>. Insert the componentname between these tags. If you omit the library-part of the component, the current library is used. If the componentname is a single word, ecpp looks for a local component, which is called if found. Otherwise it is a external componentcall.

You can dynamically build componentnames, by putting a c++-expression inside brackets. This expression is evaluated on runtime and the resulting component is called. The expression can be of type (or convertable to) std::string, tnt::Compident or tnt::Subcompident.

After the componentname you can add named parameters. Put a name followed by '=' and a value. The value is either a constant string or a expression. A expression must be bracketed. If you want to pass just the same parameters your current component received, put the single word qparam into the list (actually you can pass any cxxtools::query_params-variable).

A special case are local components, which have c++-parameters. You can put a normal parameterlist just like in c++-functions after the defition (<%def>-block) after the componentname. The can only be called locally.

Just a local componentcall

<& localcomp param1="value1" &>

<& localcomp param1="value1" &>

Another local componentcall. We pass a c++-parameter.

<& localcomp_p(5) &>

<& localcomp_p(5) >

A external componentcall (localcomp "extcomp" does not exist)

<& subcomp param1="value1" &>

<& subcomp param1="value1" &>

a external componentcall

<& extcomp@extlib param1="value1" &>

<& extcomp@extlib param1="value1" &>

a external subcomponentcall

<& extcomp.subcomp@extlib param1="value1" &>

<& extcomp.subcomp@extlib param1="value1" &>

compose componentname by expression

<{ // define some variables here std::string compname = "extcomp"; std::string libname = "extlib"; }>

<& (compname + '@' + libname) param1="value1" &>

<& (compname + '@' + libname) param1="value1" &>

call component by componentidentifier

<& (tnt::Compident(compname, libname)) param1="value1" &>

<& (tnt::Compident(libname, compname)) param1="value1" &>

pass a expression as parameter

<& localcomp param1=(1+5) qparam param2="uhu"&>

<& localcomp param1=(1+5) qparam param2="uhu"&>

pass multiple values with the same name as parameter

<& localcomp param3="value1" param3="value2" param4="17" param4=(28) &>

<& localcomp param3="value1" param3="value2" param4="17" param4=(28) &> <%doc>

call subcomponents in c++-blocks

callComp("extcomp@extlib", request, reply, qparam);

<{ callComp("extcomp@extlib", request, reply, qparam); }>

<%def localcomp> <%args> param1; param2; param3[]; int param4[]; This is a local subcomponent. We got a parameter param1 with the value <$param1$>. % if (!param2.empty()) { We got param2 also. Its value is <$param2$>. % } We got <$ param3.size() $> times "param3" and <$ param4.size() $> times "param4". The values of param3 are: <{ std::copy(param3.begin(), param3.end(), std::ostream_iterator(reply.out(), ", ")); }>. The values of param4 are: <{ std::copy(param4.begin(), param4.end(), std::ostream_iterator(reply.out(), ", ")); }>. <%def localcomp_p(int i)> This is a local subcomponent with parameter. We got a c++-integer-parameter with the value <$i$>. This component can only be called locally because of c++-parameters. ================================================ FILE: tests/inputs/complex_union.derw ================================================ -- https://github.com/eeue56/derw/blob/main/examples/complex_union.derw type Animal = Dog { name: string } | Cat { lives: number } sayHiToPet: Animal -> string sayHiToPet pet = case pet of Dog { name } -> `Good boy ${name}!` {- Cat { lives } -> "You have " + lives + " lives remaining." -} main: void main = Dog { name: "roof" } |> sayHiToPet |> console.log ================================================ FILE: tests/inputs/conditions.CBL ================================================ $ SET SOURCEFORMAT"FREE" IDENTIFICATION DIVISION. PROGRAM-ID. Conditions. AUTHOR. Michael Coughlan. * An example program demonstrating the use of * condition names (level 88's). * The EVALUATE and PERFORM verbs are also used. DATA DIVISION. WORKING-STORAGE SECTION. 01 Char PIC X. 88 Vowel VALUE "a", "e", "i", "o", "u". 88 Consonant VALUE "b", "c", "d", "f", "g", "h" "j" THRU "n", "p" THRU "t", "v" THRU "z". 88 Digit VALUE "0" THRU "9". 88 ValidCharacter VALUE "a" THRU "z", "0" THRU "9". PROCEDURE DIVISION. Begin. DISPLAY "Enter lower case character or digit. No data ends.". ACCEPT Char. PERFORM UNTIL NOT ValidCharacter EVALUATE TRUE WHEN Vowel DISPLAY "The letter " Char " is a vowel." WHEN Consonant DISPLAY "The letter " Char " is a consonant." WHEN Digit DISPLAY Char " is a digit." WHEN OTHER DISPLAY "problems found" END-EVALUATE END-PERFORM STOP RUN. ================================================ FILE: tests/inputs/config.junos ================================================ ## Last commit: 2017-02-16 10:48:24 PST by root # based on https://github.com/Juniper/Intro-to-Using-Ansible-with-Junos-OS/raw/master/library/config.conf version 14.2R6.5; groups { re0 { system { /* host-name be-mx480-1-re0; */ } interfaces { fxp0 { /* unit 0 { family inet { filter { group 1; */ } address **.***.*.**/22; } } } } } re1 { system { host-name be-mx480-1-re1; } interfaces { fxp0 { unit 0 { family inet { filter { group 1; } address **.***.*.**/22; } } } } } global { system { domain-name ********; domain-search [ ******** ]; backup-router **.***.*.*** destination *.*.*.*; time-zone America/Los_Angeles; debugger-on-panic; debugger-on-break; dump-on-panic; authentication-order [ radius password ]; root-authentication { encrypted-password ****** } name-server { ***.***.*.**; ***.***.**.***; ***.**.**.***; ***.**.**.***; } radius-server { ***.***.**.*** ***.***.**.** } login { class superuser-local { permissions all; } user labadmin { uid 2003; class superuser; shell csh; authentication { encrypted-password **** } } } services { finger; ftp; rlogin; rsh; ssh; telnet; xnm-clear-text; netconf { ssh; } } syslog { user * { any emergency; } file messages { any warning; authorization info; archive world-readable; } file security { interactive-commands any; archive world-readable; } } processes { routing enable; ntp enable; management enable; watchdog enable; snmp enable; inet-process enable; mib-process enable; } ntp { boot-server ***.**.**.*; server ***.**.**.*; } } snmp { location "Software lab"; interface fxp0.0; community public { authorization read-only; } community private { authorization read-write; } } routing-options { static { route 10.***.*.*/16 { next-hop 10.***.*.***; retain; no-readvertise; } } } } } apply-groups [ global re0 re1 ]; ================================================ FILE: tests/inputs/cpp-example.inc ================================================ # # Copyright OpenEmbedded Contributors # # SPDX-License-Identifier: MIT # LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" DEPENDS += "json-c" PV = "1.0" SRC_URI = "\ file://cpp-example.cpp \ file://cpp-example-lib.hpp \ file://cpp-example-lib.cpp \ file://test-cpp-example.cpp \ file://run-ptest \ " S = "${WORKDIR}" inherit ptest ================================================ FILE: tests/inputs/cross-platform.just ================================================ # https://github.com/casey/just/blob/master/examples/cross-platform.just # use with https://github.com/casey/just # # Example cross-platform Python project # python_dir := if os_family() == "windows" { "./.venv/Scripts" } else { "./.venv/bin" } python := python_dir + if os_family() == "windows" { "/python.exe" } else { "/python3" } system_python := if os_family() == "windows" { "py.exe -3.9" } else { "python3.9" } # Set up development environment bootstrap: if test ! -e .venv; then {{ system_python }} -m venv .venv; fi {{ python }} -m pip install --upgrade pip wheel pip-tools {{ python_dir }}/pip-sync # Upgrade Python dependencies upgrade-deps: && bootstrap {{ python_dir }}/pip-compile --upgrade # Sample project script 1 script1: {{ python }} script1.py # Sample project script 2 script2 *ARGS: {{ python }} script2.py {{ ARGS }} ================================================ FILE: tests/inputs/csharp-designer.designer.cs ================================================ //------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. // //------------------------------------------------------------------------------ namespace StyleCop.CSharp { using System; /// /// A strongly-typed resource class, for looking up localized strings, etc. /// // This class was auto-generated by the StronglyTypedResourceBuilder // class via a tool like ResGen or Visual Studio. // To add or remove a member, edit your .ResX file then rerun ResGen // with the /str option, or rebuild your VS project. [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] internal class Strings { private static global::System.Resources.ResourceManager resourceMan; private static global::System.Globalization.CultureInfo resourceCulture; [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] internal Strings() { } /// /// Returns the cached ResourceManager instance used by this class. /// [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null)) { global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("StyleCop.CSharp.Strings", typeof(Strings).Assembly); resourceMan = temp; } return resourceMan; } } /// /// Looks up a localized string similar to StyleCop. /// internal static string Title { get { return ResourceManager.GetString("Title", resourceCulture); } } } } ================================================ FILE: tests/inputs/cucumber.feature ================================================ # https://raw.githubusercontent.com/diaspora/diaspora/master/features/mobile/activity_stream.feature @javascript @mobile Feature: Viewing my activity on the steam mobile page In order to navigate Diaspora* As a mobile user I want to view my activity stream Background: Given following users exist: | username | | alice | | bob | And a user with username "bob" is connected with "alice" And "alice@alice.alice" has a public post with text "Hello! I am #newhere" # another comment Scenario: Show my activity empty When I sign in as "bob@bob.bob" on the mobile website When I go to the activity stream page Then I should see "My activity" within "#main" And I should not see "Hello! I am #newhere" Scenario: Show liked post on my activity When I sign in as "bob@bob.bob" on the mobile website When I click on selector "a.like-action.inactive" And I go to the activity stream page Then I should see "My activity" within "#main" And I should see "Hello! I am #newhere" within ".ltr" Scenario: Show own post on my activity When I sign in as "alice@alice.alice" on the mobile website And I go to the activity stream page Then I should see "My activity" within "#main" And I should see "Hello! I am #newhere" within ".ltr" ================================================ FILE: tests/inputs/custom.triple.extension.js ================================================ js 4 ================================================ FILE: tests/inputs/darwin-configuration.nix ================================================ # https://raw.githubusercontent.com/input-output-hk/iohk-ops/develop/nix-darwin/darwin-configuration.nix { config, pkgs, ... }: let opsLib = import ; in { imports = [ ]; # List packages installed in system profile. To search by name, run: # $ nix-env -qaP | grep wget environment.systemPackages = with pkgs; [ nix-repl nix tmux ncdu git ] ++ (if pkgs.stdenv.isDarwin then [ darwin.cctools ] else []); # Create /etc/bashrc that loads the nix-darwin environment. programs.bash.enable = true; # programs.zsh.enable = true; # programs.fish.enable = true; # Used for backwards compatibility, please read the changelog before changing. # $ darwin-rebuild changelog system.stateVersion = 2; # You should generally set this to the total number of logical cores in your system. # $ sysctl -n hw.ncpu nix.maxJobs = 4; nix.buildCores = 0; nix.useSandbox = false; # this seems to break things when enabled nix.extraOptions = '' gc-keep-derivations = true gc-keep-outputs = true ''; nix.binaryCachePublicKeys = [ "hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ=" ]; nix.binaryCaches = [ "https://hydra.iohk.io" ]; nix.trustedUsers = [ "@admin" ]; nix.nixPath = [ "nixpkgs=UNSET" "darwin=UNSET" "darwin-config=UNSET" "iohk-ops=UNSET" ]; ######################################################################## # try to ensure 25G of free space nix.gc.automatic = true; nix.gc.options = "--max-freed $((25 * 1024**3 - 1024 * $(df -P -k /nix/store | tail -n 1 | awk '{ print $4 }')))"; ######################################################################## services.nix-daemon.enable = true; # Recreate /run/current-system symlink after boot. services.activate-system.enable = true; system.activationScripts.postActivation.text = '' printf "disabling spotlight indexing... " mdutil -i off -d / &> /dev/null mdutil -E / &> /dev/null echo "ok" ''; ######################################################################## } ================================================ FILE: tests/inputs/dd/bb/cc/MoreTeapotsRenderer.cpp ================================================ /* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //-------------------------------------------------------------------------------- // MoreTeapotsRenderer.cpp // Render teapots //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // Include files //-------------------------------------------------------------------------------- #include "MoreTeapotsRenderer.h" //-------------------------------------------------------------------------------- // Teapot model data //-------------------------------------------------------------------------------- #include "teapot.inl" //-------------------------------------------------------------------------------- // Ctor //-------------------------------------------------------------------------------- MoreTeapotsRenderer::MoreTeapotsRenderer() : geometry_instancing_support_( false ) { } //-------------------------------------------------------------------------------- // Dtor //-------------------------------------------------------------------------------- MoreTeapotsRenderer::~MoreTeapotsRenderer() { Unload(); } //-------------------------------------------------------------------------------- // Init //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Init( const int32_t numX, const int32_t numY, const int32_t numZ ) { if( ndk_helper::GLContext::GetInstance()->GetGLVersion() >= 3.0 ) { geometry_instancing_support_ = true; } else if( ndk_helper::GLContext::GetInstance()->CheckExtension( "GL_NV_draw_instanced" ) && ndk_helper::GLContext::GetInstance()->CheckExtension( "GL_NV_uniform_buffer_object" ) ) { LOGI( "Supported via extension!" ); //_bGeometryInstancingSupport = true; //_bARBSupport = true; //Need to patch shaders //Currently this has been disabled } //Settings glFrontFace( GL_CCW ); //Create Index buffer num_indices_ = sizeof(teapotIndices) / sizeof(teapotIndices[0]); glGenBuffers( 1, &ibo_ ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof(teapotIndices), teapotIndices, GL_STATIC_DRAW ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); //Create VBO num_vertices_ = sizeof(teapotPositions) / sizeof(teapotPositions[0]) / 3; int32_t iStride = sizeof(TEAPOT_VERTEX); int32_t iIndex = 0; TEAPOT_VERTEX* p = new TEAPOT_VERTEX[num_vertices_]; for( int32_t i = 0; i < num_vertices_; ++i ) { p[i].pos[0] = teapotPositions[iIndex]; p[i].pos[1] = teapotPositions[iIndex + 1]; p[i].pos[2] = teapotPositions[iIndex + 2]; p[i].normal[0] = teapotNormals[iIndex]; p[i].normal[1] = teapotNormals[iIndex + 1]; p[i].normal[2] = teapotNormals[iIndex + 2]; iIndex += 3; } glGenBuffers( 1, &vbo_ ); glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); glBufferData( GL_ARRAY_BUFFER, iStride * num_vertices_, p, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); delete[] p; //Init Projection matrices teapot_x_ = numX; teapot_y_ = numY; teapot_z_ = numZ; vec_mat_models_.reserve( teapot_x_ * teapot_y_ * teapot_z_ ); UpdateViewport(); const float total_width = 500.f; float gap_x = total_width / (teapot_x_ - 1); float gap_y = total_width / (teapot_y_ - 1); float gap_z = total_width / (teapot_z_ - 1); float offset_x = -total_width / 2.f; float offset_y = -total_width / 2.f; float offset_z = -total_width / 2.f; for( int32_t iX = 0; iX < teapot_x_; ++iX ) for( int32_t iY = 0; iY < teapot_y_; ++iY ) for( int32_t iZ = 0; iZ < teapot_z_; ++iZ ) { vec_mat_models_.push_back( ndk_helper::Mat4::Translation( iX * gap_x + offset_x, iY * gap_y + offset_y, iZ * gap_z + offset_z ) ); vec_colors_.push_back( ndk_helper::Vec3( random() / float( RAND_MAX * 1.1 ), random() / float( RAND_MAX * 1.1 ), random() / float( RAND_MAX * 1.1 ) ) ); float fX = random() / float( RAND_MAX ) - 0.5f; float fY = random() / float( RAND_MAX ) - 0.5f; vec_rotations_.push_back( ndk_helper::Vec2( fX * 0.05f, fY * 0.05f ) ); vec_current_rotations_.push_back( ndk_helper::Vec2( fX * M_PI, fY * M_PI ) ); } if( geometry_instancing_support_ ) { // //Create parameter dictionary for shader patch std::map param; param[std::string( "%NUM_TEAPOT%" )] = ToString( teapot_x_ * teapot_y_ * teapot_z_ ); param[std::string( "%LOCATION_VERTEX%" )] = ToString( ATTRIB_VERTEX ); param[std::string( "%LOCATION_NORMAL%" )] = ToString( ATTRIB_NORMAL ); if( arb_support_ ) param[std::string( "%ARB%" )] = std::string( "ARB" ); else param[std::string( "%ARB%" )] = std::string( "" ); //Load shader bool b = LoadShadersES3( &shader_param_, "Shaders/VS_ShaderPlainES3.vsh", "Shaders/ShaderPlainES3.fsh", param ); if( b ) { // //Create uniform buffer // GLuint bindingPoint = 1; GLuint blockIndex; blockIndex = glGetUniformBlockIndex( shader_param_.program_, "ParamBlock" ); glUniformBlockBinding( shader_param_.program_, blockIndex, bindingPoint ); //Retrieve array stride value int32_t iNumIndices; glGetActiveUniformBlockiv( shader_param_.program_, blockIndex, GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS, &iNumIndices ); GLint i[iNumIndices]; GLint stride[iNumIndices]; glGetActiveUniformBlockiv( shader_param_.program_, blockIndex, GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES, i ); glGetActiveUniformsiv( shader_param_.program_, iNumIndices, (GLuint*) i, GL_UNIFORM_ARRAY_STRIDE, stride ); ubo_matrix_stride_ = stride[0] / sizeof(float); ubo_vector_stride_ = stride[2] / sizeof(float); glGenBuffers( 1, &ubo_ ); glBindBuffer( GL_UNIFORM_BUFFER, ubo_ ); glBindBufferBase( GL_UNIFORM_BUFFER, bindingPoint, ubo_ ); //Store color value which wouldn't be updated every frame int32_t iSize = teapot_x_ * teapot_y_ * teapot_z_ * (ubo_matrix_stride_ + ubo_matrix_stride_ + ubo_vector_stride_); //Mat4 + Mat4 + Vec3 + 1 stride float* pBuffer = new float[iSize]; float* pColor = pBuffer + teapot_x_ * teapot_y_ * teapot_z_ * ubo_matrix_stride_ * 2; for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { memcpy( pColor, &vec_colors_[i], 3 * sizeof(float) ); pColor += ubo_vector_stride_; //Assuming std140 layout which is 4 DWORD stride for vectors } glBufferData( GL_UNIFORM_BUFFER, iSize * sizeof(float), pBuffer, GL_DYNAMIC_DRAW ); delete[] pBuffer; } else { LOGI( "Shader compilation failed!! Falls back to ES2.0 pass" ); //This happens some devices. geometry_instancing_support_ = false; //Load shader for GLES2.0 LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); } } else { //Load shader for GLES2.0 LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); } } void MoreTeapotsRenderer::UpdateViewport() { int32_t viewport[4]; glGetIntegerv( GL_VIEWPORT, viewport ); float fAspect = (float) viewport[2] / (float) viewport[3]; const float CAM_NEAR = 5.f; const float CAM_FAR = 10000.f; bool bRotate = false; mat_projection_ = ndk_helper::Mat4::Perspective( fAspect, 1.f, CAM_NEAR, CAM_FAR ); } //-------------------------------------------------------------------------------- // Unload //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Unload() { if( vbo_ ) { glDeleteBuffers( 1, &vbo_ ); vbo_ = 0; } if( ubo_ ) { glDeleteBuffers( 1, &ubo_ ); ubo_ = 0; } if( ibo_ ) { glDeleteBuffers( 1, &ibo_ ); ibo_ = 0; } if( shader_param_.program_ ) { glDeleteProgram( shader_param_.program_ ); shader_param_.program_ = 0; } } //-------------------------------------------------------------------------------- // Update //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Update( float fTime ) { const float CAM_X = 0.f; const float CAM_Y = 0.f; const float CAM_Z = 2000.f; mat_view_ = ndk_helper::Mat4::LookAt( ndk_helper::Vec3( CAM_X, CAM_Y, CAM_Z ), ndk_helper::Vec3( 0.f, 0.f, 0.f ), ndk_helper::Vec3( 0.f, 1.f, 0.f ) ); if( camera_ ) { camera_->Update(); mat_view_ = camera_->GetTransformMatrix() * mat_view_ * camera_->GetRotationMatrix(); } } //-------------------------------------------------------------------------------- // Render //-------------------------------------------------------------------------------- void MoreTeapotsRenderer::Render() { // Bind the VBO glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); int32_t iStride = sizeof(TEAPOT_VERTEX); // Pass the vertex data glVertexAttribPointer( ATTRIB_VERTEX, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 0 ) ); glEnableVertexAttribArray( ATTRIB_VERTEX ); glVertexAttribPointer( ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 3 * sizeof(GLfloat) ) ); glEnableVertexAttribArray( ATTRIB_NORMAL ); // Bind the IB glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glUseProgram( shader_param_.program_ ); TEAPOT_MATERIALS material = { { 1.0f, 1.0f, 1.0f, 10.f }, { 0.1f, 0.1f, 0.1f }, }; //Update uniforms // //using glUniform3fv here was troublesome.. // glUniform4f( shader_param_.material_specular_, material.specular_color[0], material.specular_color[1], material.specular_color[2], material.specular_color[3] ); glUniform3f( shader_param_.material_ambient_, material.ambient_color[0], material.ambient_color[1], material.ambient_color[2] ); glUniform3f( shader_param_.light0_, 100.f, -200.f, -600.f ); if( geometry_instancing_support_ ) { // //Geometry instancing, new feature in GLES3.0 // //Update UBO glBindBuffer( GL_UNIFORM_BUFFER, ubo_ ); float* p = (float*) glMapBufferRange( GL_UNIFORM_BUFFER, 0, teapot_x_ * teapot_y_ * teapot_z_ * (ubo_matrix_stride_ * 2) * sizeof(float), GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_RANGE_BIT ); float* pMVPMat = p; float* pMVMat = p + teapot_x_ * teapot_y_ * teapot_z_ * ubo_matrix_stride_; for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { //Rotation float fX, fY; vec_current_rotations_[i] += vec_rotations_[i]; vec_current_rotations_[i].Value( fX, fY ); ndk_helper::Mat4 mat_rotation = ndk_helper::Mat4::RotationX( fX ) * ndk_helper::Mat4::RotationY( fY ); // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_v = mat_view_ * vec_mat_models_[i] * mat_rotation; ndk_helper::Mat4 mat_vp = mat_projection_ * mat_v; memcpy( pMVPMat, mat_vp.Ptr(), sizeof(mat_v) ); pMVPMat += ubo_matrix_stride_; memcpy( pMVMat, mat_v.Ptr(), sizeof(mat_v) ); pMVMat += ubo_matrix_stride_; } glUnmapBuffer( GL_UNIFORM_BUFFER ); //Instanced rendering glDrawElementsInstanced( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0), teapot_x_ * teapot_y_ * teapot_z_ ); } else { //Regular rendering pass for( int32_t i = 0; i < teapot_x_ * teapot_y_ * teapot_z_; ++i ) { //Set diffuse float x, y, z; vec_colors_[i].Value( x, y, z ); glUniform4f( shader_param_.material_diffuse_, x, y, z, 1.f ); //Rotation vec_current_rotations_[i] += vec_rotations_[i]; vec_current_rotations_[i].Value( x, y ); ndk_helper::Mat4 mat_rotation = ndk_helper::Mat4::RotationX( x ) * ndk_helper::Mat4::RotationY( y ); // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_v = mat_view_ * vec_mat_models_[i] * mat_rotation; ndk_helper::Mat4 mat_vp = mat_projection_ * mat_v; glUniformMatrix4fv( shader_param_.matrix_projection_, 1, GL_FALSE, mat_vp.Ptr() ); glUniformMatrix4fv( shader_param_.matrix_view_, 1, GL_FALSE, mat_v.Ptr() ); glDrawElements( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0) ); } } glBindBuffer( GL_ARRAY_BUFFER, 0 ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); } //-------------------------------------------------------------------------------- // LoadShaders //-------------------------------------------------------------------------------- bool MoreTeapotsRenderer::LoadShaders( SHADER_PARAMS* params, const char* strVsh, const char* strFsh ) { // //Shader load for GLES2 //In GLES2.0, shader attribute locations need to be explicitly specified before linking // GLuint program; GLuint vertShader, fragShader; char *vertShaderPathname, *fragShaderPathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vertShader, GL_VERTEX_SHADER, strVsh ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &fragShader, GL_FRAGMENT_SHADER, strFsh ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vertShader ); // Attach fragment shader to program glAttachShader( program, fragShader ); // Bind attribute locations // this needs to be done prior to linking glBindAttribLocation( program, ATTRIB_VERTEX, "myVertex" ); glBindAttribLocation( program, ATTRIB_NORMAL, "myNormal" ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vertShader ) { glDeleteShader( vertShader ); vertShader = 0; } if( fragShader ) { glDeleteShader( fragShader ); fragShader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->matrix_projection_ = glGetUniformLocation( program, "uPMatrix" ); params->matrix_view_ = glGetUniformLocation( program, "uMVMatrix" ); params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_diffuse_ = glGetUniformLocation( program, "vMaterialDiffuse" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vertShader ) glDeleteShader( vertShader ); if( fragShader ) glDeleteShader( fragShader ); params->program_ = program; return true; } bool MoreTeapotsRenderer::LoadShadersES3( SHADER_PARAMS* params, const char* strVsh, const char* strFsh, std::map&shaderParams ) { // //Shader load for GLES3 //In GLES3.0, shader attribute index can be described in a shader code directly with layout() attribute // GLuint program; GLuint vertShader, fragShader; char *vertShaderPathname, *fragShaderPathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vertShader, GL_VERTEX_SHADER, strVsh, shaderParams ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &fragShader, GL_FRAGMENT_SHADER, strFsh, shaderParams ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vertShader ); // Attach fragment shader to program glAttachShader( program, fragShader ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vertShader ) { glDeleteShader( vertShader ); vertShader = 0; } if( fragShader ) { glDeleteShader( fragShader ); fragShader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vertShader ) glDeleteShader( vertShader ); if( fragShader ) glDeleteShader( fragShader ); params->program_ = program; return true; } //-------------------------------------------------------------------------------- // Bind //-------------------------------------------------------------------------------- bool MoreTeapotsRenderer::Bind( ndk_helper::TapCamera* camera ) { camera_ = camera; return true; } //-------------------------------------------------------------------------------- // Helper functions //-------------------------------------------------------------------------------- std::string MoreTeapotsRenderer::ToString( const int32_t i ) { char str[64]; snprintf( str, sizeof(str), "%d", i ); return std::string( str ); } ================================================ FILE: tests/inputs/dd/bb/config.c ================================================ /* Generated automatically from /s/ndk-toolchain/src/python/Python-2.7.5/Modules/config.c.in by makesetup. */ /* -*- C -*- *********************************************** Copyright (c) 2000, BeOpen.com. Copyright (c) 1995-2000, Corporation for National Research Initiatives. Copyright (c) 1990-1995, Stichting Mathematisch Centrum. All rights reserved. See the file "Misc/COPYRIGHT" for information on usage and redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. ******************************************************************/ /* Module configuration */ /* !!! !!! !!! This file is edited by the makesetup script !!! !!! !!! */ /* This file contains the table of built-in modules. See init_builtin() in import.c. */ #include "Python.h" #ifdef __cplusplus extern "C" { #endif extern void initposix(void); extern void initthread(void); extern void initsignal(void); extern void initerrno(void); extern void init_sre(void); extern void init_codecs(void); extern void init_weakref(void); extern void initzipimport(void); extern void init_symtable(void); extern void initxxsubtype(void); /* -- ADDMODULE MARKER 1 -- */ extern void PyMarshal_Init(void); extern void initimp(void); extern void initgc(void); extern void init_ast(void); extern void _PyWarnings_Init(void); struct _inittab _PyImport_Inittab[] = { {"posix", initposix}, {"thread", initthread}, {"signal", initsignal}, {"errno", initerrno}, {"_sre", init_sre}, {"_codecs", init_codecs}, {"_weakref", init_weakref}, {"zipimport", initzipimport}, {"_symtable", init_symtable}, {"xxsubtype", initxxsubtype}, /* -- ADDMODULE MARKER 2 -- */ /* This module lives in marshal.c */ {"marshal", PyMarshal_Init}, /* This lives in import.c */ {"imp", initimp}, /* This lives in Python/Python-ast.c */ {"_ast", init_ast}, /* These entries are here for sys.builtin_module_names */ {"__main__", NULL}, {"__builtin__", NULL}, {"sys", NULL}, {"exceptions", NULL}, /* This lives in gcmodule.c */ {"gc", initgc}, /* This lives in _warnings.c */ {"_warnings", _PyWarnings_Init}, /* Sentinel */ {0, 0} }; #ifdef __cplusplus } #endif ================================================ FILE: tests/inputs/dd/bb/ee/TeapotRenderer.cpp ================================================ /* * Copyright 2013 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //-------------------------------------------------------------------------------- // TeapotRenderer.cpp // Render a teapot //-------------------------------------------------------------------------------- //-------------------------------------------------------------------------------- // Include files //-------------------------------------------------------------------------------- #include "TeapotRenderer.h" //-------------------------------------------------------------------------------- // Teapot model data //-------------------------------------------------------------------------------- #include "teapot.inl" //-------------------------------------------------------------------------------- // Ctor //-------------------------------------------------------------------------------- TeapotRenderer::TeapotRenderer() { } //-------------------------------------------------------------------------------- // Dtor //-------------------------------------------------------------------------------- TeapotRenderer::~TeapotRenderer() { Unload(); } void TeapotRenderer::Init() { //Settings glFrontFace( GL_CCW ); //Load shader LoadShaders( &shader_param_, "Shaders/VS_ShaderPlain.vsh", "Shaders/ShaderPlain.fsh" ); //Create Index buffer num_indices_ = sizeof(teapotIndices) / sizeof(teapotIndices[0]); glGenBuffers( 1, &ibo_ ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glBufferData( GL_ELEMENT_ARRAY_BUFFER, sizeof(teapotIndices), teapotIndices, GL_STATIC_DRAW ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); //Create VBO num_vertices_ = sizeof(teapotPositions) / sizeof(teapotPositions[0]) / 3; int32_t iStride = sizeof(TEAPOT_VERTEX); int32_t iIndex = 0; TEAPOT_VERTEX* p = new TEAPOT_VERTEX[num_vertices_]; for( int32_t i = 0; i < num_vertices_; ++i ) { p[i].pos[0] = teapotPositions[iIndex]; p[i].pos[1] = teapotPositions[iIndex + 1]; p[i].pos[2] = teapotPositions[iIndex + 2]; p[i].normal[0] = teapotNormals[iIndex]; p[i].normal[1] = teapotNormals[iIndex + 1]; p[i].normal[2] = teapotNormals[iIndex + 2]; iIndex += 3; } glGenBuffers( 1, &vbo_ ); glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); glBufferData( GL_ARRAY_BUFFER, iStride * num_vertices_, p, GL_STATIC_DRAW ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); delete[] p; UpdateViewport(); mat_model_ = ndk_helper::Mat4::Translation( 0, 0, -15.f ); ndk_helper::Mat4 mat = ndk_helper::Mat4::RotationX( M_PI / 3 ); mat_model_ = mat * mat_model_; } void TeapotRenderer::UpdateViewport() { //Init Projection matrices int32_t viewport[4]; glGetIntegerv( GL_VIEWPORT, viewport ); float fAspect = (float) viewport[2] / (float) viewport[3]; const float CAM_NEAR = 5.f; const float CAM_FAR = 10000.f; bool bRotate = false; mat_projection_ = ndk_helper::Mat4::Perspective( fAspect, 1.f, CAM_NEAR, CAM_FAR ); } void TeapotRenderer::Unload() { if( vbo_ ) { glDeleteBuffers( 1, &vbo_ ); vbo_ = 0; } if( ibo_ ) { glDeleteBuffers( 1, &ibo_ ); ibo_ = 0; } if( shader_param_.program_ ) { glDeleteProgram( shader_param_.program_ ); shader_param_.program_ = 0; } } void TeapotRenderer::Update( float fTime ) { const float CAM_X = 0.f; const float CAM_Y = 0.f; const float CAM_Z = 700.f; mat_view_ = ndk_helper::Mat4::LookAt( ndk_helper::Vec3( CAM_X, CAM_Y, CAM_Z ), ndk_helper::Vec3( 0.f, 0.f, 0.f ), ndk_helper::Vec3( 0.f, 1.f, 0.f ) ); if( camera_ ) { camera_->Update(); mat_view_ = camera_->GetTransformMatrix() * mat_view_ * camera_->GetRotationMatrix() * mat_model_; } else { mat_view_ = mat_view_ * mat_model_; } } void TeapotRenderer::Render() { // // Feed Projection and Model View matrices to the shaders ndk_helper::Mat4 mat_vp = mat_projection_ * mat_view_; // Bind the VBO glBindBuffer( GL_ARRAY_BUFFER, vbo_ ); int32_t iStride = sizeof(TEAPOT_VERTEX); // Pass the vertex data glVertexAttribPointer( ATTRIB_VERTEX, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 0 ) ); glEnableVertexAttribArray( ATTRIB_VERTEX ); glVertexAttribPointer( ATTRIB_NORMAL, 3, GL_FLOAT, GL_FALSE, iStride, BUFFER_OFFSET( 3 * sizeof(GLfloat) ) ); glEnableVertexAttribArray( ATTRIB_NORMAL ); // Bind the IB glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, ibo_ ); glUseProgram( shader_param_.program_ ); TEAPOT_MATERIALS material = { { 1.0f, 0.5f, 0.5f }, { 1.0f, 1.0f, 1.0f, 10.f }, { 0.1f, 0.1f, 0.1f }, }; //Update uniforms glUniform4f( shader_param_.material_diffuse_, material.diffuse_color[0], material.diffuse_color[1], material.diffuse_color[2], 1.f ); glUniform4f( shader_param_.material_specular_, material.specular_color[0], material.specular_color[1], material.specular_color[2], material.specular_color[3] ); // //using glUniform3fv here was troublesome // glUniform3f( shader_param_.material_ambient_, material.ambient_color[0], material.ambient_color[1], material.ambient_color[2] ); glUniformMatrix4fv( shader_param_.matrix_projection_, 1, GL_FALSE, mat_vp.Ptr() ); glUniformMatrix4fv( shader_param_.matrix_view_, 1, GL_FALSE, mat_view_.Ptr() ); glUniform3f( shader_param_.light0_, 100.f, -200.f, -600.f ); glDrawElements( GL_TRIANGLES, num_indices_, GL_UNSIGNED_SHORT, BUFFER_OFFSET(0) ); glBindBuffer( GL_ARRAY_BUFFER, 0 ); glBindBuffer( GL_ELEMENT_ARRAY_BUFFER, 0 ); } bool TeapotRenderer::LoadShaders( SHADER_PARAMS* params, const char* strVsh, const char* strFsh ) { GLuint program; GLuint vert_shader, frag_shader; char *vert_shader_pathname, *frag_shader_pathname; // Create shader program program = glCreateProgram(); LOGI( "Created Shader %d", program ); // Create and compile vertex shader if( !ndk_helper::shader::CompileShader( &vert_shader, GL_VERTEX_SHADER, strVsh ) ) { LOGI( "Failed to compile vertex shader" ); glDeleteProgram( program ); return false; } // Create and compile fragment shader if( !ndk_helper::shader::CompileShader( &frag_shader, GL_FRAGMENT_SHADER, strFsh ) ) { LOGI( "Failed to compile fragment shader" ); glDeleteProgram( program ); return false; } // Attach vertex shader to program glAttachShader( program, vert_shader ); // Attach fragment shader to program glAttachShader( program, frag_shader ); // Bind attribute locations // this needs to be done prior to linking glBindAttribLocation( program, ATTRIB_VERTEX, "myVertex" ); glBindAttribLocation( program, ATTRIB_NORMAL, "myNormal" ); glBindAttribLocation( program, ATTRIB_UV, "myUV" ); // Link program if( !ndk_helper::shader::LinkProgram( program ) ) { LOGI( "Failed to link program: %d", program ); if( vert_shader ) { glDeleteShader( vert_shader ); vert_shader = 0; } if( frag_shader ) { glDeleteShader( frag_shader ); frag_shader = 0; } if( program ) { glDeleteProgram( program ); } return false; } // Get uniform locations params->matrix_projection_ = glGetUniformLocation( program, "uPMatrix" ); params->matrix_view_ = glGetUniformLocation( program, "uMVMatrix" ); params->light0_ = glGetUniformLocation( program, "vLight0" ); params->material_diffuse_ = glGetUniformLocation( program, "vMaterialDiffuse" ); params->material_ambient_ = glGetUniformLocation( program, "vMaterialAmbient" ); params->material_specular_ = glGetUniformLocation( program, "vMaterialSpecular" ); // Release vertex and fragment shaders if( vert_shader ) glDeleteShader( vert_shader ); if( frag_shader ) glDeleteShader( frag_shader ); params->program_ = program; return true; } bool TeapotRenderer::Bind( ndk_helper::TapCamera* camera ) { camera_ = camera; return true; } ================================================ FILE: tests/inputs/demo.odin ================================================ // portion of https://github.com/odin-lang/Odin/raw/master/examples/demo/demo.odin package main import "core:fmt" import "core:mem" import "core:os" /* The Odin programming language is fast, concise, readable, pragmatic and open sourced. It is designed with the intent of replacing C with the following goals: * simplicity * high performance * built for modern systems * joy of programming */ the_basics :: proc() { fmt.println("\n# the basics"); { // The Basics fmt.println("Hellope"); // Lexical elements and literals // A comment my_integer_variable: int; // A comment for documentaton // Multi-line comments begin with /* and end with */. Multi-line comments can // also be nested (unlike in C): /* You can have any text or code here and have it be commented. */ // Note: `:=` is two tokens, `:` and `=`. The following are equivalent, /* i: int = 123; i: = 123; i := 123; */ _ = my_integer_variable; _ = x; } } control_flow :: proc() { fmt.println("\n# control flow"); { // Control flow // For loop // Odin has only one loop statement, the `for` loop // Basic for loop for i := 0; i < 10; i += 1 { fmt.println(i); } // NOTE: Unlike other languages like C, there are no parentheses `( )` surrounding the three components. // Braces `{ }` or a `do` are always required> for i := 0; i < 10; i += 1 { } for i := 0; i < 10; i += 1 do fmt.print(); // The initial and post statements are optional i := 0; for ; i < 10; { i += 1; } // You can defer an entire block too: { bar :: proc() {} defer { fmt.println("1"); fmt.println("2"); } cond := false; defer if cond { bar(); } } // Defer statements are executed in the reverse order that they were declared: { defer fmt.println("1"); defer fmt.println("2"); defer fmt.println("3"); } // Will print 3, 2, and then 1. if false { f, err := os.open("my_file.txt"); if err != 0 { // handle error } defer os.close(f); // rest of code } } { // When statement /* The when statement is almost identical to the if statement but with some differences: * Each condition must be a constant expression as a when statement is evaluated at compile time. * The statements within a branch do not create a new scope * The compiler checks the semantics and code only for statements that belong to the first condition that is true * An initial statement is not allowed in a when statement * when statements are allowed at file scope */ // Example when ODIN_ARCH == "386" { fmt.println("32 bit"); } else when ODIN_ARCH == "amd64" { fmt.println("64 bit"); } else { fmt.println("Unsupported architecture"); } // The when statement is very useful for writing platform specific code. // This is akin to the #if construct in C’s preprocessor however, in Odin, // it is type checked. } { // Branch statements cond, cond1, cond2 := false, false, false; one_step :: proc() { fmt.println("one_step"); } beyond :: proc() { fmt.println("beyond"); } // Break statement for cond { switch { case: if cond { break; // break out of the `switch` statement } } break; // break out of the `for` statement } loop: for cond1 { for cond2 { break loop; // leaves both loops } } // Continue statement for cond { if cond2 { continue; } fmt.println("Hellope"); } // Fallthrough statement // Odin’s switch is like one in C or C++, except that Odin only runs the selected // case. This means that a break statement is not needed at the end of each case. // Another important difference is that the case values need not be integers nor // constants. // fallthrough can be used to explicitly fall through into the next case block: switch i := 0; i { case 0: one_step(); fallthrough; case 1: beyond(); } } } ================================================ FILE: tests/inputs/dev.exs ================================================ /* https://github.com/qhwa/bonfire/blob/master/config/dev.exs */ use Mix.Config config :bonfire, Bonfire.EventStore, serializer: Commanded.Serialization.JsonSerializer, username: "postgres", password: "postgres", database: "bonfire_eventstore_dev", hostname: "localhost", pool_size: 10 # Configure your database config :bonfire, Bonfire.Repo, username: "postgres", password: "postgres", database: "bonfire_dev", hostname: "localhost", pool_size: 10 # For development, we disable any cache and enable # debugging and code reloading. # # The watchers configuration can be used to run external # watchers to your application. For example, we use it # with webpack to recompile .js and .css sources. config :bonfire, BonfireWeb.Endpoint, http: [port: 4000], debug_errors: true, code_reloader: true, check_origin: false, watchers: [ node: [ "node_modules/webpack/bin/webpack.js", "--mode", "development", "--watch-stdin", cd: Path.expand("../assets", __DIR__) ] ] # ## SSL Support # # In order to use HTTPS in development, a self-signed # certificate can be generated by running the following # Mix task: # # mix phx.gen.cert # # Note that this task requires Erlang/OTP 20 or later. # Run `mix help phx.gen.cert` for more information. # # The `http:` config above can be replaced with: # # https: [ # port: 4001, # cipher_suite: :strong, # keyfile: "priv/cert/selfsigned_key.pem", # certfile: "priv/cert/selfsigned.pem" # ], # # If desired, both `http:` and `https:` keys can be # configured to run both http and https servers on # different ports. # Watch static and templates for browser reloading. config :bonfire, BonfireWeb.Endpoint, live_reload: [ patterns: [ ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$", ~r"priv/gettext/.*(po)$", ~r"lib/bonfire_web/(live|views)/.*(ex)$", ~r"lib/bonfire_web/templates/.*(eex)$" ] ] # Do not include metadata nor timestamps in development logs config :logger, :console, format: "[$level] $message\n" # Set a higher stacktrace during development. Avoid configuring such # in production as building large stacktraces may be expensive. config :phoenix, :stacktrace_depth, 20 # Initialize plugs at runtime for faster development compilation config :phoenix, :plug_init_mode, :runtime ================================================ FILE: tests/inputs/diff/A/d1/hello.f90 ================================================ ! Hello World program hello implicit none print '("Hello, World!")' print '("line 2")' end program hello !hpf$ not a comment !omp$ not a comment either ================================================ FILE: tests/inputs/diff/A/d2/hello.java ================================================ /* hello.java */ import java.io.*; class Hi { static public void main( String args[] ) { System.out.println( "another line" ); System.out.println( "Hello World!" ); /* insert comment here */ } /* inline */ } ================================================ FILE: tests/inputs/diff/A/d2/hi.py ================================================ #/usr/bin/env python # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment print(f'f-string') """ Docstring, also counted as comment. """ ''' Single Quoted Docstring''' ================================================ FILE: tests/inputs/diff/A/hello.C ================================================ // hello.C #include int main () { std::cout << "hello" << std::endl; // comment 1 std::cout << "again" << std::endl; /* comment 2 */ } ================================================ FILE: tests/inputs/diff/B/d1/hello.f90 ================================================ ! Hello World program hello implicit none print '("Hello, World!")' end program hello !hpf$ not a comment !omp$ not a comment either c old style comment ================================================ FILE: tests/inputs/diff/B/d2/hi.py ================================================ #/usr/bin/env python # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment print(f'f-string') """ Docstring, also counted as comment. """ ''' Single Quoted Docstring''' ================================================ FILE: tests/inputs/diff/B/extra_file.pl ================================================ #!/usr/bin/perl print "extra\n"; ================================================ FILE: tests/inputs/diff/B/hello.C ================================================ // hello.C -- stuff #include int main () { std::cout << "hello" << std::endl; // comment 1 std::cout << "again" << std::endl; /* comment 2 */ } ================================================ FILE: tests/inputs/dlist.lean ================================================ -- https://github.com/leanprover/lean/raw/master/library/data/dlist.lean /- Copyright (c) 2017 Microsoft Corporation. All rights reserved. Released under Apache 2.0 license as described in the file LICENSE. Author: Leonardo de Moura -/ universes u /-- A difference list is a function that, given a list, returns the original contents of the difference list prepended to the given list. This structure supports `O(1)` `append` and `concat` operations on lists, making it useful for append-heavy uses such as logging and pretty printing. -/ structure dlist (α : Type u) := (apply : list α → list α) (invariant : ∀ l, apply l = apply [] ++ l) namespace dlist open function variables {α : Type u} local notation `♯`:max := by abstract {intros, rsimp} /-- Convert a list to a dlist -/ def of_list (l : list α) : dlist α := ⟨append l, ♯⟩ /-- Convert a lazily-evaluated list to a dlist -/ def lazy_of_list (l : thunk (list α)) : dlist α := ⟨λ xs, l () ++ xs, ♯⟩ /-- Convert a dlist to a list -/ def to_list : dlist α → list α | ⟨xs, _⟩ := xs [] /-- Create a dlist containing no elements -/ def empty : dlist α := ⟨id, ♯⟩ local notation a `::_`:max := list.cons a /-- Create dlist with a single element -/ def singleton (x : α) : dlist α := ⟨x::_, ♯⟩ local attribute [simp] function.comp /-- `O(1)` Prepend a single element to a dlist -/ def cons (x : α) : dlist α → dlist α | ⟨xs, h⟩ := ⟨x::_ ∘ xs, ♯⟩ /-- `O(1)` Append a single element to a dlist -/ def concat (x : α) : dlist α → dlist α | ⟨xs, h⟩ := ⟨xs ∘ x::_, ♯⟩ /-- `O(1)` Append dlists -/ protected def append : dlist α → dlist α → dlist α | ⟨xs, h₁⟩ ⟨ys, h₂⟩ := ⟨xs ∘ ys, ♯⟩ instance : has_append (dlist α) := ⟨dlist.append⟩ local attribute [simp] of_list to_list empty singleton cons concat dlist.append lemma to_list_of_list (l : list α) : to_list (of_list l) = l := by cases l; simp lemma of_list_to_list (l : dlist α) : of_list (to_list l) = l := begin cases l with xs, have h : append (xs []) = xs, { intros, funext x, simp [l_invariant x] }, simp [h] end lemma to_list_empty : to_list (@empty α) = [] := by simp lemma to_list_singleton (x : α) : to_list (singleton x) = [x] := by simp lemma to_list_append (l₁ l₂ : dlist α) : to_list (l₁ ++ l₂) = to_list l₁ ++ to_list l₂ := show to_list (dlist.append l₁ l₂) = to_list l₁ ++ to_list l₂, from by cases l₁; cases l₂; simp; rsimp lemma to_list_cons (x : α) (l : dlist α) : to_list (cons x l) = x :: to_list l := by cases l; rsimp lemma to_list_concat (x : α) (l : dlist α) : to_list (concat x l) = to_list l ++ [x] := by cases l; simp; rsimp section transfer protected def rel_dlist_list (d : dlist α) (l : list α) : Prop := to_list d = l instance bi_total_rel_dlist_list : @relator.bi_total (dlist α) (list α) dlist.rel_dlist_list := ⟨assume d, ⟨to_list d, rfl⟩, assume l, ⟨of_list l, to_list_of_list l⟩⟩ protected lemma rel_eq : (dlist.rel_dlist_list ⇒ dlist.rel_dlist_list ⇒ iff) (@eq (dlist α)) eq | l₁ ._ rfl l₂ ._ rfl := ⟨congr_arg to_list, assume : to_list l₁ = to_list l₂, have of_list (to_list l₁) = of_list (to_list l₂), from congr_arg of_list this, by simp [of_list_to_list] at this; assumption⟩ protected lemma rel_empty : dlist.rel_dlist_list (@empty α) [] := to_list_empty protected lemma rel_singleton : (@eq α ⇒ dlist.rel_dlist_list) (λx, singleton x) (λx, [x]) | ._ x rfl := to_list_singleton x protected lemma rel_append : (dlist.rel_dlist_list ⇒ dlist.rel_dlist_list ⇒ dlist.rel_dlist_list) (λ(x y : dlist α), x ++ y) (λx y, x ++ y) | l₁ ._ rfl l₂ ._ rfl := to_list_append l₁ l₂ protected lemma rel_cons : (@eq α ⇒ dlist.rel_dlist_list ⇒ dlist.rel_dlist_list) cons (λx y, x :: y) | x ._ rfl l ._ rfl := to_list_cons x l protected lemma rel_concat : (@eq α ⇒ dlist.rel_dlist_list ⇒ dlist.rel_dlist_list) concat (λx y, y ++ [x]) | x ._ rfl l ._ rfl := to_list_concat x l protected meta def transfer : tactic unit := do _root_.transfer.transfer [`relator.rel_forall_of_total, `dlist.rel_eq, `dlist.rel_empty, `dlist.rel_singleton, `dlist.rel_append, `dlist.rel_cons, `dlist.rel_concat] example : ∀(a b c : dlist α), a ++ (b ++ c) = (a ++ b) ++ c := begin dlist.transfer, intros, simp end example : ∀(a : α), singleton a ++ empty = singleton a := begin dlist.transfer, intros, simp end end transfer end dlist ================================================ FILE: tests/inputs/door.tres ================================================ ; https://github.com/godotengine/tps-demo/raw/master/door/model/door.tres [gd_resource type="SpatialMaterial" load_steps=5 format=2] [ext_resource path="res://door/textures/door_orm.png" type="Texture" id=1] [ext_resource path="res://door/textures/door_emission.png" type="Texture" id=2] [ext_resource path="res://door/textures/door_normal.png" type="Texture" id=3] [ext_resource path="res://door/textures/door_albedo.png" type="Texture" id=4] [resource] resource_name = "door" albedo_texture = ExtResource( 4 ) ; metallic = 1.0 ; metallic_texture = ExtResource( 1 ) ; metallic_texture_channel = 2 ; roughness_texture = ExtResource( 1 ) ; roughness_texture_channel = 1 ; emission_enabled = true ; emission = Color( 0, 0, 0, 1 ) emission_energy = 3.0 emission_operator = 0 emission_on_uv2 = false emission_texture = ExtResource( 2 ) normal_enabled = true normal_scale = 1.0 normal_texture = ExtResource( 3 ) ao_enabled = true ao_light_affect = 0.0 ao_texture = ExtResource( 1 ) ao_on_uv2 = false ao_texture_channel = 0 ================================================ FILE: tests/inputs/dotNET_intermediate.il ================================================ // This is .NET Intermediate Language // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. .assembly extern System.Console { .publickeytoken = (B0 3F 5F 7F 11 D5 0A 3A ) .ver 4:0:0:0 } .assembly extern mscorlib { } .assembly 'devdiv_815942_' {} .assembly extern xunit.core {} .class public Repro { .method public static int32 Main() cil managed { .custom instance void [xunit.core]Xunit.FactAttribute::.ctor() = ( 01 00 00 00 ) // This testcase ensures that we correctly compare a double local // against a float const by converting the float const to double // instead of converting the local to float and losing precision .entrypoint .locals init (float64 V_1) ldc.i4.1 conv.i8 call float64 [mscorlib]System.BitConverter::Int64BitsToDouble(int64) conv.r8 stloc.0 ldloc.0 ldc.r4 0.0 bne.un.s PASS ldstr "FAIL!" call void [System.Console]System.Console::WriteLine(string) ldloc.0 call void [System.Console]System.Console::WriteLine(float64) ldc.i4.s 101 ret PASS: ldstr "PASS!" call void [System.Console]System.Console::WriteLine(string) ldc.i4.s 100 ret } } ================================================ FILE: tests/inputs/double_doors.dsc ================================================ doubledoors_world: type: world debug: false events: # Use monitor to allow the event to be cancelled by any other scripts or plugins # But use 'on' to make the door move as immediately as possible on player right clicks *_door bukkit_priority:monitor: # Iron doors aren't opened on click - if == iron_door: - stop - define face # A door faces outward, rotate the outward face opposite the direction of the hinge to get the other door - if == left: # Note: pi/2 is radian equivalent of 90 degrees. - define face <[face].rotate_around_y[-]> - else: - define face <[face].rotate_around_y[]> - define door2 ]> # Check that the double door *exists* - if <[door2].material.name> == : - switch <[door2]> ================================================ FILE: tests/inputs/drools.drl ================================================ // https://github.com/AlDanial/cloc/issues/172 /* * Copyright 2010 Red Hat, Inc. and/or its affiliates. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.drools.examples.fibonacci import org.drools.examples.fibonacci.FibonacciExample.Fibonacci; dialect "mvel" rule Recurse salience 10 when f : Fibonacci ( value == -1 ) not ( Fibonacci ( sequence == 1 ) ) then insert( new Fibonacci( f.sequence - 1 ) ); System.out.println( "recurse for " + f.sequence ); end rule Bootstrap when f : Fibonacci( sequence == 1 || == 2, value == -1 ) // this is a multi-restriction || on a single field then modify ( f ){ value = 1 }; System.out.println( f.sequence + " == " + f.value ); end rule Calculate when f1 : Fibonacci( s1 : sequence, value != -1 ) // here we bind sequence f2 : Fibonacci( sequence == (s1 + 1 ), value != -1 ) // here we don't, just to demonstrate the different way bindings can be used f3 : Fibonacci( s3 : sequence == (f2.sequence + 1 ), value == -1 ) then modify ( f3 ) { value = f1.value + f2.value }; System.out.println( s3 + " == " + f3.value ); // see how you can access pattern and field bindings end ================================================ FILE: tests/inputs/drupal.mxml ================================================ import mx.controls.*; import mx.rpc.events.*; import mx.utils.ArrayUtil; [Bindable] public var recipes:Array; public function init():void { getRecipes(); } /* this is a C Comment */ public function onFault(event:FaultEvent):void { Alert.show(event.fault.faultString, "Error"); } public function onViewsResult(event:ResultEvent):void { recipes = ArrayUtil.toArray(event.result); } public function getRecipes():void { views.getView("recipes_all", ['nid','title','body','changed']); } public function saveRecipe():void { var edit:Object; if (recipes_select.selectedItem) { edit = recipes_select.selectedItem; } else { edit = new Object; } edit.type = "recipe"; edit.title = dish.text; edit.body = recipe.text; if (edit.title == "" || edit.body == "") { Alert.show("Enter some content", "Error"); } node.save(edit); getRecipes(); } public function onSaved(event:ResultEvent):void { Alert.show("Recipe was saved", "Saved"); } public function newRecipe():void { recipes_select.selectedItem = undefined; dish.text = ""; recipe.text = ""; } ================================================ FILE: tests/inputs/eddsa.circom ================================================ // https://raw.githubusercontent.com/iden3/circomlib/master/circuits/eddsa.circom /* Copyright 2018 0KIMS association. This file is part of circom (Zero Knowledge Circuit Compiler). circom is a free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. circom is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with circom. If not, see . */ pragma circom 2.0.0; include "compconstant.circom"; include "pointbits.circom"; include "pedersen.circom"; include "escalarmulany.circom"; include "escalarmulfix.circom"; template EdDSAVerifier(n) { signal input msg[n]; signal input A[256]; signal input R8[256]; signal input S[256]; signal Ax; signal Ay; signal R8x; signal R8y; var i; // Ensure S compConstant.in[i]; } compConstant.out === 0; S[254] === 0; S[255] === 0; // Convert A to Field elements (And verify A) component bits2pointA = Bits2Point_Strict(); for (i=0; i<256; i++) { bits2pointA.in[i] <== A[i]; } Ax <== bits2pointA.out[0]; Ay <== bits2pointA.out[1]; // Convert R8 to Field elements (And verify R8) component bits2pointR8 = Bits2Point_Strict(); for (i=0; i<256; i++) { bits2pointR8.in[i] <== R8[i]; } R8x <== bits2pointR8.out[0]; R8y <== bits2pointR8.out[1]; // Calculate the h = H(R,A, msg) component hash = Pedersen(512+n); for (i=0; i<256; i++) { hash.in[i] <== R8[i]; hash.in[256+i] <== A[i]; } for (i=0; i, 2013-2014 # Michael Findlay , 2016 msgid "" msgstr "" "Project-Id-Version: Xfce Apps\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2016-06-19 06:31+0200\n" "PO-Revision-Date: 2016-06-21 08:54+0000\n" "Last-Translator: Michael Findlay \n" "Language-Team: English (Australia) (http://www.transifex.com/xfce/xfce-apps/language/en_AU/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" "Language: en_AU\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n" #: ../colorschemes/black-on-white.theme.in.h:1 msgid "Black on White" msgstr "Black on White" #: ../colorschemes/dark-pastels.theme.in.h:1 msgid "Dark Pastels" msgstr "Dark Pastels" #: ../colorschemes/green-on-black.theme.in.h:1 msgid "Green on Black" msgstr "Green on Black" #: ../terminal/main.c:147 #, c-format msgid "See the %s man page for full explanation of the options above." msgstr "See the %s man page for full explanation of the options above." #: ../terminal/main.c:180 ../xfce4-terminal.desktop.in.h:1 msgid "Xfce Terminal" msgstr "Xfce Terminal" #: ../terminal/main.c:196 msgid "The Xfce development team. All rights reserved." msgstr "The Xfce development team. All rights reserved." #: ../terminal/main.c:197 msgid "Written by Benedikt Meurer " msgstr "Written by Benedikt Meurer " #: ../terminal/main.c:198 msgid "and Nick Schermer ." msgstr "and Nick Schermer ." #: ../terminal/main.c:199 #, c-format msgid "Please report bugs to <%s>." msgstr "Please report bugs to <%s>." ================================================ FILE: tests/inputs/example_2d.gdshader ================================================ // https://github.com/AlDanial/cloc/issues/641 shader_type canvas_item; uniform float blue = 1.0; // you can assign a default value to uniforms void vertex() { // Animate Sprite moving in big circle around its location VERTEX += vec2(cos(TIME)*100.0, sin(TIME)*100.0); } void fragment(){ // this shader will result in an more bluish sprite COLOR = texture(TEXTURE, UV); //read from texture COLOR.b = blue; //set blue channel to } ================================================ FILE: tests/inputs/fib.dfy ================================================ /* https://dafny.org/latest/OnlineTutorial/guide */ function fib(n: nat): nat { if n == 0 then 0 else if n == 1 then 1 else fib(n - 1) + fib(n - 2) } method ComputeFib(n: nat) returns (b: nat) ensures b == fib(n) // Do not change this postcondition { // Change the method body to instead use c as described. // You will need to change both the initialization and the loop. if n == 0 { return 0; } var i: int := 1; var a := 0; b := 1; while i < n invariant 0 < i <= n invariant a == fib(i - 1) invariant b == fib(i) { a, b := b, a + b; i := i + 1; } } ================================================ FILE: tests/inputs/fib_class.pkl ================================================ /* https://raw.githubusercontent.com/apple/pkl/refs/heads/main/bench/src/jmh/resources/org/pkl/core/fib_class.pkl */ //===----------------------------------------------------------------------===// // Copyright © 2024 Apple Inc. and the Pkl project authors. All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // https://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. //===----------------------------------------------------------------------===// class Fibonacci { function fib(n) = if (n < 2) n else fib(n - 1) + fib(n - 2) } result = new Fibonacci {}.fib(35) ================================================ FILE: tests/inputs/fibonacci.ncl ================================================ # https://raw.githubusercontent.com/tweag/nickel/master/examples/fibonacci/fibonacci.ncl # test = 'pass' # This is the naive, exponential version of fibonacci: don't call it on a big # value! let rec fibonacci = fun n => if n == 0 then 0 else if n == 1 then 1 else fibonacci (n - 1) + fibonacci (n - 2) in fibonacci 10 ================================================ FILE: tests/inputs/find.plm ================================================ /* https://en.wikipedia.org/wiki/PL/M */ FIND: PROCEDURE(PA,PB) BYTE; DECLARE (PA,PB) BYTE; /* FIND THE STRING IN SCRATCH STARTING AT PA AND ENDING AT PB */ DECLARE J ADDRESS, (K, MATCH) BYTE; J = BACK ; MATCH = FALSE; DO WHILE NOT MATCH AND (MAXM > J); LAST,J = J + 1; /* START SCAN AT J */ K = PA ; /* ATTEMPT STRING MATCH AT K */ DO WHILE SCRATCH(K) = MEMORY(LAST) AND NOT (MATCH := K = PB); /* MATCHED ONE MORE CHARACTER */ K = K + 1; LAST = LAST + 1; END; END; IF MATCH THEN /* MOVE STORAGE */ DO; LAST = LAST - 1; CALL MOVER; END; RETURN MATCH; END FIND; ================================================ FILE: tests/inputs/flatbuffers.fbs ================================================ /* Comment 1 */ table TestTable { // Comment 2 Item: int32; } ================================================ FILE: tests/inputs/fmt.ha ================================================ // License: MPL-2.0 // (c) 2022 Alexey Yerin // (c) 2021 Andri Yngvason // (c) 2021-2022 Bor Grošelj Simić // (c) 2021 Byron Torres // (c) 2021 Drew DeVault // (c) 2021 Ember Sawady use ascii; use bufio; use encoding::utf8; use io; // https://git.sr.ht/~sircmpwn/hare/tree/master/item/fmt/fmt.ha use math; use os; use strconv; use strings; use types; // Tagged union of the [[formattable]] types and [[modifiers]]. Used for // functions which accept format strings. export type field = (...formattable | *modifiers); // Tagged union of all types which are formattable. export type formattable = (...types::numeric | uintptr | str | rune | bool | nullable *void | void); // Formats text for printing and writes it to [[os::stdout]]. export fn printf(fmt: str, args: field...) (io::error | size) = fprintf(os::stdout, fmt, args...); // Formats text for printing and writes it to [[os::stdout]], followed by a line // feed. export fn printfln(fmt: str, args: field...) (io::error | size) = fprintfln(os::stdout, fmt, args...); ================================================ FILE: tests/inputs/foo_bar/bar/foo/momo/tbfm.sh ================================================ echo hello ================================================ FILE: tests/inputs/foo_bar/foo/bar/lala/tfbl.sh ================================================ echo hi ================================================ FILE: tests/inputs/fortran.inc ================================================ C https://en.wikibooks.org/wiki/Fortran/Fortran_examples ! sum.f90 ! Performs summations using in a loop using EXIT statement ! Saves input information and the summation in a data file program summation implicit none integer :: sum, a print *, "This program performs summations. Enter 0 to stop." open (unit=10, file="SumData.DAT") sum = 0 do print *, "Add:" read *, a if (a == 0) then exit else sum = sum + a end if write (10,*) a end do print *, "Summation =", sum write (10,*) "Summation =", sum close(10) end ================================================ FILE: tests/inputs/fractal.um ================================================ /* https://github.com/vtereshkov/umka-lang/raw/master/examples/fractal/fractal.um */ // Fractal demo in Umka (adapted from a Wren version by Robert Nystrom) fn main() { const ( yMin = -0.2 yMax = 0.1 xMin = -1.5 xMax = -1.1 ) for yPixel := 0; yPixel < 40; yPixel++ { y0 := (yPixel / 40.0) * (yMax - yMin) + yMin for xPixel := 0; xPixel < 79; xPixel++ { x0 := (xPixel / 78.0) * (xMax - xMin) + xMin x, y := x0, y0 pixel := ' ' for iter := 0; iter < 80; iter++ { x, y = x * x - y * y + x0, 2 * x * y + y0 // Stop if the point escaped if x * x + y * y > 4 { const pixels = " .:;+=xX$&" pixel = pixels[iter / 8] break } } printf("%c", pixel) } printf("\n") } } ================================================ FILE: tests/inputs/fsharp.fs ================================================ (* http://en.wikipedia.org/wiki/F_Sharp_%28programming_language%29 *) /// A very naive prime number detector let isPrime (n:int) = let bound = int (sqrt (float n)) seq {2 .. bound} |> Seq.forall (fun x -> n % x <> 0) // We are using async workflows let primeAsync n = async { return (n, isPrime n) } /// Return primes between m and n using multiple threads let primes m n = seq {m .. n} |> Seq.map primeAsync |> Async.Parallel |> Async.RunSynchronously |> Array.filter snd |> Array.map fst // Run a test primes 1000000 1002000 |> Array.iter (printfn "%d") ================================================ FILE: tests/inputs/fsharp_script.fsx ================================================ // https://blogs.msdn.microsoft.com/chrsmith/2008/09/12/scripting-in-f/ // Launches all .fs and .fsi files under the current folder in Notepad open System allFilesUnder Environment.CurrentDirectory |> Seq.filter (function | EndsWith ".fs" _ | EndsWith ".fsi" _ -> true | _ -> false) |> Seq.iter (shellExecute "Notepad.exe") ================================================ FILE: tests/inputs/functional.cj ================================================ /* https://github.com/Zxilly/playground-cj/blob/master/src/examples/functional.cj */ package playground // 用给定的分隔符拆分字符串,支持多分隔符 import std.collection.* // 常规实现 func split_normal(text: String, sep: String): ArrayList { let indices = ArrayList() var last = true for (i in 0..text.size) { let current = sep.indexOf(text[i]).isSome() if (last != current) { indices.add(i) } last = current } if (!last) { indices.add(text.size) } let result = ArrayList() for (i in 0..indices.size : 2) { result.add(text[indices[i]..indices[i + 1]]) } return result } // 函数式编程实现 func split(text: String, sep: String): ArrayList { let indices = ArrayList() text |> enumerate |> fold(false) { state, e => let current = sep.indexOf(e[1]).isNone() if (state != current) { indices.add(e[0]) } current } |> { valid: Bool => if (valid) { indices.add(text.size) } } let result = ArrayList() for (i in 0..indices.size : 2) { result.add(text[indices[i]..indices[i + 1]]) } return result } main() { let text = "123, 456 7&89, , 96^3, 567" let separator = "&^, " println(split_normal(text, separator)) println(split(text, separator)) } ================================================ FILE: tests/inputs/futhark.fut ================================================ -- ISC License -- -- Copyright (c) 2013-2018. DIKU, University of Copenhagen -- -- Permission to use, copy, modify, and/or distribute this software for -- any purpose with or without fee is hereby granted, provided that the -- above copyright notice and this permission notice appear in all -- copies. -- -- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL -- WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED -- WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE -- AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL -- DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR -- PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER -- TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR -- PERFORMANCE OF THIS SOFTWARE. -- -- | The default prelude that is implicitly available in all Futhark -- files. open import "soacs" open import "array" open import "math" open import "functional" open import "ad" -- | Create single-precision float from integer. def r32 (x: i32): f32 = f32.i32 x -- | Create integer from single-precision float. def t32 (x: f32): i32 = i32.f32 x -- | Create double-precision float from integer. def r64 (x: i32): f64 = f64.i32 x -- | Create integer from double-precision float. def t64 (x: f64): i32 = i32.f64 x -- | Negate a boolean. `not x` is the same as `!x`. This function is -- mostly useful for passing to `map`. def not (x: bool): bool = !x -- | Semantically just identity, but serves as an optimisation -- inhibitor. The compiler will treat this function as a black box. -- You can use this to work around optimisation deficiencies (or -- bugs), although it should hopefully rarely be necessary. -- Deprecated: use `#[opaque]` attribute instead. def opaque 't (x: t): t = #[opaque] x -- | Semantically just identity, but at runtime, the argument value -- will be printed. Deprecated: use `#[trace]` attribute instead. def trace 't (x: t): t = #[trace(trace)] x -- | Semantically just identity, but acts as a break point in -- `futhark repl`. Deprecated: use `#[break]` attribute instead. def break 't (x: t): t = #[break] x ================================================ FILE: tests/inputs/generate.fnl ================================================ ; https://github.com/bakpakin/Fennel/raw/master/generate.fnl ;; A general-purpose function for generating random values. (var generate nil) (local random-char (fn [] (if (> (math.random) 0.9) (string.char (+ 48 (math.random 10))) (> (math.random) 0.5) ; an in-line comment (string.char (+ 97 (math.random 26))) (> (math.random) 0.5) (string.char (+ 65 (math.random 26))) (> (math.random) 0.5) (string.char (+ 32 (math.random 11))) (> (math.random) 0.5) (string.char (+ 45 (math.random 2))) :else (string.char (+ 58 (math.random 5)))))) (local generators {:number (fn [] ; weighted towards mid-range integers (if (> (math.random) 0.9) (let [x (math.random 2147483647)] (math.floor (- x (/ x 2)))) (> (math.random) 0.2) (math.floor (math.random 2048)) :else (math.random))) :string (fn [] (var s "") (for [_ 1 (math.random 16)] (set s (.. s (random-char)))) s) :table (fn [table-chance] (let [t {}] (var k nil) (for [_ 1 (math.random 16)] ;; no nans plz (set k (generate 0.9)) (while (~= k k) (set k (generate 0.9))) (tset t k (generate (* table-chance 1.5)))) t)) :boolean (fn [] (> (math.random) 0.5))}) (set generate (fn [table-chance] (local table-chance (or table-chance 0.5)) (if (> (math.random) 0.5) (generators.number) (> (math.random) 0.5) (generators.string) (> (math.random) table-chance) (generators.table table-chance) :else (generators.boolean)))) generate ================================================ FILE: tests/inputs/git_helpers.fish ================================================ # https://raw.githubusercontent.com/Konstruktionist/fish/master/conf.d/git_helpers.fish # Building Gary Bernhardt's githelpers bash script in fish # ======================================================== # # Log output: # # * 51c333e (12 days) add vim-eunuch # # Branch output: # # * release/v1.1 (13 days) add pretty_git_branch # # The time massaging regexes start with ^[^<]* because that ensures that they # only operate before the first "<". That "<" will be the beginning of the # author name, ensuring that we don't destroy anything in the commit message # that looks like time. # # The log format uses ∬ characters between each field, and `column` is later # used to split on them. A ∬ in the commit subject or any other field will # break this. (GB used originally the } character, I think that may # occasionally show up in a commit message) # ----------------------------------------- set -l ycolor (set_color bryellow) set -l ncolor (set_color normal) set -l gcolor (set_color brgreen) set -l bcolor (set_color blue) set -l rcolor (set_color brred) set -l log_hash "$ycolor%h" set -l log_relative_time "$gcolor(%ar)" set -l log_author "$bcolor<%an>" set -l log_refs "$rcolor%d$ncolor" set -l log_subject "%s" # Use a special character to separate our fields so strings with spaces in # them (like names & subjects) will not split on them. # Character used is ∬ = U+222C (DOUBLE INTEGRAL). I'm fairly sure nobody uses # that in commit messages. # DO NOT use it between log_refs and log_subject to prevent hideous whitespace # problems. set log_format "$log_hash∬$log_relative_time∬$log_author∬$log_refs $log_subject" set -l branch_prefix "%(HEAD)" set -l branch_ref "$rcolor%(refname:short)" set -l branch_hash "$ycolor%(objectname:short)" set -l branch_date "$gcolor(%(committerdate:relative))" set -l branch_author "$bcolor<%(authorname)>$ncolor" set -l branch_contents "%(contents:subject)" set branch_format "$branch_prefix∬$branch_ref∬$branch_hash∬$branch_date∬$branch_author∬$branch_contents" # Logs function gitl -d 'l = all commits, only current branch' # 1st string replace: remove all ' ago' only in date column # 2nd string replace: replace (2 years, 5 months) with (2 years) # 3rd - 5th string replace: print Merge commit messages in cyan # NOTE: to get the merge commit messages printed cyan we can not use the above # declared variables rcolor & ncolor. If we do we get an error stating: # 'Variables may not be used as commands' or 'string replace: Expected # argument" git log --graph --pretty="tformat:$log_format" $argv |\ string replace -r '(^[^<]*)\sago\)' '$1)' |\ string replace -r ',\s\d+?\s\w+\s?' '' |\ string replace -r 'Merge branch\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge pull request\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge remote-tracking branch\s.*' (set_color cyan)'$0'(set_color normal) |\ # TODO: Ideally these last 3 would be replaced by # # string replace -r ([\s]{3}Merge.*) (set_color cyan)'$1'(set_color normal) # # but somehow fish doesn't understand this and ignores it. There are no # error messages, it just ignores the set_color commands & prints the # commit message in normal color. It works in RegExR & online regex # testers. # Needs further investigation. column -t -s '∬' |\ less -FXRS end function gitla -d 'la = all commits, all reachable refs' gitl --all end function gitr -d 'r = recent commits, only current branch' gitl -30 end function gitra -d 'ra = recent commits, all reachable refs' gitr --all end function gith -d 'h = head' gitl -1 end function githp -d 'hp = head with patch' gitl -1 git show -p --pretty="tformat:" end # Branches # This follows the same logic as in the Logs section function gitb -d 'b = all branches' git branch -v --format=$branch_format $argv |\ string replace -r '(^[^<]*)\sago\)' '$1)' |\ string replace -r ',\s\d+?\s\w+\s?' '' |\ string replace -r 'Merge branch\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge pull request\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge remote-tracking branch\s.*' (set_color cyan)'$0'(set_color normal) |\ column -t -s '∬' | less -FXRS end function gitbs -d 'bs = all branches, sorted by last commit date' git branch -v --format=$branch_format --sort=-committerdate $argv |\ string replace -r '(^[^<]*)\sago\)' '$1)' |\ string replace -r ',\s\d+?\s\w+\s?' '' |\ string replace -r 'Merge branch\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge pull request\s.*' (set_color cyan)'$0'(set_color normal) |\ string replace -r 'Merge remote-tracking branch\s.*' (set_color cyan)'$0'(set_color normal) |\ column -t -s '∬' | less -FXRS end ================================================ FILE: tests/inputs/github_user.aria ================================================ # https://egranata.github.io/aria/ # github_user.aria import Request from aria.network.request; import JsonValue from aria.json.parser; val whoami = "egranata"; func main() { val request = Request.new("https://api.github.com/users/{0}".format(whoami)); request.headers["User-Agent"] = "AriaLang/1.0"; val response = request.get(); if response.status_code == 200 { val user_data = JsonValue.parse(response.content).flatten(); println("User {1} has {0} public repositories.".format(user_data["public_repos"], whoami)); } else { println("Failed to fetch user data. Status: {0}".format(response.status_code)); } } ================================================ FILE: tests/inputs/glade-search-popover.ui ================================================ ================================================ FILE: tests/inputs/glossary.json ================================================ { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } } } } ================================================ FILE: tests/inputs/glossary.json5 ================================================ // comments supported { "glossary": { "title": "example glossary", "GlossDiv": { "title": "S", "GlossList": { "GlossEntry": { "ID": "SGML", "SortAs": "SGML", "GlossTerm": "Standard Generalized Markup Language", "Acronym": "SGML", "Abbrev": "ISO 8879:1986", "GlossDef": { "para": "A meta-markup language, used to create markup languages such as DocBook.", "GlossSeeAlso": ["GML", "XML"] }, "GlossSee": "markup" } } /* * more comments */ } } } ================================================ FILE: tests/inputs/gnureadline.vala ================================================ // https://wiki.gnome.org/Projects/Vala/InputSamples?highlight=%28%5CbVala%2FExamples%5Cb%29 void main () { while (true) { var name = Readline.readline ("Please enter your name: "); if (name != null && name != "") { /* stdout.printf ("Hello, %s\n", name); Readline.History.add (name); */ } else { break; } } } ================================================ FILE: tests/inputs/graphql.gql ================================================ # https://www.npmjs.com/package/graphql-example mutation { # create new user createUser(name: "") { id name errors { path errors { validator message code # comment 2 } } } } ================================================ FILE: tests/inputs/greeter.tsx ================================================ /* https://raw.githubusercontent.com/Microsoft/TypeScriptSamples/master/greeter/greeter.ts renamed to greeter.tsx to test .tsx association */ class Greeter { constructor(public greeting: string) { } greet() { return "

" + this.greeting + "

"; } }; var greeter = new Greeter("Hello, world!"); // document.body.innerHTML = greeter.greet(); ================================================ FILE: tests/inputs/groovy_triple.gvy ================================================ print( """ /* """) print( """ */ """) ================================================ FILE: tests/inputs/guard_talking.yarn ================================================ // https://docs.yarnspinner.dev/write-yarn-scripts/scripting-fundamentals/detour title: Guard --- Guard: Have I told you my backstory? -> Yes. Guard: Oh. Well, then. -> No? <> Guard: Anyway, you can't come in. === title: Guard_Backstory --- Guard: Do you want the detailed version or the short version? -> Detailed. <> Guard: I hope you enjoyed learning all that.. Anyway... -> Short. Guard: Right, well, I was a recruit, then I wasn't. === title: Guard_Detailed_Backstory --- Guard: It all started when I was a mere recruit. // (five minutes of exposition omitted) // (other stuff happens) Guard: Want to hear more? -> Yes. -> No. <> Guard: (speaks more garbage) === ================================================ FILE: tests/inputs/guestbook.tpl ================================================ {* Smarty https://www.smarty.net/sampleapp4 *} {foreach from=$data item="entry"} {foreachelse} {/foreach}
Guestbook Entries (add)
{$entry.Name|escape} {$entry.EntryDate|date_format:"%e %b, %Y %H:%M:%S"}
{$entry.Comment|escape}
No records
================================================ FILE: tests/inputs/hanoi.inc ================================================ // https://github.com/compuphase/pawn/tree/main/examples/hanoi.p /* The Towers of Hanoi, a game solved through recursion */ @start() { print "How many disks: " var disks = getvalue() move 1, 3, 2, disks } move(from, to, spare, numdisks) { if (numdisks > 1) move from, spare, to, numdisks-1 printf "Move disk from pillar %d to pillar %d\n", from, to if (numdisks > 1) move spare, to, from, numdisks-1 } ================================================ FILE: tests/inputs/harbour_xbase.prg ================================================ // This is a comment /* This is a comment */ /* This is a comment */ * This is a comment && This is a comment NOTE This is a comment note This is a comment a = 1 NOTE ================================================ FILE: tests/inputs/hello.C ================================================ // hello.C #include int main () { std::cout << "hello" << std::endl; // comment 1 std::cout << "again" << std::endl; /* comment 2 */ } ================================================ FILE: tests/inputs/hello.bf ================================================ [ This program prints "Hello World!" and a newline to the screen, its length is 106 active command characters. [It is not the shortest.] This loop is a "comment loop", a simple way of adding a comment to a BF program such that you don't have to worry about any command characters. Any ".", ",", "+", "-", "<" and ">" characters are simply ignored, the "[" and "]" characters just have to be balanced. This loop and the commands it contains are ignored because the current cell defaults to a value of 0; the 0 value causes this loop to be skipped. ] ++++++++ Set Cell #0 to 8 [ >++++ Add 4 to Cell #1; this will always set Cell #1 to 4 [ as the cell will be cleared by the loop >++ Add 2 to Cell #2 >+++ Add 3 to Cell #3 >+++ Add 3 to Cell #4 >+ Add 1 to Cell #5 <<<<- Decrement the loop counter in Cell #1 ] Loop till Cell #1 is zero; number of iterations is 4 >+ Add 1 to Cell #2 >+ Add 1 to Cell #3 >- Subtract 1 from Cell #4 >>+ Add 1 to Cell #6 [<] Move back to the first zero cell you find; this will be Cell #1 which was cleared by the previous loop <- Decrement the loop Counter in Cell #0 ] Loop till Cell #0 is zero; number of iterations is 8 ================================================ FILE: tests/inputs/hello.f ================================================ c Hello World * Hello World ! Hello World program hello implicit none print '("Hello, World!")' end ! a fancy comment !hpf$ not a comment !omp$ not a comment either ================================================ FILE: tests/inputs/hello.f90 ================================================ ! Hello World program hello implicit none print '("Hello, World!")' end program hello !hpf$ not a comment !omp$ not a comment either ================================================ FILE: tests/inputs/hello.java ================================================ /* hello.java */ import java.io.*; class Hi { static public void main( String args[] ) { System.out.println( "Hello World!" ); /* insert comment here */ } } ================================================ FILE: tests/inputs/hello.kt ================================================ /* http://confluence.jetbrains.com/display/Kotlin/Hello%2C+world! */ fun main(args : Array) { val language = if (args.size == 0) "EN" else args[0] println(when (language) { "EN" -> "Hello!" "ES" -> "¡Hola!" // will this render? "RU" -> "Привет!" else -> "Sorry, I can't greet you in $language yet" }) } ================================================ FILE: tests/inputs/hello.lua ================================================ -- single line comment --[[ multi line comment ]] --[[ also a comment --]] print("hello, world") print([[not a comment]]) ================================================ FILE: tests/inputs/hello.pas ================================================ { Hello World in Pascal, for testing SLOCCount. This is multi-line, testing curly braces. } (* This is another multi-line comment. Here's another line. *) program Hello; begin (* Main *) writeln ('Hello, world.') end. (* Main *) ================================================ FILE: tests/inputs/hello.pl1 ================================================ /* * Compile: * gcc hello.c -o hello * * Run: * hello */ main (int argc, char *argv[]) { printf("Hello.\n"); ~ printf("tilde line.\n"); } ================================================ FILE: tests/inputs/hello.sp ================================================ #!/usr/local/bin/spar -- http://www.sparforte.com/sparforte21/examples/hello.html -- Hello world in a quick and scripty way ? "Hello world!"; -- Hello world in a do it again way ?%; -- Hello world in a Bourne shell way echo Hello world!; -- Hello world in an AdaScript parameter shell way echo( "Hello world!" ); -- Hello world in a ISO standard, scalable, structured way put_line( "Hello world!" ); -- Hello world in a PostgreSQL database way db.connect( "ken" ); select 'Hello world!'; db.disconnect; ================================================ FILE: tests/inputs/hello1.pas ================================================ { Hello World in Pascal, for testing SLOCCount. This is multi-line, testing curly braces. } (* This is another multi-line comment. Here's another line. *) (* This is { another } test. **) program Hello; begin (* Main *) writeln ('Hello, world.'); writeln ('It''s a test!'); writeln ('Show that newlines are detected') end. (* Main *) ================================================ FILE: tests/inputs/hello_1.0.bb ================================================ # Hello world from meta-skeleton DESCRIPTION = "Simple helloworld application" SECTION = "examples" LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI = "file://helloworld.c" S = "${WORKDIR}" do_compile() { ${CC} ${LDFLAGS} helloworld.c -o helloworld } do_install() { install -d ${D}${bindir} install -m 0755 helloworld ${D}${bindir} } ================================================ FILE: tests/inputs/hello_app.go ================================================ // https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package hello is a simple App Engine application that replies to requests // on /hello with a welcoming message. package hello import ( "fmt" "net/http" ) // init is run before the application starts serving. func init() { // Handle all requests with path /hello with the helloHandler function. http.HandleFunc("/hello", helloHandler) } func helloHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello from the Go app") } ================================================ FILE: tests/inputs/hello_app.ʕ◔ϖ◔ʔ ================================================ // https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package hello is a simple App Engine application that replies to requests // on /hello with a welcoming message. package hello import ( "fmt" "net/http" ) // init is run before the application starts serving. func init() { // Handle all requests with path /hello with the helloHandler function. http.HandleFunc("/hello", helloHandler) } func helloHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello from the Go app") } ================================================ FILE: tests/inputs/hello_app_autogen.go ================================================ // Code generated by manual copy DO NOT EDIT. // https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package hello is a simple App Engine application that replies to requests // on /hello with a welcoming message. package hello import ( "fmt" "net/http" ) // init is run before the application starts serving. func init() { // Handle all requests with path /hello with the helloHandler function. http.HandleFunc("/hello", helloHandler) } func helloHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello from the Go app") } ================================================ FILE: tests/inputs/hello_app_autogen.ʕ◔ϖ◔ʔ ================================================ // Code generated by manual copy DO NOT EDIT. // https://raw.githubusercontent.com/golang/example/master/appengine-hello/app.go // Copyright 2015 Google Inc. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. // Package hello is a simple App Engine application that replies to requests // on /hello with a welcoming message. package hello import ( "fmt" "net/http" ) // init is run before the application starts serving. func init() { // Handle all requests with path /hello with the helloHandler function. http.HandleFunc("/hello", helloHandler) } func helloHandler(w http.ResponseWriter, r *http.Request) { fmt.Fprintln(w, "Hello from the Go app") } ================================================ FILE: tests/inputs/helloworld.raml ================================================ # https://raw.githubusercontent.com/raml2html/raml2html/master/examples/helloworld.raml # #%RAML 1.0 title: Hello world # required title version: 1 baseUri: http://example.com/{version} documentation: - title: Welcome content: | Welcome to the Example Documentation. The Example API allows you to do stuff. See also [example.com](https://www.example.com). - title: Chapter two content: | More content here. Including **bold** text! /helloworld: # optional resource description: This is the top level description for /helloworld. get: # HTTP method declaration responses: # declare a response 200: # HTTP status code body: # declare content of response application/json: # media type type: | # structural definition of a response (schema or type) { "title": "Hello world Response", "type": "object", "properties": { "message": { "type": "string" } } } example: # example how a response looks like { "message": "Hello world" } /test: displayName: TEST get: description: a sub resource /{id}: uriParameters: id: type: string description: account identifier minLength: 1 maxLength: 10 get: headers: Authorization: type: string description: Basic authentication header example: | Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ== put: body: application/x-www-form-urlencoded: properties: name: description: name on account type: string examples: example1: Naruto Uzumaki example2: Kevin Renskers gender: enum: ["male", "female"] ================================================ FILE: tests/inputs/hi.mojo ================================================ #mojo # Works with Mojo. # pound comment def main(): from time import now print("Hello, the monotonic time is:", now()) # inline comment """ Docstring, also counted as comment. """ ''' Single Quoted Docstring''' ================================================ FILE: tests/inputs/hi.py ================================================ #/usr/bin/env python # Works with both 2.x and 3.x versions of Python. # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment """ Docstring, also counted as comment. """ ''' Single Quoted Docstring''' ================================================ FILE: tests/inputs/htlc.teal ================================================ // https://developer.algorand.org/docs/get-details/dapps/avm/teal/#looping-and-subroutines // Are used to comment in TEAL // htlc.teal // Push the CloseRemainderTo property of the current transaction onto the stack txn CloseRemainderTo // Push addr2 onto the stack as the intended recipient addr SOEI4UA72A7ZL5P25GNISSVWW724YABSGZ7GHW5ERV4QKK2XSXLXGXPG5Y // The == operator is used to verify that both of these are the same // This pops the two values off the stack and pushes the result 0 or 1 == // Push the current transaction’s Receiver property onto the stack // In this example it should be addr2 txn Receiver // Push addr2 on the stack using the addr constant addr SOEI4UA72A7ZL5P25GNISSVWW724YABSGZ7GHW5ERV4QKK2XSXLXGXPG5Y // Use the == to verify that these are equal which pops off the top two values of the stack // and returns 0 or 1 == // The stack should currently have two values from the two top conditions // These will be either 0s or 1s // Push the && operator which will AND the two previous conditions and return // either 0 or 1, which leaves one value on the stack either a 0 or a 1 && // Push the first argument to the transaction onto the stack arg 0 // The len operator pops the arg off the stack and // pushes the length of the argument onto the stack len // Push a constant int of value 46 onto the stack int 46 // The == operator verifies that the length of the argument // is equal to 46. This pops the two values and returns a 0 or 1 // The stack now contains two values with a value of 0 or 1 == // The && operator will AND the two values in the stack // which pops both values off the stack and returns a 0 or 1 // The stack should now only have one value on the stack, 0 or 1 && // arg 0 is pushed back onto the stack // This represents the hashed passcode arg 0 // The sha256 operator pops the arg 0 off the stack // and pushes the hash value of the argument onto the stack sha256 // The constant byte array of the base64 version of our secret is pushed onto the stack byte base64 QzYhq9JlYbn2QdOMrhyxVlNtNjeyvyJc/I8d8VAGfGc= // The == operator pops the two values and pushes 0 or 1 onto the stack // If arg0 is equal to the secret this value will be 1 and if not it will be 0 == // Two values are now on the stack. The && operator is used // to pop the last two values and push either 0 or 1 // This will AND all previous conditions to this one. // The stack should only have a 0 or 1 value now && ================================================ FILE: tests/inputs/html_heex_example.heex ================================================ <%= for entry <- entries do %>
<% # this is a nice comment about progress %> <%= entry.progress %>% <%!-- a multiline comment --%>
<% end %> ================================================ FILE: tests/inputs/i18n_de.ts ================================================ MainWindow View Ansicht &File &Datei E&xit Be&enden First Erstens Third Drittens English Deutsch Language: %1 Sprache: %1 Oblique Schief Second Zweitens Isometric Isometrisch Perspective Perspektivisch Internationalization Example Internationalisierungsbeispiel LTR LTR ================================================ FILE: tests/inputs/iclean.icl ================================================ // https://github.com/camilstaps/iClean/raw/master/iclean.icl /** * Interactive Clean * * Clean program to easily compile and run one-line Clean expressions * * The MIT License (MIT) * * Copyright (c) 2015 Camil Staps * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in all * copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ module iclean import StdEnv import ReadLine // SETTINGS temp_path :== "/tmp/" temp_module :== "iclean" readline_history :== ".iclean_history" // END SETTINGS temp_file :== temp_path +++ temp_module +++ ".icl" Start :: *World -> *World Start w # w = setReadLineName "iClean" w # w = usingHistory w # w = checkedWorldFunc readHistory "Couldn't read history file\n" readline_history w # w = loop w # w = checkedWorldFunc writeHistory "Couldn't write history file\n" readline_history w = w where loop :: !*World -> *World loop w # (s,w) = readLine "λ. " False w | isNothing s = print "\n" w # s = fromJust s | s == "" = loop (print "Use Ctrl-D to exit\n" w) # w = addHistory s w # w = writemodule s w # (r,w) = compile temp_path temp_module w | r <> 0 = loop w # w = run (temp_path +++ temp_module) w = loop w checkedWorldFunc :: (a *World -> (Bool, *World)) !String !a !*World -> *World checkedWorldFunc f err s w # (ok, w) = f s w | not ok = print err w | otherwise = w print :: String *World -> *World print s w # (io,w) = stdio w # io = fwrites s io # (ok,w) = fclose io w | not ok = abort "Couldn't close stdio\n" | otherwise = w writemodule :: String *World -> *World writemodule s w # (ok,f,w) = fopen temp_file FWriteText w | not ok = abort ("Couldn't open " +++ temp_file +++ " for writing.\n") # f = fwrites ("module " +++ temp_module +++ "\n") f # f = fwrites "import StdEnv\n" f # f = fwrites ("Start = " +++ s +++ "\n") f # (ok,w) = fclose f w | not ok = abort ("Couldn't close " +++ temp_file +++ "\n") | otherwise = w compile :: !String !String !*World -> *(!Int,*World) compile _ _ _ = code { ccall compile "SS:p:p" } run :: !String *World -> *World run _ _ = code { ccall run "S:V:p" } ================================================ FILE: tests/inputs/idris_block_comments.idr ================================================ -- -- A module about shapes -- ||| a Shape data Shape = ||| Triangle with base and heigth Triangle Double Double | ||| Circle with radius Circle Double ||| computes the area of a shape area : Shape -> Double area (Triangle x y) = 0.5 * x * y area (Circle x) = pi * x * x -- pi is known by idris {- commented out code -} ================================================ FILE: tests/inputs/igorpro.ipf ================================================ // Taken from https://github.com/t-b/igor-unit-testing-framework/blob/master/procedures/unit-testing-comparators.ipf // licensed under BSD /// @class NEQ_VAR_DOCU /// Tests two variables for inequality /// @param var1 first variable /// @param var2 second variable static Function NEQ_VAR_WRAPPER(var1, var2, flags) variable var1, var2 variable flags incrAssert() if(shouldDoAbort()) return NaN endif if(EQUAL_VAR(var1, var2)) // do some stuff if(flags & OUTPUT_MESSAGE) printFailInfo() endif if(flags & INCREASE_ERROR) incrError() endif if(flags & ABORT_FUNCTION) abortNow() endif endif End ================================================ FILE: tests/inputs/includes_demo.mustache ================================================ {{! https://github.com/mustache/mustache.github.com/archive/master.zip }} {% raw %}

{{header}}

{{#bug}} {{/bug}} {{#items}} {{#first}}
  • {{name}}
  • {{/first}} {{#link}}
  • {{name}}
  • {{/link}} {{/items}} {{! stuff }} {{#empty}}

    The list is empty.

    {{/empty}} {% endraw %} ================================================ FILE: tests/inputs/inner_ref.jsonnet ================================================ // https://jsonnet.org/learning/tutorial.html { Martini: { local drink = self, ingredients: [ { kind: "Farmer's Gin", qty: 1 }, { kind: 'Dry White Vermouth', qty: drink.ingredients[0].qty, /* note ability to add trailing commas */ }, ], garnish: 'Olive', served: 'Straight Up', # The `self` keyword refers to the current # object, which is the Martini in this case. }, } ================================================ FILE: tests/inputs/input.gts ================================================ {{! partial of https://raw.githubusercontent.com/josemarluedke/frontile/a9680f2681a8b1193feba0fdc27871566bcde120/packages/forms/src/components/input.gts }} import Component from '@glimmer/component'; import { tracked } from '@glimmer/tracking'; import { action } from '@ember/object'; import { on } from '@ember/modifier'; import { useStyles, type InputSlots, type InputVariants, type SlotsToClasses } from '@frontile/theme'; import { FormControl, type FormControlSharedArgs } from './form-control'; import { triggerFormInputEvent } from '../utils'; import { ref } from '@frontile/utilities'; import { CloseButton } from '@frontile/buttons'; interface Args extends FormControlSharedArgs { type?: string; value?: string; name?: string; size?: InputVariants['size']; classes?: SlotsToClasses; /** * Whether to include a clear button */ isClearable?: boolean; /** * Controls pointer-events property of startContent. * If you want to pass the click event to the input, set it to `none`. * * @defaultValue 'auto' */ startContentPointerEvents?: 'none' | 'auto'; /** * Controls pointer-events property of endContent. * If you want to pass the click event to the input, set it to `none`. * * @defaultValue 'auto' */ endContentPointerEvents?: 'none' | 'auto'; /** * Callback when oninput is triggered */ onInput?: (value: string, event?: InputEvent) => void; /** * Callback when onchange is triggered */ onChange?: (value: string, event?: InputEvent) => void; } interface InputSignature { Args: Args; Blocks: { startContent: []; endContent: []; }; Element: HTMLInputElement; } function or(arg1: unknown, arg2: unknown): boolean { return !!(arg1 || arg2); } class Input extends Component { @tracked uncontrolledValue: string = ''; inputRef = ref(); if (this.isControlled) { this.args.onInput?.(value, event as InputEvent); } else { this.uncontrolledValue = value; } } @action handleOnChange(event: Event): void { const value = (event.target as HTMLInputElement).value; if (this.isControlled) { this.args.onChange?.(value, event as InputEvent); } else { this.uncontrolledValue = value; } } this.inputRef.element?.focus(); triggerFormInputEvent(this.inputRef.element); } } export { Input, type InputSignature }; export default Input; ================================================ FILE: tests/inputs/insertJournalEntry.ipl ================================================ /* https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/Tivoli+Netcool+Impact/page/Policy+Language+Code+Library */ //-------------------------------------------------------------------- // // insertJournalEntry- this IPL function will create a journal entry // of 'text' for event with serial# 'serial' in // data source 'datasource'. // // The OOB function for creating journal entries // does not support 2+ entries for same serial // in same second. // //-------------------------------------------------------------------- Function insertJournalEntry ( datasource, serial, text ) { UID = 16; // user impact Chrono = GetDate(); randNum = Random(100000); // this is added to support 2+ entries made for same serial# in same second KeyField = serial + ":" + UID + ":" + Chrono + ":" + randNum; // journal entry text (jet) array - 16 "text fields" each varchar(255) jet = { "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "" }; index = 0; while( (Length(text)>0) and (index255) { text = Substring(text, 256, Length(text)); } else { text=""; } index = index + 1; } insertStmt = "insert into alerts.journal ( KeyField,Serial,UID,Chrono,Text1,Text2,Text3,Text4,Text5,Text6,Text7,Text8,Text9,T ext10,Text11,Text12,Text13,Text14,Text15,Text16)"; insertStmt = insertStmt + " values ( '" + KeyField + "', " + serial + ", " + UID + ", " + Chrono; index=0; while(index= @1970-01-16 derive { transaction_fees = 0.8, income = total - transaction_fees } filter income > 1 group customer_id ( aggregate { average total, sum_income = sum income, ct = count total, } ) ================================================ FILE: tests/inputs/io.c3 ================================================ // https://github.com/c3lang/c3c/blob/master/lib/std/io/io.c3 (partial saved here) // Copyright (c) 2021-2025 Christoffer Lerno. All rights reserved. // Use of this source code is governed by the MIT license // a copy of which can be found in the LICENSE_STDLIB file. module std::io; import libc; enum Seek { SET, CURSOR, END } faultdef ALREADY_EXISTS, BUSY, CANNOT_READ_DIR, DIR_NOT_EMPTY, PARENT_DIR_MISSING, EOF, FILE_CANNOT_DELETE, FILE_IS_DIR, FILE_IS_PIPE, FILE_NOT_DIR, FILE_NOT_FOUND, FILE_NOT_VALID, GENERAL_ERROR, ILLEGAL_ARGUMENT, INCOMPLETE_WRITE, INTERRUPTED, INVALID_POSITION, INVALID_PUSHBACK, NAME_TOO_LONG, NOT_SEEKABLE, NO_PERMISSION, OUT_OF_SPACE, OVERFLOW, PATH_COULD_NOT_BE_FOUND, READ_ONLY, SYMLINK_FAILED, TOO_MANY_DESCRIPTORS, UNEXPECTED_EOF, UNKNOWN_ERROR, UNSUPPORTED_OPERATION, WOULD_BLOCK; <* Read from a stream (default is stdin) to the next "\n" or to the end of the stream, whatever comes first. "\r" will be filtered from the String. @param [&inout] allocator : "The allocator used to allocate the read string." @param stream : `The stream to read from.` @param limit : `Optionally limits the amount of bytes to read in a single line. Will NOT discard the remaining line data.` @require @is_not_instream_if_ptr(stream) : "The value for 'stream' should have been passed as a pointer and not as a value, please add '&'." @require @is_instream(stream) : `Make sure that the stream is actually an InStream.` @param [inout] allocator : `the allocator to use.` @return `The string containing the data read.` *> macro String? readline(Allocator allocator, stream = io::stdin(), usz limit = 0) { return readline_impl{$typeof(stream)}(allocator, stream, limit); } <* Reads a string, see `readline`, except the it is allocated on the temporary allocator and does not need to be freed. @param stream : `The stream to read from.` @param limit : `Optionally limits the amount of bytes to read in a single line. Will NOT discard the remaining line data.` @require @is_not_instream_if_ptr(stream) : "The value for 'stream' should have been passed as a pointer and not as a value, please add '&'." @require @is_instream(stream) : `The stream must implement InStream.` @return `The temporary string containing the data read.` *> macro String? treadline(stream = io::stdin(), usz limit = 0) { return readline(tmem, stream, limit) @inline; } fn String? readline_impl(Allocator allocator, Stream stream, usz limit) @private { if (allocator == tmem) { DString str = dstring::temp_with_capacity(256); readline_to_stream(&str, stream, limit)!; return str.str_view(); } @pool() { DString str = dstring::temp_with_capacity(256); readline_to_stream(&str, stream, limit)!; return str.copy_str(allocator); }; } <* Reads a string, see `readline`, the data is passed to an outstream @param out_stream : `The stream to write to` @param in_stream : `The stream to read from.` @param limit : `Optionally limits the byte-length of the allocated output string.` @require @is_not_instream_if_ptr(in_stream) : "The value for 'in_stream' should have been passed as a pointer and not as a value, please add '&'." @require @is_not_outstream_if_ptr(out_stream) : "The value for 'out_stream' should have been passed as a pointer and not as a value, please add '&'." @require @is_instream(in_stream) : `The in_stream must implement InStream.` @require @is_outstream(out_stream) : `The out_stream must implement OutStream.` @return `The number of bytes written. When a 'limit' is provided and the return value is equal to it, there may be more to read on the current line.` *> macro usz? readline_to_stream(out_stream, in_stream = io::stdin(), usz limit = 0) { return readline_to_stream_impl{$typeof(in_stream), $typeof(out_stream)}(out_stream, in_stream, limit); } fn usz? readline_to_stream_impl(OStream out_stream, IStream in_stream, usz limit) @private { bool $is_stream = IStream == InStream; $if $is_stream: var func @safeinfer = &in_stream.read_byte; char val = func((void*)in_stream)!; $else char val = in_stream.read_byte()!; $endif bool $is_out_stream = OStream == OutStream; $if $is_out_stream: var out_func @safeinfer = &out_stream.write_byte; $endif if (val == '\n') return 0; usz len; if (val != '\r') { $if $is_out_stream: out_func((void*)out_stream.ptr, val)!; $else out_stream.write_byte(val)!; $endif len++; } while (!limit || len < limit) { $if $is_stream: char? c = func((void*)in_stream); $else char? c = in_stream.read_byte(); $endif if (catch err = c) { if (err == io::EOF) break; return err~; } if (c == '\r') continue; if (c == '\n') break; $if $is_out_stream: out_func((void*)out_stream.ptr, c)!; $else out_stream.write_byte(c)!; $endif len++; } return len; } ================================================ FILE: tests/inputs/issue_875.bdy ================================================ /* * bubble sort */ DECLARE TYPE number_array IS VARRAY(100) OF NUMBER; arr number_array := number_array(64, 34, 25, 12, 22, 11, 90); n NUMBER := arr.COUNT; i NUMBER := 0; j NUMBER := 0; temp NUMBER; BEGIN FOR i IN 1 .. (n - 1) LOOP -- outer FOR j IN 1 .. (n - i - 1) LOOP -- inner IF arr(j) > arr(j + 1) THEN temp := arr(j); arr(j) := arr(j + 1); arr(j + 1) := temp; END IF; END LOOP; END LOOP; -- print FOR i IN 1 .. n LOOP DBMS_OUTPUT.PUT_LINE(arr(i)); END LOOP; END; / ================================================ FILE: tests/inputs/issue_876.vue ================================================ ================================================ FILE: tests/inputs/issues/114/bar/bee/inner_most.js ================================================ js 1 ================================================ FILE: tests/inputs/issues/114/bar/under_Bar.js ================================================ js 2 ================================================ FILE: tests/inputs/issues/114/foo/under_foo.js ================================================ js 3 ================================================ FILE: tests/inputs/issues/131/README ================================================ This directory contains inputs for tests 21 through 24 in cloc/Unix/t/01_opts.t The tests exercise cloc's ability to work with git submodules (specifically, to ignore code in these). If you're working with a git repo clone you will need to update the submodule via git submodule init git submodule update issued within your cloc working directory to get the tests to pass. ================================================ FILE: tests/inputs/issues/131/hi.py ================================================ #/usr/bin/env python # Works with both 2.x and 3.x versions of Python. # pound comment import time print('Hello. The time is %f Unix epoch.' % (time.time())) # inline comment """ Docstring, also counted as comment. """ ================================================ FILE: tests/inputs/issues/132/.gitignore ================================================ ignore_git/* ================================================ FILE: tests/inputs/issues/132/C-Ansi.c ================================================ /* Hello World in C, Ansi-style */ /* from http://www.roesler-ac.de/wolfram/hello.htm */ #include #include int main(void) { puts("Hello World!"); return EXIT_SUCCESS; } ================================================ FILE: tests/inputs/issues/132/README ================================================ Issue #132 (https://github.com/AlDanial/cloc/issues/132) needs a non-git controlled subdirectory called 'ignore_git' created here. Copy into this new directory the file hi.py from the test inputs directory. # if cwd is cloc/tests/inputs/issues/132/ then: mkdir ignore_git cp ../../hi.py ignore_git/ # if cwd is cloc/ then: mkdir tests/inputs/issues/132/ignore_git cp tests/inputs/hi.py tests/inputs/issues/132/ignore_git/ # if cwd is cloc/Unix then: mkdir ../tests/inputs/issues/132/ignore_git cp ../tests/inputs/hi.py ../tests/inputs/issues/132/ignore_git/ Note: The actions above are done automatically when running 'make test' in the cloc/Unix directory. ================================================ FILE: tests/inputs/issues/132/ignore_dir/Fortran77.f ================================================ C from http://www.roesler-ac.de/wolfram/hello.htm C Hello World in Fortran 77 PROGRAM HELLO PRINT*, 'Hello World!' END ================================================ FILE: tests/inputs/issues/166/X ================================================ Isabelle filter remove_between_general (* *) extension thy 3rd_gen_scale 3.00 ================================================ FILE: tests/inputs/issues/166/fake.thy ================================================ This is (* not an Isabelle file *) Instead, just some text lines. ================================================ FILE: tests/inputs/issues/183/eval1957.SACunidir.fr ================================================ ( https://github.com/rsennrich/Bleualign/eval/eval1957.SACunidir.fr ) chronique himalayenne 1956 avec notes complémentaires sur les années précédentes par g. o. dyhrenfurth avec 3 illustrations dans la dernière époque sont les cotes de la grande himalaya-berge , ce qui a regrettables confusions . comme est une pareille incertitude , même dans les plus célèbres , depuis 100 ans et mesurées expliquer ? ce sont surtout les trois fehlerquellen aujourd' hui en être autrement qu' autrefois : la grandeur de la b ) jahres- et de la masse de l' himalaya et ;c ) les réductions au géoïde . il serait donc fait attendre que les depuis 1952 , qui étaient faites et neuberechnung très forte en face des écarts le vieux fournissent rouges , mais heureusement les plus tôt gemachten erreurs surtout kompensiert . pour chomo-lungma ( mont everest ) d' assez six calculs aus den jahren 1849 et 1850 une valeur moyenne de 8839,8 m , six calculs de les années 1881-1902 lieferten un moyen de 8882,2 m. ce nombre a été encore trop bas que l' , et les ( 1513 ) sens pas montés jusqu' à plus de 8900 m hinaus . la nouvelle cote officielle publiée en 1955 ramène , de 8900 m. c' est donc le nombre , à la ronds . pour le kangchenjunga , n' a connu que l' ancienne cote de 8579 m d' environ 60 ft . = 18,29 m augmenté doit être , la troisieme montagne de la terre , à environ 8597 m. est acheminés . la nouvelle cote officielle de ma connaissance n' est pas encore été publiée . quoi qu' il en soit , l' altitude de 8603 m qui figure sur la carte de marcel kurz , qui fut très bien . le lhotsé mesure toujours 8501 m , mais probablement demnächst , à environ 8510 m heraufgesetzt doivent être - conformément à ses voisins , l' everest et le makalu . car la depuis un siècle , 8470 , maintenant , abandonnée . le nouveau chiffre officiel est 8481 m. le plus , c' est au cho oyu , pour le depuis quelque temps deux cotes - 2 les alpes - 1957 - die alpen 17 , 8153 m et 8189 m - dans « standen . une neuberechnung est probablement pas encore été terminés . le dhaulagiri , le mont blanc » de l' himalaya , le plus haut sommet de la terre , était coté jusqu' ici 8172 ou 8167 m . la nouvelle cote lui donne 8222 m. au-dessus de manaslu ( 8125 m ) , du nanga parbat ( 8125 m ) , l' annapurna i ( 8078 ou 8074 m ) , le shisha pangma ( 8013 m ) et les quatre « 8000 » pakistanais k2 ( 8611 m ) , le hidden peak ( 8068 m ) , le broad peak ( 8047 m ) et le gasherbrum ii ( 8035 m ) est pour rien de nouveau je garde pour ma part du passage . en tenant compte de tous les neuberechnung aujourd' hui physiques connu facteurs assez exige beaucoup de temps . les kaschmirfrage avec la frontière entre l' inde et le pakistan , dont encore . nous devons donc patienter encore , jusqu' à ce que les nouvelles altitudes pour tous les grands sommets de l' himalaya et du karakorum définitivement - c' est au moins pour quelques décennies - . dans notre revue des principales récentes expéditions le passé récent , nous commençons de nouveau avec ä l' himalaya : 1. du kangchenjunga , les grimpeurs n' est pas beaucoup de nouveau à signaler au . la splendide ascension fut déjà dans notre « chronique himalayenne 1955 » traités ( voir les alpes 1956 , n° 4 ) . mais , du point de vue géologique , l' a méthodiquement par le dr toni hagen notre connaissance du kangchendzönga-massivs très nettement merveilleuse . « les alpes » 1956 , s.298-303 ( novembre ) bringen dans le texte , profils et un premier esquisses cartographiques ) . 2. à la montagne de la terre , les arthaud ) . le livre de jean franco ( « makalu » , l' an dernier . b.arthaud ) , maintenant , même en allemand autant ( zürich : orell füssli 1956 ) , après les amène gehaltvollen originalberichten et en face de notre annee « chronique himalayenne » en principe pas beaucoup de nouveau . mais les ascensions du makalu-gebietes par le dr toni hagen en hiver 1954/55 et en automne 1955 , dont les résultats de ce n' est que tout récemment fut quelque peu connue ( voir les alpes 1956 , p. 295-298 ) , étaient scientifiques de grösster bedeutung et lieferten bildlich aussi une splendide . la tectonique du peu à peu dévoilée et s' avère est aussi grandiose , comme on - nos anticipations le prévoyaient . 3. , à l' est de la , le fleuve arun s' arim-fluss jusqu' à 1200 m , un des plus formidables qui , il y a sur la terre . déjà en 1930 , j' en ai écrit : « de l' himalaya proprement dite , n' est pas malgré son altitude de partage des eaux ; celle-ci est de plus au nord , , constituée par des chaînes . des fleuves , comme par exemple le financé ( entre makalu- et kangchendzönga-gruppe ) ou la tista ( à l' est du kangchendzönga ) plus au sud jaillissent , sur le versant nord de l' himalaya et haben sich in terribles gorges vers le sud , par le gebirgswall durchgefressen . pareille formidables par rückschreitende seulement à l' érosion , n' est pas possible . apparemment filiusion ces cours d' eau issus déjà à l' océan indien , comme il n' a pas encore himmelstürmende great de l' himalaya , et ils tenaient avec la gebirgsaufwölbung pas . les hebung une zone situé au sud de la chaîne , donc peu à peu , ainsi que les rivières se dans la même rythme einschneiden et de leurs anciens cours dans la section essentiels . ces fleuves sont plus vieux que l' himalaya . » le arun-tal est aussi et de pflanzengeographisch très intéressante . im auftrage du british museum j.d.a.stainton y a travaillé en été 1956 . il était accompagné du sherpa da temba ( himalayan club : deux nr.212 ) . 4. la grande expédition suisse de 1956 , de la ssaf soigneusement préparé et organisée , d' albert eggler mustergültig conduite et par les alpinistes bernois en vivent en parfaite harmonie camaraderie italienne - fut une des les entreprises dans l' histoire de l' himalaya . elle culmine dans la première ascension du lhotse ( 8501 m , resp. environ 8510 m ) , le 18 mai 1956 par ernst reiss et fritz luchsinger , la deuxième ascension du mount everest ( 8848 m ) , le 23 mai par jiirg marmet et ernst schmied et de la troisième ascension , le 24 mai par adolf reist et hansrudolf von gunten . pour ne pas répéter ce qui est connu , il suffira ici , à quelques des principaux publications : références : a ) les articles originaux dans « de la confédération » et « neue zürcher zeitung » de mai à octobre 1956 . - « les alpes 1956 , 132/133 , 147-151 , 175-177 et le fascicule de mars 1957 . - alberteggler : sommet par les nuages . berne : hallwag . - « berge der welt » , bd.xi ( 1956/57 ) , p. 161-177 . outre les succès bergsteigerischen réalisations , nous voulons l' exploration scientifique des everest-gebietes n' oublions pas : 1952 augustin lombard , albert zimmermann , ;1952/53 1952 et 1953 l. g. c.pugh physiologisch , 1954 l'«aide heuberger géographique , 1954 et en 1955 pierre bordet et michel latreille , ainsi que les français - indépendant de tout -toni hagen , du point de vue géologique , 1955 , erwin schneider , but de 1956 , fritz müller et arthur durst glaziologisch et meteorologisch . les chomo-lungma-gruppe au bestbekannten devient peu à peu la région de l' himalaya . 5. pour l' hiver 1956/57 est une expédition australienne , sous la conduite de peter c. bryne a annoncé , en solo khumbu ( wieder einmal ) sur la yeti-suche begeben will , c' est sur les « photographique schneemenschen»-jagd ( voir aussi 12 de cette chronique ) . n' est pas davantage encore connus . 6. au-dessus de l' expédition féminine schottische , les au printemps 1955 au ne de kathmandu dans le jugal himal , qui était déjà dans l' intervention chronique ( voir les alpes 1956 , p. 81 ) peu . entre-temps , le livre a : monica jackson et elizabeth stark , tents in the clouds ( london : il en 1956 ) , joliment illustré écrit allègrement et , quand nous nous aussi - h. w.tilman beistimmend - , nous aimerions rappeler que « human interest » , il ne devrait être et que les montagnes sont en général que les sur eux herumkriechenden hommes . 7 sur le puissant manaslu ( 8125 m ) , les japonais 1952 une reconnaissance et de 1953 , une tentative sérieuse , bei dem sie jusqu' à 7750 m . en 1954 déjà , il n' y eut la marche d' approche par la vallée de la grande difficulté , avec de la population , qui se vers cette heureuse belästigung la gottheit au barrage . l' expédition dut faire demi-tour . en 1955 , le calme de la montagne , mais l' inévitable préparation diplomatique . 1956 apporta la décision : sous la conduite du montagnard expérimenté qu' de yuko maki , le 1921 , avec les guides de grindelwald , fritz amatter , fritz steuri et samuel brawand , la première ascension par l' arête de la mittellegi de l' eiger avait réussi , cette fois-ci , a tenté une voie nouvelle . jusqu' ici , on avait sur le versant se du massif gehalten : le village de sama ausgehend , par le manaslu-gletscher , naike-col ( 5600 m ) et le col nord ( 7100 m ) au un plateau glaciaire , un pas plus difficile , mais très long chemin , la neuf camp avait exige . mais , maintenant , se fit de la dernière montée par le sud , et l' on s' en tira avec six camps seulement . quatre membres de l' équipe des grimpeurs ont atteint le sommet -am 9.mai imanishi avec le sherpa gyalzen ( himalayan club : deux jours ) et le 11 mai kato et higeta. par les quatre pointes , qui forment le sommet le plus élevé , est si étroit qu' un seul homme ; d' après les dernières mesures , le manaslu a exactement la même altitude que le nanga parbat ( 8125 m ) ; tous deux se trouvent à la 8 et 9 endroit de la rangliste . le récit de cette montagne ténacité la traduction exacte et les photos de leur expédition victorieuse de 1956 , on attend avec impatience . 8. par les encore à gravir est reprise , le plus haut , le dhaulagiri ( d' après les nouveaux calculs 8222m ) , pour les depuis quatre ans gerungen devient dure ; en 1953 , et l' expédition de l' aacz , 1954 , la première expédition argentine , les jusqu' à 7950 m , et qu' il fit par un enfer pour le gipfelsieg gebracht fut , en 1955 , le schweizerisch-deutsche « vegetarische himalaya-expedition » et de 1956 , la seconde expédition argentine . de cette entreprise , dirigée par le colonel e.huerta , on n' a pas grand' deux , le 15 et 25 mai , échouèrent . si les pressemeldungen des voix , fut une altitude d' environ 7200 m atteint . pour 1957 , on dit qu' une expédition franco-suisse est en préparation , et si cette de la victoire , les argentins pourraient revenir en 1958 pour la troisième fois . le dhaulagiri est une montagne difficile et dangereux , lui aussi , l' heure de taille ... peut-être même bientôt . du dhaulagiri himal , couronnée de six dépassant les 7000 m ( voir les alpes 1956 , p. 82 ) , rien de nouveau à signaler au . dans west-nepal depuis l' automne 1956 , le dr toni hagen . 9. dans le garhwal , le trisul ( 7120 m ) , gravi deux fois , et cela par k.bunshah de bombay , avec deux sherpas et de deux allemands , f. et a. hieber . le trisul , la première fois déjà en 1907 par t. g. longstaff avec a. et h. bracherei et kharbir gravi , est un beau , mais unschwieriger montagne au sudouest de la nanda devi , est considéré comme « billiger sept mille » , et fut plusieurs fois déjà visité 10. dans la chronique himalayenne 1955 , déjà mentionné que peter aufscknaiter et george hampson une excursion dans les ronti-gruppe au sud de la rishi ganga-schlucht ( nanda devi-gebiet ) ont fait . après coup est connu que dabei ( 1955 ) , la première ascension du ronti ) a réussi à 11 m.11. les expéditions féminines semblent venir à la mode . en mai et juin 1956 était l' expédition abinger » , sous la conduite de mrs.joyce dunsheath . c' étaient quatre membres du ladies alpine club , londres , les de manali , par le hampta-pass dans la vallée , est le bara shigri est leur camp de base , et , de là , de six sommets entre 5800 et de 6100 m erstiegen . ils furent qui collaborent par le très ancien homme ang tsering uj ( « pansy » , h.c. n° 51 ) et trois autres sherpas . 12. dans la vallée dont les eaux se déversent dans le même le dans le sud , au kulti-gletscherbecken , où , en 1955 , une expédition de la royal air force mountaineering association , dirigée par le capitaine a.j.m.smyth , travailla ( voir les alpes 1956 , s.85 haut ) . récemment une très intéressante récit d' escadrille l. ( « alpine journal n° . alpine journal n° 293 , nov . en 1956 , p. 340-343 ) . je finis réparties - en traduction - quelques extraits : « ... nous rencontrâmes trois grands empreintes de pas sur l' arête , un peu au milieu du grand torrent glaciaire à notre droite . c' était indubitablement un animal aus dem glacées , vite , l' eau coulant sur l' îlot . nous voulions traverser volontiers la rivière , mais il était trop profonde et terriblement froid . c' est pourquoi nous nous vîmes maintenant bien pour , où la bête était hineingegangen dans l' eau . bientôt l' endroit était trouvée : une centaine de pas . de là , nous suivons la trace de toucher , donc sur le flanc ouest de la vallée et dans la direction , d' où la bête était venue . nous marchions parallèlement à l' itinéraire , sans elles , à environ croisent . l' animal était debout cheminant dans la fall-linie heruntergekommen ; en revanche , où il fut trop raide , il était sur son derrière heruntergerutscht . après examen judicieuse , montre qu' il a cette descente suivants les mains avait utilisé , parfois au freiner , parfois pour nachzuhelfen . la distance entre de gauche et de droite handspuren était quelque trois pas . après nous avoir la grande des traces premièrement aperçues , de la rivière jusqu' à un pont de neige , puis sur l' autre rive de nouveau revenir en arrière jusqu' à l' endroit où nous avions découvert d' abord les environs . c' est ici que l' eau environ 1 y2 m de profondeur , le courant avait le uferrand unterhöhlt - malgré tout , nous avons pu nous ne pûmes découvrir aucune empreinte de mains ou . quoi qu' il en soit créature qui avait passé là , extrêmement gross gewesen sein , car il était sortir de l' eau profonde simplement sur le bord de l' îlot . comme ses camarades ladakhis , sur les précautions vers nos sherpas . mais cette attitude totalement . « zarur sahib , s' exclama , y eh bah nay hai » , cria-t-il . ( ce n' est certainement pas un ours ) . la veille , il m' avait lors de mes caméras , 300 m en amont . nous pûmes constater que nos propres empreintes ne s' étaient élargies d' environ 3 sur leur . l' hypothèse que les prétendues empreintes par la fonte devait ) de bärenpfoten sont , dans le cas . en outre , nous avions de cette région , le bien jours à heures environ . nous savions que , depuis ce geschöpf , entre le 11 juin 1955 , de l' apres , et le 12 juin , tôt , la vallée de avait traversé . l' examen attentif des empreintes de pas sur le fil de l' île qu' elle ' de la rivière était durcie , quand la neige gelée , était donc dans la nuit ou très tôt le matin . sur des six voyages que j' ai faits souvent je ours noirs ou rouges et observé leurs traces , mais ici , dans ces empreintes de kulti étaient très différentes . chacun de large et les orteils , ( 203 mm . le certains avait une longueur de bien 30 cm et une largeur de 20 cm et était à certains endroits , environ 28 cm de profondeur , où j' ai même à peine 4 cm . dabei berceau je 89 kg , et je machte mes observations dans le soleil de midi . cette profondeur soit dans la neige dure , prouve que l' animal très lourd . pendant des heures , nous suivons les traces , ce qui , à travers les se prolongeaient sur près d' un kilomètre et des torrents glaciaires , fut très difficile . elle avait ' d' au moins cinq de ces chenals , et sur le flanc est de la vallée rocheuse avant que ses traces aillent se perdre . il avait nulle part à quatre pattes . la distance de ses pas était presque le double des miens . finalement nous abandonnâmes la chasse sur et retournèrent au camp de base . nos sherpas étaient très persuadés qu' il s' agissait d' un ,yéti ' . swami pranavananda a intéressantes récemment un article écrit ( ,the abominable snowman ' dans ,the alpine journal , n° 292 , mai 1956 , p. 110-117 ) , dans l' intention de montrer , le ,yeti-legende ' la force à faire . malheureusement , il ne peut prétendre avoir jamais lui-même et il examine zu haben . il parle seulement de seconde main plusieurs tibétains ont confirme que des traces d' abord , puis , comme fährten d' un rouge ( nous installerions le dire : herausgestellt ours bruns ) . c' est , bien sûr , qu' un scheinargument . il est pourtant très bedeutsam : quand toujours d' une nouvelle espèce de conta - étaient toujours de nombreux sachverständige trop prêt , à une attester que si quelque chose ne pouvait exister . il y a cent ans , exactement franco-américain paul belloni du chaillu tira le premier gorille , le d' un blanc . plus de 2000 ans , l' europe avait tenu le gorille pour une pure légende , comme le serpent de mer ou les ,dragons ' du moyen âge . lorsque chaillu sa description de ce retour en europe , rires . il fallut encore si l' europe admette l' existence du gorille . il en fut de même plus tard , par exemple , avec le , du coelacanthus et l' okapi , la girafe des forêts primitives . les spécialistes de cet inconnu êtres vivants de l' existence de ces animaux . sceptiques demanderont pourquoi les rencontres avec le ,yéti ' ont été si rares , et il n' est que les indigènes , le visage . on pourrait leur répondre par une contre-question : comme beaucoup d' hommes , dans cette île la grande-bretagne ( ou en suisse ! ) ont déjà un dachs ( en liberté ) gesehen ? dans les vastes solitudes inexplorées de l' hima , les d' observer sans être . bien que la plupart des yeti-berichte par les indigènes , y est sans doute , que cette là de vie et de plus de possibilités , ont un yeti réprouvés , comme la main de européens , avec les buts record , le plus souvent en outre dans la saison chaude , si au-dessus de la limite des neiges , et , quand il y a beaucoup de ravitaillement . de ce côté , c' est très remarquable , que la limite des neiges , en 1955 , au loin , exceptionnellement ancestrale place . nous devons même notre d' origine le forschungsgebiet , la ligne de partage des eaux du shigri glacier , et nous nous abandonner avec le ( est ) kulti himal . wladimir tschernezky , le peut-être que la notion de ,yeti ' scientifiques , a été étudiée , verglich cette mystérieuse vivants avec le maintenant ausgestorbenen gigantopithecus . c' est peut-être un homme pense plutôt comme un ,yéti ' . les , qui les indigènes , surtout les sherpas , en face du yeti ressentons est due à ses instincts pillards et à son intelligence . tschernezky a confirmé , de même que nos kulti-spuren une très grande ressemblance avec les années précédentes , authentischen récits de photos et d' ascensions ... » le l.w.davies , le fliegeroffizier courageuses , le « juron s' échappait de la lächerlichkeit » n' a pas . deux bonnes , très significatives . personnellement , je suis après comme avant l' avis que , avec le cri « ours ! » et , avec quelques remarques ironiques le « schneemenschen-problem » ne sera pas résolue . voir aussi ralph izzard : the abominable snowman adventure , london : & hodder and stoughton 1955 ) . 13. l' année 1955 , est aussi les « ) , sous la hamish mcarthur dans . comme le rapport ( « the alpine journal , n° 293 , p. 279-295 ) montre , ne fut pas seulement les grimpeurs , mais aussi un . ... magnifiquement panoramas , jolie photos , une très granitiques kammverlauf-karte et une bibliographie de 55 numéros portent très nettement à la connaissance de ce jusqu' à un peu stiefmütterlich traitaient la région . l' altitude des montagnes se tiennent entre 5800 et 6300 m. ce sont donc pour himalaya-verhältnisse assez modeste des montagnes , pas überalpin , mais simplement alpin , mais paysage attrayant et , en partie , encore peu connu - un bon champ d' activité pour klein-expeditionen , les pas beaucoup de temps et d' argent . 14. appliquer à la géologiques , particulièrement intéressante région voisine du spiti , les « par l' expédition de cambridge fossiles . au-dessus , le rapporte trevor braham ( « the alpine journal , n° 293 , . 296-309 ) . le résultat de deux petits six mille de et de nombreuses traversées de cols . 15 15. du karakorum le groupe du sasir kangri ( 7672 m ) , dans la grande boucle du fleuve shayok , constitue l' aile sud-est . ce massif d' la première expédition du couple visser-hooft en 1922 . après une longue pause - 1946 - , une expédition britannique conduite par j. o. m. roberts leur chance , mais si peu de succès , bien que tous les candidats au karakorum se désistèrent . comme le sasir kangri se trouve dans la partie indienne du cachemire , il était pour le « himalayan mountaineering institute de darjiling un intérêt particulier . sous la conduite du montagnard expérimenté qu' n.d. major jayal aurait une nouvelle tentative fut faite en 1956 , mais cette fois , c' est en vain . les détails ne sont pas encore connu ; quoi qu' il en soit , mais fut annoncé que jayal aurait déclaré cette montagne . bien qu' encore pas un huit mille , c' est certainement un dur morceau . 16. un des sommets les plus hardis du karakorum est la baltoro-gletschers située sur le versant nord de la tour de muztagh ( 7273 m ) . pour la plupart , de la célèbre photo rapportée par vittorio sella en 1909 , il s' agissait cette presque als symbole , comme verkörperung du marche . mais j' ai déjà 1939 dans mon « baltoro ( bâle : benno schwabe , basel ) sur s.66/67 écrit : « quand on la regarde du glacier supérieur de baltoro , il est presque , mesurés à une ascension auch nur songer . bei à la considérer de plus près , mais se montre , à mon avis , une chance : les parois , il est vrai , sans espoir . l' arête se , qui porte le ,blacktooth ' , n' est pas encourageante . mais le west- ou , plus exactement w.nw - est peut-être possible . le col au pied de l' arête w du chagaran-gletscher il faudrait chercher à atteindre . » exactement sur cette route , j' ai jadis , fut proposé de la tour de muztagh maintenant par une expédition britannique , sous la conduite de j.hartog submerge , et même de deux cordées les 6 et 7 juillet 1956 . les erfolgreichen bergsteiger étaient : hartog , j. brown et i. mcnaugh-davis . du dernier camp ( 6400 m ) , ils ont atteint le sommet par l' arête ouest ; les deux cordées durent bivouaquer à la descente , ce qui valut à hartog de graves gelures . 17. si incroyable que cela sonne , quelques jours plus tard , la tour de muztagh fut de nouveau gravi , et par le plus difficile encore l' arête sud-est par une expédition française . le chef en était guido magnone , dont le nom de avec la paroi ouest des drus , le cerro fitz roy , le makalu et de nombreux autres de la plus grande et plus difficiles ascensions verknüpft est . les autres participants étaient : andré contamine , paul keller , robert paragot et le médecin françois florence , comme officier de liaison pakistanais cwpt.ali .usman . le 31 mai , on était dans d' askole , le 2 juin , il aurait à bardumal ( « bagdomal » ) , presque une catastrophe , comme une puissante appels tout le camp de la terre , le 5 juin fut atteint à urdokas . c' est là que magnone apprit que l' expédition britannique , la meilleure équipe qu' on pût mettre sur nos jambes , se trouvait dans la tour de muztagh terminés , et déjà , avait une avance considérable . depuis deux semaines , les anglais , les au-dessus de mustagh- et chagaran-gletscher étaient montés en tentative à l' arête ouest , et ils étaient déjà très haut sur la montagne . pour les français une délicate situation : la voie des anglais suivre , n' entrait en ligne de compte . on voulait , les en ces si loin en avant , dass sie que de toutes façons , sur le sommet . les français ne pas cher un autre but bergsteigerisches au glacier supérieur de baltoro ? mais on ne daraufwar préparé , et les porteurs avaient aussi , en revanche , pas assez de vivres . finalement , on était oui , cette fois-ci dazu ausgezogen , techniquement difficile de problèmes . il fut donc décidé , les autres faces de la tour , aller s' il sur l' arête nord , ou peut-être , sur le versant sud , une voie possible . le mauvais temps et une grève des porteurs - combien d' expéditions ont eu de graves ennuis avec les baltis ! - retardèrent l' expédition de quelques jours . ce n' est que le 12 juin , le camp de base fut installé à 4500 m environ , sur le moyen younghusband-gletscher ( aussi biange-gletscher genannt ) , où se trouve la branche orientale et le occidental réunissent , donc au pied de l' arête sud-est du « noires dent » ( 6719 m ) . nun commencèrent les reconnaissances : la première excursion les conduisit par la branche orientale au point le plus bas ( 5600 m environ ) , entre le mont steste et la tour de muztagh , donc au pied de sa prétendue » . quelle déception ! il n' y a pas d' arête , n' est qu' une au moins 1600 m de hauteur , effroyablement raide , balayée par les avalanches , la plus pure . retour donc au camp de base . le 17 juin , on réussit à travers les 900 m de la chute de seracs du glacier ouest , donc sur le versant sud du black tooth » , de trouver un passage , et fut commencé immédiatement , le câble de 300 m , dans la partie inférieure de la séraczone zu tendons et une il sur un nez rocheux au-dessus du glacier , que là ... il neigeait pendant dix jours . le seul ce qu' on put , était une visite à la « concurrence » sur l' autre versant de la montagne , pour la verstimmung par une large de prononciations se . anglais et français se séparèrent en bons camarades . enfin , le ciel s' éclaircit , avec toutes les forces , on fit à l' œuvre , aussi les hunza-träger taten leur splendide , et à la fin de juin le camp 1 ( 5100 m ) , le 2 juillet le camp 2 ( 5400 m ) . le camp 3 ( 6000 m ) dut sur l' éperon rocheux , la du black tooth » . cette distance entre le camp 2 et 3 était un böses morceau , à droite , malgré 400 m de cordes fixes , environ si difficile que la face nord des courtes , sur la rive gauche de la menace des . le allerschlimmste mais était la « grande pyramide au-dessus du camp 3 , un ressaut rocheux vertical , une épaisse couche de glace de 200 m auflag , et cette paroi a barré la voie d' accès au sommet dans toute sa largeur . il y avait là qu' une seule possibilité de durchkommens , tout à droite , et la descente est faite d' une terriblement raide hohlkehle . plusieurs jours de besogne acharnée et 300 m de cordes fixes . ce n' est qu' au matin du 6 juillet , c' était si loin : ils se dressaient , au-dessus de la paroi de glace , sur un petit glacier suspendu . le dr florence , le bergtüchtige médecin de l' expédition , et les deux meilleurs hunzas , aminula et gerikhan , les jusqu' ici des nôtres waren und wacker est hatten , demi-tour , et en arrière , ne restèrent que les quatre alpinistes de la cordée . dans brütender chaleur , ils battîmes avec neige farineuse où la neige profonde , de la place pour le camp 4 ( 6300 m ) . au-dessus d' eux se dressait la tour encore de 1000 mètres de haut , dans une raideur telle qu' elle fait hocher la tête . la seule voie , était l' arête sud-est . le 7 juillet , robert paragot tout à coup deux petits , qui se là-haut vers le ciel abzeichneten : les britanniques arrivaient au sommet . les français et ne se laissèrent pas décourager . en avant ! le fil de l' arête sud-est , est extrêmement difficile . les deux premières longueurs de corde au-dessus de la rimaye - le 7 juillet - hatten heures d' efforts , 250 mètres de dénivellation , requirent deux jours . six heures de cramponnage à la limite de l' équilibre , des dalles verglacées surmontées à l' , ils purent enfin dans une brèche de l' arête . ce fut certainement une des plus dures escalades qu' on ait faites jusqu' ici dans l' himalaya et à cette altitude . a midi , le soleil disparaissait derrière nuages épais . sur l' arête , suivit une brèche profonde de l' autre , il fit aussi lentement , dass sie , à 16 heures , ce n' est que cent mètres dans le hori- zontale avaient pu , maintenant , il commence à neiger encore , donc ... retour au camp 4 ! tout ce qui leur encore de cordes , était resté , fut pour la descente dans la paroi . deux jours , ils durent attendre maintenant dans la tente . le soir du 10 juillet , le ciel s' éclaircit , et le 11 juillet , le matin , ils commencèrent à l' attaque . grâce aux cordes ging es jusqu' à la brèche de l' arête très flott , mais quand ils nouvelles traces , ils durent enfoncions jusqu' au milieu des cuisses un . des tours sperrten verticale , le chemin . à gauche , des dalles , à droite , la neige et corniches au-dessus de la younghusband-gletscher . a 16 heures , ils étaient au pied de la troisième et dernière grande tour , et derrière lui parut - il semble à portée de main , le sommet , mais , en vérité , ils n' avaient pas encore de la 6900-m-linie traversé . il était temps , une place de bivouac , deux étroites banquettes , où il . la vue du k2 par le broad peak , les gasherbrums et hidden peak , jusqu' à l' arrogant masherbrum , mais il fut , en passant nuit . le 12 juillet - c' est dans un ciel où rampent des , il faut se hâter . mais derrière le grand gendarme , la neige mou , aucun de toute la cordée a relais sûr , la trace devient un fossé profond , l' homme à la pointe se furette 30 , ou tout au plus de 40 mètres de montée , puis , sans dire un mot , et , à côté de nous , le lendemain pour faire place à . enfin , à 13 heures ... le sommet , si étroit qu' on peut à peine , et , après quelques instants croisements , la descente , car , depuis une demi-heure , il a déjà ! la descente est une course contre la nuit , mais en vain : quand ils sont dans la brèche , il est déjà complètement nuit . ils se un rappel de 50 m pour atteindre les cordes fixes . a tâtons , sous des rafales de neige épaisse , ils se travaux . ils sont maintenant sous la rimaye , le dr florence . enfin , . . . le camp 4 ! lorsque , le 19 juillet sur les baltoro-gletscher , ils furent par le dr patey , le médecin de l' expédition anglaise , salue , le l' aide de son collègue français , à la manière de hartog demanda . les gelures aux pieds du chef de l' expédition britannique les anglais attendaient depuis quelques jours à urdokas . de cette magnifique emplacement , déjà pour autant de baltoro-unternehmungen a joué un grand rôle , maintenant assis , les membres des deux « konkurrenz»-expeditionen dans toute l' amitié à un festlichen repas et s' etaient du double succès obtenu sur l' un des plus beaux et des plus difficiles himalaya-berge . références : guido magnone : la tour de mustagh . « la montagne » , octobre 1956 , p. 261-270 . ) 18. dans mon livre baltoro ( 1939 , j' avais une tentative du gasherbrum ii ( 8035 m ) chaudement recommandé . dans le « der dritte pol » ( 1952 ) : « le gasherbrum ii n' est pas facile , mais probablement possible et relativement sûr . je n' aurais sur l' expédition internationale de 1934 avait eu de bons porteurs d' altitude ; puis j' aurais sérieusement . » le prenait la österreichische himalaya-gesellschaft » à vienne à cœur et en 1956 , une baltoro-expedition avec ce but . l' équipe de six alpinistes et deux deux : fritz sepp larch , hans ratay ( photographe ) , richard reìnagl , heinrich roiss et hans willenpart .comme médecin le dr georg weiler , le dr erich traugott gattinger comme géologue . sur la base des expériences faites dans un camp d' entraînement , on choisit reform-ernährung , ce qui le poids des bagages . la prise dans le pakistan était très simples , mais malgré tous de solidarité des autorités , les autrichiens durent attendre neuf jours à rawalpindi , jusqu' à ce que le temps de leur vol avec le ge^ leurs bagages de skardu gestattete ; car ce paysage unique vol juste au nanga parbat et par l' étroite industal est considéré comme l' une des plus dangereux luftrouten überhaupt et ne peut qu' à une proprete vue hasardeuse . c' est pourquoi skardu , la capitale du baltistan , ce n' est que le 27 avril . quain ali shah , les charges sur 27 kg . les tarifs des porteurs ont fortement augmenté aussi au pakistan . dans les régions habitées , reçoit un « 3 roupies ( 2 fr .70 ) par jour et de pourvoir lui-même à son entretien . au-dessus d' askole ( 3050 m ) , le salaire journalier monte à 4 roupies ( 3 fr .60 ) , et la nourriture des charges à l' expédition . de skardu à askolé les autrichiens utilisèrent 168 coulies et , de là , à cause des vivres 263 hommes . a païju , la dernière oasis avant le baltoro-gletscher , les porteurs réussirent , les souliers que le règlement . on avait 250 paires , mais malheureusement la voie normale , d. h. européenne forme . j' ai déjà souvent , signalons que pour les porteurs himalayens il faut principalement des pointures 42-44 ( que quelques numéros 41 et 45 ) , mais très larges ! le est malheureusement toujours , ce qui conduit de grands désagréments . le oberleder ( les steifkappe ) dut être aufgeschlitzt , afin que les pauvres types puissent y introduire leurs pieds ( non défigurés par des chaussures européennes , large de ! ) . bien sûr , il y eut de pieds blessés , et le médecin de l' expédition passait des heures à panser les écorchures blut- et les ampoules . à urdokas ( 4057 m ) , il y eut la grève habituelle , de l' baltoro-expedition n' a pas encore est resté , mais par le energische intervention de l' officier de liaison , bientôt de nouveau les choses en ordre . toutefois 68 charges durent sous la garde du second assistant pakistanais , l' étudiant hayat ali shah , d' abord à urdokas . le gros de la troupe monta en trois étapes à la célèbre concordia-platz concorde , dans une tempête de neige . maintenant , la plupart des « il ne tiennent plus , et la plupart abandonnèrent pour rentrer dans leur village . 68 hommes , après de longues tractations prêts , les colis du dépôt d' urdokas à concordia . entre-temps , les autrichiens , pendelten avec onze balti-hochträgern ( « balti-tiger » ) à leurs charges plus à la place , où mes « i. h. e. » ( expedition internationale ä l' hi ) 1934 leur camp de base ( camp 4 ) avait eu , donc au pied du versant sud du gasherbrum vi ( 7190 m ) , à la talecke , où la « abruzzi glacier » au baltoro proprement dit . pour les autrichiens , c' était un seul camp intermédiaire , parce qu' elle leur base oui à l' influence du « glacier sud » dans les « abruzzi-gletscher » , il fallut établissons , environ là où , en 1934 , le camp 5a ( 5250 m ) , la i.h.e , sur la moraine , avait posé . le 25 mai , les premiers grimpeurs et porteurs là un . après une akklimatisierungsperiode seulement , un chemin à travers les très zerrissenen « gasherbrum-gletscher »zum pied sud du gasherbrum ii reconnue . dans la partie supérieure de la traction de deux gratrippen par le steilwandgürtel à la grande terrasse du gasherbrum ii . j' avais l' éperon se rocheuse , à droite , en recommandé , parce qu' il est tout à fait à l' abri des avalanches . les autrichiens cependant se décidèrent pour l' éperon sudouest probablement un peu plus facile , et à son pied , à environ 6000 m de leur camp i. , le 11 juin , les premières charges hingeschafft , le 13 , 15 et 17 juin était le pendelverkehr en pleine mue . puis , retint , avec de fortes chutes de neige , les alpinistes au camp de base . ce n' est que le 30 juin , ils purent de nouveau au camp i et constatèrent , à leur extrême consternation que , entre-temps , une énorme avalanche presque tous les matériel déposé là . ils avaient le place pour cru : ebener glacier - et les pentes darüber étaient en terrasses . mais la grande himalaya-lawinen courir eben de vastes étendues même sur un terrain plat . il suffit de rappeler ici la catastrophe de 1937 au nanga parbat , les 16 morts . cette fois , il avait heureusement - car le camp n' était occupé -keine coûté tant de personnes , mais une grande partie des principaux d' équipement et de vivres , lag cinq à dix mètres de profondeur , sous une avalanche . deux jours durant , tranchées et des puits ausgehoben , pour un peu moins par les unersetzlichen tentes , de cordes , de la « ferraille » , vivres , etc. montagnes , mais toutes les peines , c' est en vain . que faire ? si l' on ne voulait pas s' avouer battu , on dut tout le programme et accepter les risques d' une campagne-éclair : ratay et roiss , le 2 juillet la tranche entre le camp i ( 6000 m ) et le camp ii ( 6700 m ) , et beaucoup stufenarbeit praticable à était et de cordes fixes . le 3 juillet , larch et reìnagl vers le camp ii et le 4 juillet une trace de la haute montagne , jusqu' à une épaule , la place pour le camp iii ( 7150 m ) . cette ascension était pour les quatre porteurs d' altitude , les le 6 juillet supplémentaires furent ici , une rude travail , mais les balti-tiger se tenaient très courageuse et - transportées par leurs sahibs bien assuré - leurs lourdes charges jusqu' à l' épaule . mais ils étaient alors très abattus . la pente suivante , très raide et avait une édition de neige poudreuse . ici aussi , pour utiliser les porteurs , si la pente dans vieltägiger soigneusement rangée de travail , et , en revanche , pas le temps . les grimpeurs durent donc ici , de leurs charges nous-mêmes porter , ce qui fut à l' origine , la suppression du camp iv à renoncer et d' un bivouac élevé à l' assaut de la voiture . le 6 juillet , tandis que reinagl assurait la descente des porteurs , morawec , chef de l' expédition , larch et willenpart avec de lourdes , entamaient la montée . la couche de neige sur la glace rendait tout assurage illusoire ; c' est pourquoi ils passèrent seilfrei , pour se gêner réciproquement . a 20 h. 30 ils étaient à 7500 m environ , au pied de la pyramide sommitale et se installâmes sous un bloc de rocher pour la nuit . chacun se glissa dans son dralon-schlafsack facile ; ils disposaient en outre d' un . ce fut une nuit froide féroce , si bien qu' il trop léger de gelures , larch , sur les orteils , morawec au mains . enfin , il fut clair . du lait chaud et un peu de weizenkeimbrot mussten que de vivres pour toute la journée . une traversée en écharpe sous la paroi sud-est du gasherbrum ii beaucoup de peine . ce n' est que peu avant 9 heures quand ils atteignirent une petite brèche ( 7700 m environ . c' est la chaîne entre le baltoro et le shaksgam , et la ligne de partage des eaux entre l' indus et le tarim , l' océan indien et les de l' asie centrale . encore 335 m jusqu' au sommet . dans la paroi de glace très raide , la neige était par les rayons du soleil matinal , déjà ramolli la trace un terrible strapaze . tous les quelques pas , ils durent se reposer , et après l' air de lutte . inferieurs , ils luttaient s' , mètre par mètre . le dernier obstacle fut un ressaut rocheux et - le 7 juillet , à 13 h. 30 , ils foulèrent le sommet du gasherbrum ii ( 8035 m ) , un petit une , le de deux à peine mannshohen est couronné de pointes . ils s' affalèrent épuisés dans la neige . ce n' est qu' après un certain temps , ils furent en les rites obligés du culte des sommets : piolet avec le österreichischen et le pakistanais , des banderoles , la construction d' un steinmanns , ersteigungsdaten dans une cartouche de vides , muttergottes-medaillon , etc. c' était si chaud , qu' ils purent même l' anorak ôter et , une heure au sommet . le temps était radieux beau , la vue claire jusque dans le lointain . la descente s' est déroulée lisse , et bien qu' il se mit à neiger de nouveau le soir , ils étaient a 19.30 h. dans le camp iii ( 7150 m ) . le jour suivant , au camp ii , ils furent par le porteur salue avec enthousiasme et de la tempete . il est très réjouissant , dass es maintenant - sauf le fameux sherpas et de la partie raison bons hunzas - aussi sous les baltis , les hommes se développer authentique alpinistes et « krischauff à une promesse . le gasherbrum ii est le troisième huit mille , les autrichiens inscrivent à leur tableau : massif du nanga parbat , cho oyu , gasherbrum . cette bewunderungswürdige succès console la österreichische himalaya-gesellschaft » à vienne on espère qu' un peu au-dessus d' une amère déception : douze jours après l' escalade du gasherbrum n , donc le 19 juillet 1956 , trois membres de la « expédition autrichienne himalaya-karakorum 1956 » - hans ratay , heinrich roiss et le dr georg weiler - la deuxième ascension du sia-kangri-westgipfels ( ca.7315 m ) . la première ascension fut le 3 août 1934 quatre membres de la « internationale himalaya-expedition 1934 » ont réussi à - hans erti , albert höcht , mme hettie dyhrenfurth et g.o.dyhrenfurth . c' était la connaissances , en deux livres ( voir en bas ) et dans la littérature alpine , souvent besprochene course sur la un « record féminin d' altitude » . je nos nachfolgern - après 22 ans - volontiers leur succès nous féliciter cordialement , mais ... ils ont malheureusement cru , la première ascension d' un encore tout à fait inconnu et de 7729 m de la montagne , ils ont ce sommet « austria-peak » et dans la « österreichischen touristenzeitung » de janvier 1957 aussi toutes sortes d' erreurs , sinon publiées , dont sachliche rectification inévitable est : ( 1 ) comme est la cote exactement les traînées qui troublaient échange de 7729 m ? par une ( d' ailleurs pas tout à fait korrekte ) umrechnung de 25 350 pieds . la cote , les depuis 1917 sur tous les karakorum-karten steht , mais est 24 350 ft . = 7422 m , et c' est justement la cote chiffre officiel du « queen mary peak » qui , depuis 1938 officiellement sia kangri . ( 2 ) la cote 7422 m sur les trigonométriquement par le topographe c. grant peterkin ( expédition bullock-workman 1912 ) et se probablement sur le sommet principal du rapporte . les « expédition internationale de 1934 » a pour tous les quatre . le sommet ouest est bien 100 m plus bas que le sommet principal , soit 7315 m. c' est le point culminant , que les autrichiens ont atteint lors de leur deuxième ascension . ( 3 ) une depuis des décennies , se bestiegener et de la « karakoram conference » officiellement sia kangri benannter montagne , naturellement , ne doit pas sans raison umgetauft soudain . le nom de « austria-peak » est donc de nouveau tout d' assu sec - même si staatspräsident iskander mirza , à raison de ces conditions tout irriger fêtait genehmigt a ( 4 ) la large selle entre le baltoro kangri ( auparavant « golden throne » , 7312 m ) et le sia kangri est le depuis une demi-heure de siècle bien conway saddle ( 6300 m ) , le de l' expédition composée italien ( duc de spoleto , le professeur desio ) 1929 visité à plusieurs reprises et ont été mesurés , c' est la « expédition internationale de 1934 » avait en conway-sattel même pendant leur oberes camp , et elle a oui , de là , tous les sommets du sia kangri et l' arête sud-est du baltoro kangri . c' est vraiment cela me rappelle quelque chose , si maintenant de 1956 , trois touristes qui , de tout le n' a aucune idée de descendre , comme première , ce col foulé zu haben . au surplus , naturellement , est le ! d' ailleurs , c' est le conway-sattel pas entre le baltoro et le siachen , mais entre le baltoro et kondus-gletscher . c' est le fleuve de glace , sur les on par le col . la siachen-gletscher est situé plus à l' est , comme il est . nouvelle est seulement que les autrichiens pas les de la « expédition internationale de 1934 » répété répétée et relativement sûre « mittelrippe » utilisée haben , mais probablement à gauche de notre route à travers la paroi abrupte et sur plusieurs de la haute montagne sommes montés , donc une nouvelle , dangereuse variante sur les sia-kangri-westgipfel ont fait . bei aller reconnaissance de cette performance reste complète de la valeur de l' ignorance de littérature correspondante . références : g.o.dyhrenfurth : démon de l' himalaya » ( bâle : benno schwabe , basel 1935 ) . - g.o.dyhrenfurth : baltoro ( ibidem 1939 ) . - heinrich roiss : - première ascension des austria peak m ) 7729 m. oesterr. touristenzeitung , 70. année , folge 1 , vienne , dans jänner 1957 ) . 19. le rakaposhi ( = « drachenschwanz » ) ( 7788 m ) , situé non loin de gilgit , le un aérodrome a de bonnes verkehrslage , c' est tout ce que la splendide montagne à la limite du hunzalandes déjà attaqué fut si souvent , qu' aucun autre 7000 m , mais toujours jusqu' en vain . en 1956 , une expédition anglo-américaine sous la conduite du capt . m.e.b.banks de nouveau , mais seulement jusqu' à environ 7000 m. le rakaposhi n' est pas facile , et le temps semble tout particulièrement mauvais . 20. le mustagh ata ( = « père » ) ( 7433 m ) est une coupole en chinoise du pamir . après les stériles tentatives de sven hedin - qui n' était - en 1894 , on hess de ces facile « 7000 » fut laissé longtemps en repos . ce n' est qu' en 1947 , se tournèrent vers e.e.shipton et h. w.tilman sur la gipfel-kalotte , mais pas jusqu' au , encore très éloigné horizontalement -höchsten point . le , le 26 juillet 1956 par une grande expédition sino-soviétique sous la direction de m.beletski .cinq camps furent installés , le dernier à 7200 m. 21. au nord du mustagh ata , aussi , le ostrande du pamir , se trouve le kongur debe ( 7681 m ) , de loin et large de la plus haute montagne qui , fortement massif aires de himalaya-charakter , se prolonge beaucoup plus difficile que son débonnaire voisin . le 19 août 1956 , il fut de six russes et deux chinois , les moyens techniques de l' alpinisme moderne - aussi à l' oxygène . pas encore de récit circonstancié . 22. nous les domaines de l' himalaya et du karakorum avons déjà quitté , de toute façon , nous jetons encore un coup d' oeil sur les plus hautes montagnes de l' urss : pic de pics lénine ( autrefois pic kaufmann ) , 7134 m , première ascension en 1928 par e. schneider et k.wien ;souvent visités depuis par les alpinistes soviétiques . khan tengri ( prince des esprits ) , 6995 m , d' après la , faites donc un sept mille , de plus en tien-schan ( montscélestes ) . première ascension 1931 par m.t.pogre-bezki , f. sauberer et b.tjurin depuis , si en 1936 par le bâlois lorenz saladin . pik stalin ( ancien garmo ) , 7495 m , dans l' alaï pamir . première ascension en 1933 par e. m. abalakow . abalakow depuis visiteurs . souvent visité depuis .pik korzhenewskaya , 7105 m , dans l' alaï pamir , à 15 km du pik stalin , a été gravi qu' en 1953 . le point culminant du tien-schan et apparemment la deuxième montagne de l' urss est pik pobjeda ( ) , 7439 m , découvert et mesuré en 1943 seulement . cette pour nous occidentaux quelque peu mystérieuse , est encore intacte ; les premières grand' n' ont jusqu' à une altitude de 7000 m. environ . références : ? , . bibliographie : mountaineeringintheü.s.s.r.«the alpine journal , n° 293 ( nov . en 1956 , p. 310-329 ) . considérons encore une fois la liste et l' état actuel des « 8000 » . ont été gravis jusqu' à ce jour : 1. 1950 : l' annapurna i , 8078 m. chef d' expédition m.herzog ;équipe du sommet m.herzog et l.lachenal . 2. 1953 : mount everest , 8848 m , chef j. hunt ;équipe du sommet e. p. hillary et tensing norkay . 3. nanga parbat , 8125 m. chef k.herrligkoffer ;h.buhl a atteint le sommet en solitaire . 4. 1954 : k2 , 8611 m , chef a. desio ;équipe du sommet a.compagnoni et l.lacedelli . 5. cho oyu , 8189 m ( ? ) , chef h.tichy , un sommet h.tichy , s.jöchler et pasang dawa lama . 6. 1955 : makalu , 8481 m. chef j. franco , cordées du sommet l.terray-j.couzy , j.franco- g. magnone-gyalzen norbu , j.bouvier-s.coupé-p.leroux-a . vialatte . 7. kangchenjunga , environ 8597 m. chef ch . evans , g. band-j cordées du sommet . brown , n. hardie-t . streather . 8. 1956 : le lhotse , environ 8510 m. chef a.eggler ;équipe du sommet e. reiss-f . luchsinger , ensuite le mont everest , j. marmet-e cordées du sommet . schmied , h.von gunten-a . reist . 9. manaslu , 8125 m. chef y. maki , cordées du sommet imanishi-gyalzen , kato-higeta . 10. gasherbrum ii , 8035 m. chef f.morawec ;équipe du sommet h. larch-f . « da waren's encore quatre » de huit mille encore vierges , c' est le dhaulagiri ( 8222 m ) , dans le népal , shisha pangma ou gosainthan ( 8013 m ) , dans le tibet , hidden peak ( 8068 m ) et broadpeak ( 8047 m ) dans le karakorum pakistanais ( baltoro-gebiet ) . shisha pangma se dresse derrière le « outre « rideau de fer » , et elle doit donc encore quelques temps de rester vierge , mais sur les trois autres a depuis longtemps déjà , un énorme assaut dans le domaine de la politique - c' est pour obtenir une autorisation pour 1957 , schlimmstenfalls pour 1958 . « je de cœur , que cette « marché des huit mille » baldigst terminée sein möge , damit nationale et persönlicher ambition abklingen peu à peu , pour le bien-être authentique bergsteigertums et calme de travail scientifique ! « un politique - vilaine chanson ! - fi donc ! une chanson politique ! » les nouvelles prescriptions du gouvernement népalais pour les expéditions étrangères - de kathmandou - scrupuleusement traduites , disent ceci : 1. les expéditions ont un officier de liaison népalais , qui leur sera attribué par le gouvernement du népal . 2. l' officier de l' expédition payera roupies ( = 180 francs suisses ) . en outre , il est assurera et avec nos sacs de couchage et de tous les autres tout l' équipe pendant la expeditionsdauer . 3. l' expédition a tous les frais de voyage de l' officier de liaison , à partir de kathmandou et . 4. l' expédition a leur activité exclusivement sur la montagne ou à la région , pour les ils l' autorisation par le gouvernement du népal . 5. le gouvernement népalais peut en retirer , si elle se croit que le comportement ou de l' activité de l' expédition sont indésirables . 6. a son retour , l' expédition le gouvernement du népal un rapport exact sur son activité . 7. l' expédition a un plan précis , à unterbreiten qui , à l' intérieur de la voie du népal , doit être parcourue . ces elle s' en tiendra strictement , lors de la marche d' approche et de tenir . 8 expéditions d' emporter des appareils de transmission , armes , munitions , il est interdit , que le gouvernement du népal pour but une des . 9. l' expédition doit , ce qui ne rien faire ou permettre aux sentiments religieux et les mœurs et usages des populations autochtones pourrait blesser . 10. en cas d' accident , l' expédition au blessé ou de la famille du défunt une indemnité proportionnelle aux circonstances comme les conditions sont . les isotopes d' une lebensversicherung est en préparation . entre-temps , diene que norm que , pour un officier de 5000.- , pour un porteur roupies népalaises . 11. tout ce qui , au cours de l' expédition fut recueilli , est le gouvernement du népal , doit avant que l' expédition soit autorisée à quitter le pays . copies de toutes les photographies prises au cours de l' expédition doivent être soumises au gouvernement , avant que quelque chose ne soit . 12. autorisation pour une expédition au gouvernement , une abgabe de 500 à 3000 roupies indiennes ( soit jusqu' à 2700 francs suisses ) . 13 les nouvelles sur l' activité de l' expédition ( par exemple succès , échecs , accidents , etc. ) ne peuvent bénéficier du copyright . seuls sont libres les renseignements personnels . tout est le gouvernement du népal , doit quelque part , avant qu' il ne soit . 14. toutes les demandes d' autorisation pour une expédition dans l' himalaya népalais sont , par le gouvernement du antragstellers confirmer et le gouvernement du népal . ces nouvelles prescriptions sont déjà en vigueur . il fut même annoncé qu' une zone de 50 milles ( 76 km ) , le long de la frontière tibéto-népalaise , sur le versant népalais devait être fermée . cette « zone interdite » inclurait presque le népalaises et pratiquement chaque du népal ausgehende himalaya-expedition sinnlos machen . cette nouvelle alarmierende n' est pourtant pas encore confirmée et probablement pas très zutreffend , car le gouvernement du népal est à la « fremden-industrie » , ce qui nous intéresse et ne sait très exactement que chaque himalaya-expedition une masse de l' argent et sachwerte dans le pays . toujours est-il que les nouvelles conditions , qui ont été attestées à plusieurs reprises , très dures . les articles 11 et 13 articles se révèle être un lourd sabot . le chef de l' expédition , peut-être pleinement responsables des milliers de vu de photographies ( schwarzweiss et en couleurs ) et de nombreux filmrollen ( illustration et de ton ) , de kathmandu , et plus par les autorités , zensurieren jusqu' à sa ausreise du népal gnädigst l' ? il n' est pas jedermanns sache , irréalisable en fait à signer . « corde trop tendue casse . » après la première ascension du dhaulagiri , du dernier achttausenders népalais , le karakorum fortement dans le dos , et le gouvernement de rotchinesischen - et aussi par des indiens sei - n' a pas si bien expédition dans les dernières années , de compréhension et de solidarité . ================================================ FILE: tests/inputs/issues/183/file.fth ================================================ \ https://github.com/philburk/pforth/fth/file.fth \ READ-LINE and WRITE-LINE \ \ This code is part of pForth. \ \ The pForth software code is dedicated to the public domain, \ and any third party may reproduce, distribute and modify \ the pForth software code or any derivative works thereof \ without any compensation or license. The pForth software \ code is provided on an "as is" basis without any warranty \ of any kind, including, without limitation, the implied \ warranties of merchantability and fitness for a particular \ purpose and their equivalents under the laws of any jurisdiction. private{ 10 constant \N 13 constant \R \ Unread one char from file FILEID. : UNREAD { fileid -- ior } fileid file-position ( ud ior ) ?dup IF nip nip \ IO error ELSE 1 s>d d- fileid reposition-file THEN ; \ Read the next available char from file FILEID and if it is a \n then \ skip it; otherwise unread it. IOR is non-zero if an error occured. \ C-ADDR is a buffer that can hold at least one char. : SKIP-\N { c-addr fileid -- ior } c-addr 1 fileid read-file ( u ior ) ?dup IF \ Read error? nip ELSE ( u ) 0= IF \ End of file? 0 ELSE c-addr c@ \n = ( is-it-a-\n? ) IF 0 ELSE fileid unread THEN THEN THEN ; \ This is just s\" \n" but s\" isn't yet available. create (LINE-TERMINATOR) \n c, : LINE-TERMINATOR ( -- c-addr u ) (line-terminator) 1 ; \ Standard throw code \ See: http://lars.nocrew.org/forth2012/exception.html#table:throw -72 constant THROW_RENAME_FILE \ Copy the string C-ADDR/U1 to C-ADDR2 and append a NUL. : PLACE-CSTR ( c-addr1 u1 c-addr2 -- ) 2dup 2>r ( c-addr1 u1 c-addr2 ) ( r: u1 c-addr2 ) swap cmove ( ) ( r: u1 c-addr2 ) 0 2r> + c! ( ) ; : MULTI-LINE-COMMENT ( "comment" -- ) BEGIN >in @ ')' parse ( >in c-addr len ) nip + >in @ = ( delimiter-not-found? ) WHILE ( ) refill 0= IF EXIT THEN ( ) REPEAT ; }private \ This treats \n, \r\n, and \r as line terminator. Reading is done \ one char at a time with READ-FILE hence READ-FILE should probably do \ some form of buffering for good efficiency. : READ-LINE ( c-addr u1 fileid -- u2 flag ior ) { a u f } u 0 ?DO a i chars + 1 f read-file ( u ior' ) ?dup IF nip i false rot UNLOOP EXIT THEN \ Read error? ( u ) 0= IF i i 0<> 0 UNLOOP EXIT THEN \ End of file? ( ) a i chars + c@ CASE \n OF i true 0 UNLOOP EXIT ENDOF \r OF \ Detect \r\n a i chars + f skip-\n ( ior ) ?dup IF i false rot UNLOOP EXIT THEN \ IO Error? ( ) i true 0 UNLOOP EXIT ENDOF ENDCASE LOOP \ Line doesn't fit in buffer u true 0 ; : WRITE-LINE ( c-addr u fileid -- ior ) { f } f write-file ( ior ) ?dup IF \ IO error ELSE line-terminator f write-file THEN ; : RENAME-FILE ( c-addr1 u1 c-addr2 u2 -- ior ) { a1 u1 a2 u2 | new } \ Convert the file-names to C-strings by copying them after HERE. a1 u1 here place-cstr here u1 1+ chars + to new a2 u2 new place-cstr here new (rename-file) 0= IF 0 ELSE throw_rename_file THEN ; \ A limit used to perform a sanity check on the size argument for \ RESIZE-FILE. 2variable RESIZE-FILE-LIMIT 10000000 0 resize-file-limit 2! \ 10MB is somewhat arbitrarily chosen : RESIZE-FILE ( ud fileid -- ior ) -rot 2dup resize-file-limit 2@ d> ( fileid ud big? ) IF ." Argument (" 0 d.r ." ) is larger then RESIZE-FILE-LIMIT." cr ." (You can increase RESIZE-FILE-LIMIT with 2!)" cr abort ELSE rot (resize-file) THEN ; : ( ( "comment" -- ) source-id CASE -1 OF postpone ( ENDOF 0 OF postpone ( ENDOF \ for input from files multi-line-comment ENDCASE ; immediate \ We basically try to open the file in read-only mode. That seems to \ be the best that we can do with ANSI C. If we ever want to do \ something more sophisticated, like calling access(2), we must create \ a proper primitive. (OTOH, portable programs can't assume much \ about FILE-STATUS and non-portable programs could create a custom \ function for access(2).) : FILE-STATUS ( c-addr u -- 0 ior ) r/o bin open-file ( fileid ior1 ) ?dup IF nip 0 swap ( 0 ior1 ) ELSE close-file 0 swap ( 0 ior2 ) THEN ; privatize ================================================ FILE: tests/inputs/issues/245/complex_regular_subexpression.scala ================================================ portion of finagle-base-http/src/test/scala/com/twitter/finagle/http/codec/HttpDtabTest.scala from finagle-finagle-17.11.0.tar.gz used to trigger Complex regular subexpression recursion limit (32766) exceeded package com.twitter.finagle.http.codec import com.google.common.io.BaseEncoding import com.twitter.finagle.http.{Message, Method, Request, Version} import com.twitter.finagle.{Dentry, Dtab, Failure, NameTree} import java.nio.charset.Charset import org.scalatest.FunSuite import org.scalatest.junit.AssertionsForJUnit class HttpDtabTest extends FunSuite with AssertionsForJUnit { val okDests = Vector("/$/inet/10.0.0.1/9000", "/foo/bar", "/") val okPrefixes = Vector("/foo", "/", "/foo/*/bar") val okDentries = for { prefix <- okPrefixes dest <- okDests } yield Dentry(Dentry.Prefix.read(prefix), NameTree.read(dest)) val Utf8 = Charset.forName("UTF-8") val Base64 = BaseEncoding.base64() private def b64Encode(v: String): String = Base64.encode(v.getBytes(Utf8)) val okDtabs = Dtab.empty +: (okDentries.permutations map (ds => Dtab(ds))).toIndexedSeq def newMsg(): Message = Request(Version.Http11, Method.Get, "/") // test("write(dtab, msg); read(msg) == dtab") { // for (dtab <- okDtabs) { // val m = newMsg() // HttpDtab.write(dtab, m) // val dtab1 = HttpDtab.read(m).get() // assert(Equiv[Dtab].equiv(dtab, dtab1)) // } // } } ================================================ FILE: tests/inputs/issues/280/L/hello_1.c ================================================ /* Hello World in C, Ansi-style */ #include #include int main(void) { puts("Hello World!"); } ================================================ FILE: tests/inputs/issues/280/R/hello_2.c ================================================ /* Hello World in C, Ansi-style */ /* from http://www.roesler-ac.de/wolfram/hello.htm */ #include #include int main(void) { puts("Hello World!"); return EXIT_SUCCESS; } ================================================ FILE: tests/inputs/issues/286/project/ignore_subdir/test.py ================================================ print "hello" ================================================ FILE: tests/inputs/issues/286/project/read_subdir/hi.c ================================================ /* */ int main() { int x = 1; return 0; } ================================================ FILE: tests/inputs/issues/296/Lanczos.m ================================================ function [phiKM, AscendingLambda] = Lanczos(K, M, sigma, Jmax) [rows,cols] = size(K); if (rows ~= cols) fprintf('Lanczos needs square matrices'); end Z = K - sigma*M; % initialize some Q = zeros(rows,Jmax+1); % variables T = zeros(Jmax,Jmax); % rRand = randn(rows,1); % rOld = rRand; betaOld = sqrt(rOld'*M*rOld); % for j = 1:Jmax, % Q(:,j+1) = rOld/betaOld; % u = Z \ (M*Q(:,j+1) - Z*Q(:,j)*betaOld); % D.S.Scott's formulation alpha = Q(:,j+1)'*M*u; % of the recurrence r = u - alpha*Q(:,j+1); % for i=1:3, % sum = zeros(rows,1); % repeat a full orhto- for k=2:j+1, % gonalization three sum = sum + (Q(:,k)'*M*r)*Q(:,k); % times to ensure end; % high quality r = r - sum; % solutions end; % beta = sqrt(r'*M*r); % T(j,j) = alpha; % if (j ~= Jmax) % augment [T] with new T(j+1,j) = beta; % alpha_i, beta_i+1 T(j,j+1) = beta; % end; % Jactual = j; % if (abs(beta) < 1.0e-12) % singular beta; going break % any more will introduce end % spurious modes betaOld = beta; % rOld = r; % end % [phiT,lambdaT] = eig(T(1:Jactual,1:Jactual)); % solve [T]{y} = L{y} lambdaKM = zeros(Jactual,1); % for j = 1:Jactual, % invert and shift the lambdaKM(j) = sigma + 1/lambdaT(j,j); % eigenvalues to the end % user's domain [AscendingLambda, ordering] = sort(lambdaKM); % phiKM = zeros(rows,Jactual); % sort the eigenvalues UnOrdphiKM = zeros(rows,Jactual); % in ascending order UnOrdphiKM = Q(:,2:Jactual+1)*phiT; % for j = 1:Jactual, % resequence the e-vectors phiKM(:,j) = UnOrdphiKM(:,ordering(j)); % to correspond to the end % e-values ================================================ FILE: tests/inputs/issues/296/Mathematica_1.m ================================================ (* http://spot.colorado.edu/~sitelic/samplecode/mathematica/imagesfile.html *) image = Import["denise.png","PNG"] (* or *) image = Import["denise.gif","GIF"] A = image[[1,1]]/255.; ListDensityPlot[A,Mesh->False, AspectRatio->Automatic] (* -- or -- *) Show[Graphics[Raster[A]], AspectRatio->Automatic] blurA = ListConvolve[Table[1/25,{5},{5}],A]; Show[Graphics[Raster[blurA]], AspectRatio->Automatic] B = Fourier[A]; (* delete higher frequencies *) B[[Range[30,278],All]]=0; B[[All,Range[30,202]]]=0; Show[Graphics[Raster[ Re[InverseFourier[B]] ]], AspectRatio->Automatic] ================================================ FILE: tests/inputs/issues/296/Octave.m ================================================ % from http://www.roesler-ac.de/wolfram/hello.htm #Hello World in Octave (http://www.octave.org/) printf("Hello World\n"); ================================================ FILE: tests/inputs/issues/296/hello.lua ================================================ -- single line comment --[[ multi line comment ]] --[[ also a comment --]] print("hello, world") print([[not a comment]]) ================================================ FILE: tests/inputs/issues/296/nested.lua ================================================ -- single line comment issue #371 --[[ multi line comment ]] --[[ also a comment --]] print("hello, world") print([[not a comment]]) --[===[ multi line comment --[==[ still comment --[=[ still comment --[[ still comment --]] --]=] --]==] --]===] ================================================ FILE: tests/inputs/issues/296/qsort_demo.m ================================================ #include #include /* Al Danial April 25 2000 */ #define ELEMENTS 1000 static int compar_string(const void *a, const void *b){ return (strcmp( (char *)a, (char *)b)); } int comp(const void *a, const void *b ) { return *(int *)a - * (int *)b; } main(){ int x, i; char *string; struct sort_test_t { int s; } ; struct sort_test_t sort_test[ELEMENTS]; /* inititalize the array */ for (i=0;i