2 | #import "Dependency.h"
3 |
4 | @protocol WorldDataSource
5 | @optional
6 | - (NSString*)worldName;
7 | @required
8 | - (BOOL)allowsToLive;
9 | @end
10 |
11 | @property (nonatomic, readonly) NSString *title;
12 | - (IBAction) show;
13 | @end
14 |
--------------------------------------------------------------------------------
/test/markup/handlebars/block-with-param.expect.txt:
--------------------------------------------------------------------------------
1 | {{#blockHelper param1 param2}}block content{{/blockHelper}}
2 |
--------------------------------------------------------------------------------
/test/markup/kotlin/nested_comment.txt:
--------------------------------------------------------------------------------
1 | /* begin comment at LEVEL 0
2 | /*
3 | multiline nested comment LEVEL 1
4 | */
5 | println("on kotlin this is a commented code in comment LEVEL 0")
6 | /*
7 | another multiline nested comment LEVEL 1
8 | */
9 | end comment at LEVEL 0 */
10 |
--------------------------------------------------------------------------------
/test/markup/python-repl/sample.txt:
--------------------------------------------------------------------------------
1 | >>> v = "foo = 42"
2 | >>> v
3 | "foo = 42"
4 | >>> print(v)
5 | foo = 42
6 | >>> print(repr(v).rstrip('"'))
7 | "foo = 42
8 | >>> print(repr(v).lstrip('"'))
9 | foo = 42"
10 |
11 | >>> """
12 | ... abc
13 | ... """
14 | >>> def test():
15 | ... pass
16 | >>>
17 | >>>
18 |
--------------------------------------------------------------------------------
/test/markup/scala/symbol.expect.txt:
--------------------------------------------------------------------------------
1 | def f(s: Symbol) = {
2 | s match {
3 | case 'foo =>
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/test/markup/subunit/subunit-testline.txt:
--------------------------------------------------------------------------------
1 | test: test basicsuite1
2 | testing: test basicsuite1
3 | test test basicsuite1
4 | testing test basicsuite1
5 | test: test basic suite1
6 | testing: test basic suite1
7 | test test basic suite1
8 | testing test basic suite1
9 | testing test basic
10 | test test 222
11 |
--------------------------------------------------------------------------------
/test/markup/swift/swiftui.txt:
--------------------------------------------------------------------------------
1 | @main
2 | struct MyApp: App {
3 | var body: some Scene {
4 | WindowGroup {
5 | #if os(iOS)
6 | Text("Hello, world from iOS!")
7 | #else
8 | Text("Hello, world!")
9 | #endif
10 | }
11 | }
12 | }
13 |
--------------------------------------------------------------------------------
/test/markup/taggerscript/noop.expect.txt:
--------------------------------------------------------------------------------
1 | text
2 | text
3 | text
4 | text
7 |
--------------------------------------------------------------------------------
/test/detect/json/default.txt:
--------------------------------------------------------------------------------
1 | [
2 | {
3 | "title": "apples",
4 | "count": [12000, 20000],
5 | "description": {"text": "...", "sensitive": false}
6 | },
7 | {
8 | "title": "oranges",
9 | "count": [17500, null],
10 | "description": {"text": "...", "sensitive": false}
11 | }
12 | ]
13 |
--------------------------------------------------------------------------------
/test/markup/javascript/comments.txt:
--------------------------------------------------------------------------------
1 | f = ( // f is a recursive function taking:
2 | [c, // c = next digit character
3 | ...a], // a[] = array of remaining digits
4 | o = b, // o = output string
5 | S = s // S = set of solutions
6 | ) => {}
7 |
--------------------------------------------------------------------------------
/test/markup/ruby/regexes.expect.txt:
--------------------------------------------------------------------------------
1 | str =~ /^(?:foo)$/
2 | str =~ %r{foo|bar|buz$}
3 | str =~ %r!foo|bar$!
4 | str =~ %r[foo|bar$]
5 | str =~ %r(\(foo|bar\)$)
6 |
--------------------------------------------------------------------------------
/test/markup/scala/for-do.expect.txt:
--------------------------------------------------------------------------------
1 | def f = for x <- Nil do println("hello")
2 |
--------------------------------------------------------------------------------
/test/markup/scala/while-do.expect.txt:
--------------------------------------------------------------------------------
1 | def f = while true do println("hello")
2 |
--------------------------------------------------------------------------------
/test/markup/xquery/computed_inbuilt.txt:
--------------------------------------------------------------------------------
1 | xquery version "3.1";
2 | let $root := element {fn:node-name($e)}
3 | {$e/@*, 2 * fn:data($e)}
4 |
5 | for $node in root($root)
6 | return
7 | element root { root ($node)/text(), attribute root {'root'},
8 | element not-root{attribute type{"root"}, root($root)}
9 | }
10 |
--------------------------------------------------------------------------------
/test/detect/erb/default.txt:
--------------------------------------------------------------------------------
1 | <%# this is a comment %>
2 |
3 | <% @posts.each do |post| %>
4 | <%= link_to post.title, post %>
5 | <% end %>
6 |
7 | <%- available_things = things.select(&:available?) -%>
8 | <%%- x = 1 + 2 -%%>
9 | <%% value = 'real string #{@value}' %%>
10 | <%%= available_things.inspect %%>
11 |
--------------------------------------------------------------------------------
/test/markup/elixir/function-title.txt:
--------------------------------------------------------------------------------
1 | def f do
2 | :ok
3 | end
4 |
5 | def f(list) do
6 | :ok
7 | end
8 |
9 | def f :clear, list do
10 | :ok
11 | end
12 |
13 | def f!, do: IO.puts "hello world"
14 |
15 | defp f?, do: true
16 |
17 | defmacro foo, do: :ok
18 |
19 | defmacrop do_foo, do: :ok
20 |
21 | x = 5
22 |
--------------------------------------------------------------------------------
/test/markup/elixir/modules.txt:
--------------------------------------------------------------------------------
1 | defmodule User do
2 | defstruct [:name, :email, age: 18]
3 | end
4 |
5 | defprotocol Size do
6 | @doc "Calculates the size (and not the length!) of a data structure"
7 | def size(data)
8 | end
9 |
10 | defimpl Size, for: Map do
11 | def size(map), do: map_size(map)
12 | end
13 |
--------------------------------------------------------------------------------
/test/markup/erb/default.txt:
--------------------------------------------------------------------------------
1 | <%# this is a comment %>
2 |
3 | <% @posts.each do |post| %>
4 | <%= link_to post.title, post %>
5 | <% end %>
6 |
7 | <%- available_things = things.select(&:available?) -%>
8 | <%%- x = 1 + 2 -%%>
9 | <%% value = 'real string #{@value}' %%>
10 | <%%= available_things.inspect %%>
11 |
--------------------------------------------------------------------------------
/test/markup/handlebars/else-variants.txt:
--------------------------------------------------------------------------------
1 | {{#helper}}{{else}}else-block{{/helper}}
2 |
3 | {{#helper}}block{{else}}else-block{{/helper}}
4 |
5 | {{[else]}} in brackets is a helper, not a keyword
6 |
7 | {{#else}} as block helper name is not a keyword {{/else}}
8 |
9 | \{{else}} is not a keyword if escaped
10 |
11 |
--------------------------------------------------------------------------------
/test/markup/python/diacritic_identifiers.txt:
--------------------------------------------------------------------------------
1 | def fóö():
2 | pass
3 |
4 | def bär():
5 | pass
6 |
7 | def FOÖ():
8 | pass
9 |
10 | def ÿay():
11 | pass
12 |
13 | class fóö():
14 | pass
15 |
16 | class bär():
17 | pass
18 |
19 | class FOÖ():
20 | pass
21 |
22 | class ÿay():
23 | pass
--------------------------------------------------------------------------------
/test/markup/subunit/subunit-tagline.expect.txt:
--------------------------------------------------------------------------------
1 | tags: fuzz unit beta functional
2 | tags: -functional basic -beta
3 | tags: -unit
4 | tags: unit
5 | tags: ddd
6 |
--------------------------------------------------------------------------------
/test/markup/xml/processing.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Some green text.
6 |
7 |
--------------------------------------------------------------------------------
/test/detect/openscad/default.txt:
--------------------------------------------------------------------------------
1 | use
2 | include <../common/base.scad>
3 |
4 | //draw a foobar
5 | module foobar(){
6 | translate([0,-10,0])
7 | difference(){
8 | cube([5,10.04,15]);
9 | sphere(r=10,$fn=100);
10 | }
11 | }
12 |
13 | foobar();
14 | #cube ([5,5,5]);
15 | echo("done");
--------------------------------------------------------------------------------
/test/detect/prolog/default.txt:
--------------------------------------------------------------------------------
1 | mergesort([],[]). % special case
2 | mergesort([A],[A]).
3 | mergesort([A,B|R],S) :-
4 | split([A,B|R],L1,L2),
5 | mergesort(L1,S1),
6 | mergesort(L2,S2),
7 | merge(S1,S2,S).
8 |
9 | split([],[],[]).
10 | split([A],[A],[]).
11 | split([A,B|R],[A|Ra],[B|Rb]) :- split(R,Ra,Rb).
12 |
--------------------------------------------------------------------------------
/test/markup/elixir/strings.expect.txt:
--------------------------------------------------------------------------------
1 | a = """
2 | test
3 | """
4 | b = '''
5 | test
6 | '''
7 | c = "test"
8 | d = 'test'
9 |
--------------------------------------------------------------------------------
/test/markup/handlebars/block-expression-variants-in-helper-name.txt:
--------------------------------------------------------------------------------
1 | text {{#[ab}}c] param }}a{{/[ab}}c]}}
2 |
3 | text {{#'ab}}c' param}}a{{/'ab}}c'}}
4 |
5 | text {{#"ab}}c" param}}a{{/"ab}}c"}}
6 |
7 | text {{#"" param}}a{{/""}}
8 |
9 | text {{#'' param}}a{{/''}}
10 |
11 | text {{#[] param}}a{{/[]}}
12 |
13 | text
14 |
--------------------------------------------------------------------------------
/test/markup/openscad/default.txt:
--------------------------------------------------------------------------------
1 | use
2 | include <../common/base.scad>
3 |
4 | //draw a foobar
5 | module foobar(){
6 | translate([0,-10,0])
7 | difference(){
8 | cube([5,10.04,15]);
9 | sphere(r=10,$fn=100);
10 | }
11 | }
12 |
13 | foobar();
14 | #cube ([5,5,5]);
15 | echo("done");
--------------------------------------------------------------------------------
/test/markup/php/namespace.txt:
--------------------------------------------------------------------------------
1 | namespace Location\Web;
2 | namespace foo;
3 | use My\Full\Classname as Another;
4 | use My\Full\NSname;
5 | use ArrayObject;
6 | use function My\Full\functionName;
7 | use function My\Full\functionName as func;
8 | use const My\Full\CONSTANT;
9 | use Example\{ClassA, ClassB, ClassC as C};
10 |
--------------------------------------------------------------------------------
/test/markup/prolog/default.txt:
--------------------------------------------------------------------------------
1 | mergesort([],[]). % special case
2 | mergesort([A],[A]).
3 | mergesort([A,B|R],S) :-
4 | split([A,B|R],L1,L2),
5 | mergesort(L1,S1),
6 | mergesort(L2,S2),
7 | merge(S1,S2,S).
8 |
9 | split([],[],[]).
10 | split([A],[A],[]).
11 | split([A,B|R],[A|Ra],[B|Rb]) :- split(R,Ra,Rb).
12 |
--------------------------------------------------------------------------------
/test/markup/scala/quoted-code.expect.txt:
--------------------------------------------------------------------------------
1 | def f(using Quotes) = '{ val x = 1; ${g('x)} }
2 |
--------------------------------------------------------------------------------
/test/markup/swift/class-func-var.txt:
--------------------------------------------------------------------------------
1 | class func f1() -> Void { }
2 |
3 | class func f2() -> T { }
4 |
5 | class func f3(
6 | _ p1: Int,
7 | p2: String
8 | ) async throws -> [T] { }
9 |
10 | class var v1: Int { get set }
11 |
12 | class var v2: String {
13 | get { return "test" }
14 | set { }
15 | }
--------------------------------------------------------------------------------
/test/detect/http/default.txt:
--------------------------------------------------------------------------------
1 | POST /task?id=1 HTTP/1.1
2 | Host: example.org
3 | Content-Type: application/json; charset=utf-8
4 | Content-Length: 137
5 |
6 | {
7 | "status": "ok",
8 | "extended": true,
9 | "results": [
10 | {"value": 0, "type": "int64"},
11 | {"value": 1.0e+3, "type": "decimal"}
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/test/markup/aspectj/intertype-constructor.expect.txt:
--------------------------------------------------------------------------------
1 | public MyClass.new() throws Exception{
2 |
3 | }
4 |
--------------------------------------------------------------------------------
/test/markup/clojure/comment-macro.expect.txt:
--------------------------------------------------------------------------------
1 | (comment "comment is a macro that emits no code. It can contain clojure code in itself.")
2 | (comment-and-something "This is a valid function name")
--------------------------------------------------------------------------------
/test/markup/ebnf/quote-symbols.txt:
--------------------------------------------------------------------------------
1 | first_quote_symbol = "'" .
2 | second_quote_symbol = '"' .
3 |
4 | (* escaped_quote_symbol tests backticks, which does not interfere
5 | * with backslashes. It has precedent in some language
6 | * specifications.
7 | *)
8 | escaped_quote_symbol = `\` ( first_quote_symbol | second_quote_symbol ) .
9 |
--------------------------------------------------------------------------------
/test/markup/handlebars/literals-in-different-places.txt:
--------------------------------------------------------------------------------
1 | {{helper true false a=true b=false}}
2 |
3 | {{{helper true false}}}
4 |
5 | {{#helper true false}} {{/helper}}
6 |
7 | {{{{#helper true false}}}} {{{{/helper}}}}
8 |
9 | {{>partial true}}
10 |
11 | {{helper (helper true false)}}
12 |
13 | {{helper a=true b=false}}
14 |
--------------------------------------------------------------------------------
/test/markup/rust/strings.txt:
--------------------------------------------------------------------------------
1 | 'a';
2 | '\n';
3 | '\x1A';
4 | '\u12AS';
5 | '\U1234ASDF';
6 | '😭';
7 | b'a';
8 |
9 | "hello";
10 | b"hello";
11 |
12 | r"hello";
13 | r###"world"###;
14 | r##" "###
15 | "# "##;
16 | "😭😭😭😭";
17 |
18 | br" ";
19 | br#"hello"#;
20 | br##"foo"##;
21 |
22 | #[error("\" appears in a string")]
23 |
--------------------------------------------------------------------------------
/test/markup/sql/numeric-types.expect.txt:
--------------------------------------------------------------------------------
1 | SELECT CAST(32768 AS TINYINT) FROM VALUES('dummy');
2 |
--------------------------------------------------------------------------------
/test/markup/markdown/links.expect.txt:
--------------------------------------------------------------------------------
1 | 
2 | [](https://example.com)
3 | 
4 | [text](https://example.com)
5 |
--------------------------------------------------------------------------------
/test/markup/wren/attributes.txt:
--------------------------------------------------------------------------------
1 | #key
2 | #key = value
3 | #group(
4 | multiple,
5 | lines = true,
6 | lines = 0
7 | )
8 | class Example {
9 | #test(skip = true, iterations = 32)
10 | doStuff() {}
11 |
12 | #doc = "not runtime data"
13 | #!runtimeAccess = true
14 | #!maxIterations = 16
15 | anotherFn() {}
16 | }
17 |
--------------------------------------------------------------------------------
/test/markup/elixir/char-literal.expect.txt:
--------------------------------------------------------------------------------
1 | defguardp apostrophe?(c) when c == ?'
2 | defguardp upper?(c) when (c >= ?A and c <= ?Z)
3 |
--------------------------------------------------------------------------------
/test/detect/xml/default.txt:
--------------------------------------------------------------------------------
1 |
2 | Title
3 |
4 |
5 |
6 |
9 |
10 |
11 | Title
12 |
13 |
14 |
--------------------------------------------------------------------------------
/test/markup/haskell/char.txt:
--------------------------------------------------------------------------------
1 | -- simple string
2 | t1 = "starscout"
3 |
4 | -- simple char
5 | t2 = 'm'
6 |
7 | -- char and string
8 | t3 = 'm' : "oonbow"
9 |
10 | -- escaping
11 | t4 = '\"' : 'x' : "y"
12 | t5 = '\'' : 'x' : "y"
13 |
14 | -- should not parse as chars or strings
15 | t6 = ''
16 | t7 = 'a
17 | t8 = ''a
18 | t9 = a'
19 | t10 = a''
--------------------------------------------------------------------------------
/test/markup/http/just_headers.expect.txt:
--------------------------------------------------------------------------------
1 | Host: example.org
2 | Content-Type: application/json; charset=utf-8
3 | Content-Length: 19
4 |
--------------------------------------------------------------------------------
/test/markup/maxima/numbers.txt:
--------------------------------------------------------------------------------
1 | 0
2 | 0.
3 | 12345.
4 | 12345
5 | 0.0
6 | 123.45
7 | 0e0
8 | 0b0
9 | 12345e0
10 | 12345e123
11 | 12345e-123
12 | 12345e+123
13 | 12345b0
14 | 12345b123
15 | 12345b-123
16 | 12345b+123
17 | 1.2345e0
18 | 1.2345e123
19 | 1.2345e-123
20 | 1.2345e+123
21 | 1.2345b0
22 | 1.2345b123
23 | 1.2345b-123
24 | 1.2345b+123
25 |
--------------------------------------------------------------------------------
/test/markup/protobuf/rpc.expect.txt:
--------------------------------------------------------------------------------
1 | service Greeter {
2 |
3 | rpc SayHello (HelloRequest) returns (HelloReply) {}
4 | }
5 |
--------------------------------------------------------------------------------
/test/markup/yaml/tag.txt:
--------------------------------------------------------------------------------
1 | key: !!builtintagname test
2 | key: !localtagname test
3 | key: "!notatag"
4 | key: '!!notatageither'
5 | key: !!python/dict test
6 | key: !!python/name:module.name test
7 | key: !foo2.bar test
8 | key: !(foo.bar?):tag test
9 | key: !named!tag test
10 |
11 | --- !
12 | invoice: 34843
13 |
--------------------------------------------------------------------------------
/test/markup/subunit/subunit-timeline.expect.txt:
--------------------------------------------------------------------------------
1 | time: 2016-03-13 18:12:37.231080Z
2 | time: 1917-10-25 09:05:37.231080Z
3 | time: 1984-03-24 07:02:09.231080Z
4 |
--------------------------------------------------------------------------------
/test/detect/bash/default.txt:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | ###### CONFIG
4 | ACCEPTED_HOSTS="/root/.hag_accepted.conf"
5 | BE_VERBOSE=false
6 |
7 | if [ "$UID" -ne 0 ]
8 | then
9 | echo "Superuser rights required"
10 | exit 2
11 | fi
12 |
13 | genApacheConf(){
14 | echo -e "# Host ${HOME_DIR}$1/$2 :"
15 | }
16 |
17 | echo '"quoted"' | tr -d \" > text.txt
18 |
--------------------------------------------------------------------------------
/test/markup/kotlin/function.txt:
--------------------------------------------------------------------------------
1 | fun a() = 1
2 | fun /* b1 */ b(/*b2*/ a : Int /*b3*/) /*b4*/ = a // b5
3 |
4 |
5 | fun c() : String = "1"
6 | inline fun d() { return }
7 |
8 |
9 | fun e(
10 | a : Int, /*a*/
11 | b : String //b
12 | )
13 | {}
14 |
15 |
16 | fun handle(lambda: (IN) /* parenthesized type */ -> OUT) {}
17 |
--------------------------------------------------------------------------------
/test/detect/clojure/default.txt:
--------------------------------------------------------------------------------
1 | (def ^:dynamic chunk-size 17)
2 |
3 | (defn next-chunk [rdr]
4 | (let [buf (char-array chunk-size)
5 | s (.read rdr buf)]
6 | (when (pos? s)
7 | (java.nio.CharBuffer/wrap buf 0 s))))
8 |
9 | (defn chunk-seq [rdr]
10 | (when-let [chunk (next-chunk rdr)]
11 | (cons chunk (lazy-seq (chunk-seq rdr)))))
12 |
--------------------------------------------------------------------------------
/test/markup/coffeescript/regex.txt:
--------------------------------------------------------------------------------
1 | # Regexps
2 | x = //
3 | x = (//)
4 | x = (/test/)
5 | x = //mig
6 | x = //gim
7 | x = /something/gim
8 | x = /\//
9 | x = /\n/
10 | x = /ab\/ ab/
11 | x = f /6 * 2/ - 3
12 | x = f /foo * 2/gm
13 | x = if true then /\n/ else /[.,]+/
14 | x = ///^key-#{key}-\d+///
15 |
16 | # not a Regexp
17 | x = //test
18 | x = /boo/test
19 |
--------------------------------------------------------------------------------
/test/markup/php/comments.txt:
--------------------------------------------------------------------------------
1 | param2: # interesting
5 | print 'Gre\'ater'
6 | return (param2 - param1 + 1 + 0b10l) or None
7 |
8 | class SomeClass:
9 | pass
10 |
11 | >>> message = '''interpreter
12 | ... prompt'''
13 |
--------------------------------------------------------------------------------
/test/detect/wasm/default.txt:
--------------------------------------------------------------------------------
1 | (module
2 | (import "js" "memory" (memory 1))
3 | (import "js" "table" (table 1 funcref))
4 | (type $void_to_i32 (func (result i32)))
5 | (func (export "doIt") (result i32)
6 | i32.const 0
7 | i32.const 42
8 | i32.store ;; store 42 at address 0
9 | i32.const 0
10 | call_indirect (type $void_to_i32))
11 | )
12 |
--------------------------------------------------------------------------------
/test/markup/applescript/default.txt:
--------------------------------------------------------------------------------
1 | repeat 5 times
2 | if foo is greater than bar then
3 | display dialog "Hello there"
4 | else
5 | beep
6 | end if
7 | end repeat
8 |
9 | (* comment (*nested comment*) *)
10 | on do_something(s, y)
11 | return {s + pi, y mod 4}
12 | end do_something
13 |
14 | do shell script "/bin/echo 'hello'"
15 |
--------------------------------------------------------------------------------
/test/markup/coffeescript/function.txt:
--------------------------------------------------------------------------------
1 | returnNull = -> null
2 | returnTrue = () -> true
3 | square = (x) -> x * x
4 |
5 | npmWishlist.sha256 = (str) ->
6 | throw new Error()
7 |
8 | str.split(" ").map((m) -> m.charCodeAt(0))
9 |
10 | fs.readFile("package.json", "utf-8", (err, content) ->
11 | data = JSON.parse(content)
12 |
13 | data.version
14 | )
15 |
--------------------------------------------------------------------------------
/test/markup/handlebars/comments.expect.txt:
--------------------------------------------------------------------------------
1 | {{expression}}
2 |
3 |
4 |
--------------------------------------------------------------------------------
/test/markup/powershell/apos-herestring.txt:
--------------------------------------------------------------------------------
1 | @' The wild cat jumped over the $height-tall fence.
2 | He did so with grace.
3 | '@
4 |
5 | This SHOULDNT be a part of the above strings span.
6 |
7 | @' The wild cat jumped over the $height-tall fence.
8 | He did so with grace.
9 | break-end-of-string'@
10 |
11 | This SHOULD be a part of the above strings span.
--------------------------------------------------------------------------------
/test/markup/powershell/quote-herestring.txt:
--------------------------------------------------------------------------------
1 | @" The wild cat jumped over the $height-tall fence.
2 | He did so with grace.
3 | "@
4 |
5 | This SHOULDNT be a part of the above strings span.
6 |
7 | @" The wild cat jumped over the $height-tall fence.
8 | He did so with grace.
9 | break-end-of-string"@
10 |
11 | This SHOULD be a part of the above strings span.
--------------------------------------------------------------------------------
/test/markup/scala/if-then-else.expect.txt:
--------------------------------------------------------------------------------
1 | def f = if true then 1 else 2
2 |
--------------------------------------------------------------------------------
/test/markup/typescript/decorator-factories.txt:
--------------------------------------------------------------------------------
1 | @foo('foo')
2 | export class MyClass {
3 | @baz(123)
4 | private myAttribute: string;
5 |
6 | constructor(@bar(true) private x,
7 | @bar(qux(quux(true))) private y) { }
8 |
9 | @bar()
10 | private myMethod(@bar() z) {
11 | console.log('Hello world.');
12 | }
13 | }
14 |
--------------------------------------------------------------------------------
/test/markup/typescript/module-id.txt:
--------------------------------------------------------------------------------
1 | @Component({
2 | selector: 'my-example',
3 | directives: [SomeDirective],
4 | templateUrl: './my-example.component.html',
5 | moduleId: module.id,
6 | styles: [`
7 | .my-example {
8 | padding: 5px;
9 | }
10 | `]
11 | })
12 | export class MyExampleComponent {
13 | someProp: string = "blah";
14 | }
15 |
--------------------------------------------------------------------------------
/test/markup/vim/strings-comments.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | let one = "string"
3 | let two = "crazy
4 | \ string with a \" quote"
5 |
--------------------------------------------------------------------------------
/test/parser/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const should = require('should');
4 |
5 | describe('hljs', function() {
6 | require('./look-ahead-end-matchers');
7 | require('./resume-scan');
8 | require('./reuse-endsWithParent');
9 | require('./should-not-destroyData');
10 | require('./compiler-extensions');
11 | require('./max_keyword_hits');
12 | });
13 |
--------------------------------------------------------------------------------
/test/detect/scilab/default.txt:
--------------------------------------------------------------------------------
1 | // A comment
2 | function I = foo(dims, varargin)
3 | d=[1; matrix(dims(1:$-1),-1,1)]
4 | for i=1:size(varargin)
5 | if varargin(i)==[] then
6 | I=[],
7 | return;
8 | end
9 | end
10 | endfunction
11 |
12 | b = cos(a) + cosh(a);
13 | bar_matrix = [ "Hello", "world" ];
14 | foo_matrix = [1, 2, 3; 4, 5, 6];
15 |
--------------------------------------------------------------------------------
/test/markup/csharp/functions.txt:
--------------------------------------------------------------------------------
1 | public void ExampleFunction1() {
2 | }
3 |
4 | public void ExampleFunction2()
5 | {
6 | }
7 |
8 | void ExampleFunctionDeclaration1();
9 |
10 | void ExampleFunctionDeclaration2()
11 | ;
12 |
13 | public string ExampleExpressionBodiedFunction1() => "dummy";
14 |
15 | public string ExampleExpressionBodiedFunction2()
16 | => "dummy";
--------------------------------------------------------------------------------
/test/markup/erlang/maybe.expect.txt:
--------------------------------------------------------------------------------
1 | maybe
2 | {ok, A} ?= a(),
3 | true = A >= 0,
4 | {ok, B} ?= b(),
5 | A + B
6 | else
7 | error -> error;
8 | wrong -> error
9 | end
10 |
--------------------------------------------------------------------------------
/test/markup/scala/extension.txt:
--------------------------------------------------------------------------------
1 | extension (x: Int) def plus(y: Int) = x + y
2 |
3 | extension [T](x: T) def f = ()
4 |
5 | extension (x: Int)
6 | def f = 1
7 | def f = 2
8 |
9 | object Foo {
10 | extension (x: Int)
11 | def f = 1
12 | def f = 2
13 | }
14 |
15 | def extension(file: File) =
16 | file.extension
17 |
18 | file
19 | .extension
20 |
--------------------------------------------------------------------------------
/test/markup/scilab/default.txt:
--------------------------------------------------------------------------------
1 | // A comment
2 | function I = foo(dims, varargin)
3 | d=[1; matrix(dims(1:$-1),-1,1)]
4 | for i=1:size(varargin)
5 | if varargin(i)==[] then
6 | I=[],
7 | return;
8 | end
9 | end
10 | endfunction
11 |
12 | b = cos(a) + cosh(a);
13 | bar_matrix = [ "Hello", "world" ];
14 | foo_matrix = [1, 2, 3; 4, 5, 6];
15 |
--------------------------------------------------------------------------------
/.eslintrc.lang.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | env: {
3 | browser: true,
4 | es6: true,
5 | node: true
6 | },
7 | parserOptions: {
8 | ecmaVersion: 2015,
9 | sourceType: "module"
10 | },
11 | // no rules, this file exists only to lint the grammars and check
12 | // that no ES2018 or newer syntax has crept in by accident
13 | rules: {}
14 | };
15 |
--------------------------------------------------------------------------------
/test/markup/python/function-header.expect.txt:
--------------------------------------------------------------------------------
1 | def f(x: int, *, y: bool = True) -> None:
2 | pass
3 |
--------------------------------------------------------------------------------
/test/markup/scala/inline.txt:
--------------------------------------------------------------------------------
1 | inline def pow(inline x: Int, inline n: Int) = ???
2 | transparent inline def f: Int = ???
3 | inline val a: Int = 9
4 | inline given Int = 9
5 |
6 | notinline given Int = 9
7 |
8 | def expressions =
9 | inline if true then () else ()
10 | inline x match ...
11 |
12 | x.inline
13 | x.inline(y)
14 | x.inline[T]
15 | `inline` + 1
16 |
--------------------------------------------------------------------------------
/test/detect/coffeescript/default.txt:
--------------------------------------------------------------------------------
1 | grade = (student, period=(if b? then 7 else 6)) ->
2 | if student.excellentWork
3 | "A+"
4 | else if student.okayStuff
5 | if student.triedHard then "B" else "B-"
6 | else
7 | "C"
8 |
9 | class Animal extends Being
10 | constructor: (@name) ->
11 |
12 | move: (meters) ->
13 | alert @name + " moved #{meters}m."
14 |
--------------------------------------------------------------------------------
/test/detect/leaf/default.txt:
--------------------------------------------------------------------------------
1 | #(variable)
2 | #extend("template"): I'm added to a base template! #endextend
3 | #import("body")
4 | #count(friends)
5 |
6 | #for(friend in friends): #(friend.name) #endfor
7 |
8 | #if(count(visit) == 1):
9 | Hello new user!
10 | #elseif(title == "Welcome back!"):
11 | Hello old user
12 | #else:
13 | Unexpected page!
14 | #endif
--------------------------------------------------------------------------------
/test/markup/csharp/scoped.expect.txt:
--------------------------------------------------------------------------------
1 | public static ref T AsRef<T>(scoped in T source);
--------------------------------------------------------------------------------
/test/markup/leaf/default.txt:
--------------------------------------------------------------------------------
1 | #(variable)
2 | #extend("template"): I'm added to a base template! #endextend
3 | #import("body")
4 | #count(friends)
5 |
6 | #for(friend in friends): #(friend.name) #endfor
7 |
8 | #if(count(visit) == 1):
9 | Hello new user!
10 | #elseif(title == "Welcome back!"):
11 | Hello old user
12 | #else:
13 | Unexpected page!
14 | #endif
--------------------------------------------------------------------------------
/test/detect/cpp/default.txt:
--------------------------------------------------------------------------------
1 | #include
2 |
3 | int main(int argc, char *argv[]) {
4 |
5 | /* An annoying "Hello World" example */
6 | for (auto i = 0; i < 0xFFFF; i++)
7 | cout << "Hello, World!" << endl;
8 |
9 | char c = '\n';
10 | unordered_map > m;
11 | m["key"] = "\\\\"; // this is an error
12 |
13 | return -2e3 + 12l;
14 | }
15 |
--------------------------------------------------------------------------------
/test/detect/profile/default.txt:
--------------------------------------------------------------------------------
1 | 261917242 function calls in 686.251 CPU seconds
2 |
3 | ncalls tottime filename:lineno(function)
4 | 152824 513.894 {method 'sort' of 'list' objects}
5 | 129590630 83.894 rrule.py:842(__cmp__)
6 | 129590630 82.439 {cmp}
7 | 153900 1.296 rrule.py:399(_iter)
8 | 304393/151570 0.963 rrule.py:102(_iter_cached)
9 |
--------------------------------------------------------------------------------
/test/markup/bash/arithmetic.txt:
--------------------------------------------------------------------------------
1 | echo $(( 16#deadbeef / 1003 ))
2 |
3 | yumi=deadbeef
4 | echo $(( 16#$yumi / 1003 ))
5 |
6 | B=20
7 | yumi=deadbeef
8 | echo $(( $B#$yumi / 1003 ))
9 |
10 | # test that << within an expression doesn't false positively as a heredoc...
11 | (( 19 << 42 ))
12 | printf 'Line 1\n'
13 | printf 'Line 2\n'
14 |
15 | fubar=42
16 | (( x = 19 * fubar / 2 ))
17 |
--------------------------------------------------------------------------------
/test/markup/elixir/uppercase-string-sigil.txt:
--------------------------------------------------------------------------------
1 | defmodule Long.Module.Name do
2 | @doc ~S'''
3 | No #{interpolation} of any kind.
4 | \000 \x{ff}
5 |
6 | \n #{\x{ff}}
7 | '''
8 | def func(a, b \\ []), do: :ok
9 |
10 | @doc ~S"""
11 | No #{interpolation} of any kind.
12 | \000 \x{ff}
13 |
14 | \n #{\x{ff}}
15 | """
16 | def func(a, b \\ []), do: :ok
17 | end
18 |
--------------------------------------------------------------------------------
/test/markup/handlebars/escaped-mustaches.txt:
--------------------------------------------------------------------------------
1 | \{{no-expression}}
2 |
3 | \{{{no-expression}}}
4 |
5 | \{{#no}} block \{{/no}}
6 |
7 | \{{\{{no}}}} block \{{\{{/no}}}}
8 |
9 | \{{!-- no comment --}}
10 |
11 | \{{! no comment }}
12 |
13 |
14 |
15 | \\{{expression}}
16 |
17 | \\\{{expression}}
18 |
19 | \\\\{{expression}}
20 |
21 | \\\{{! comment }}
22 |
--------------------------------------------------------------------------------
/test/markup/javascript/modules.txt:
--------------------------------------------------------------------------------
1 | //------ underscore.js ------
2 | export default function (obj) {};
3 | export function each(obj, iterator, context) {};
4 | export { each as forEach };
5 | export function something() {};
6 |
7 | //------ main.js ------
8 | import _, { each, something as otherthing } from 'underscore';
9 |
10 | const file = import("https://file.io/file.js")
11 |
--------------------------------------------------------------------------------
/test/markup/pgsql/dollar_strings.txt:
--------------------------------------------------------------------------------
1 | CREATE OR REPLACE FUNCTION hello_world(param_your_name text)
2 | RETURNS text AS
3 | $$
4 | SELECT 'Hello world. My name is ' || param_your_name || '.';
5 | $$
6 | language sql STRICT;
7 |
8 | SELECT sql_expression($sql$SELECT hello_world($phrase$Regina's elephant's dog$phrase$)
9 | || $phrase$ I made a cat's meow today.$phrase$ $sql$);
10 |
--------------------------------------------------------------------------------
/test/markup/profile/default.txt:
--------------------------------------------------------------------------------
1 | 261917242 function calls in 686.251 CPU seconds
2 |
3 | ncalls tottime filename:lineno(function)
4 | 152824 513.894 {method 'sort' of 'list' objects}
5 | 129590630 83.894 rrule.py:842(__cmp__)
6 | 129590630 82.439 {cmp}
7 | 153900 1.296 rrule.py:399(_iter)
8 | 304393/151570 0.963 rrule.py:102(_iter_cached)
9 |
--------------------------------------------------------------------------------
/test/markup/yaml/special_chars.txt:
--------------------------------------------------------------------------------
1 | # quoted keys
2 | "*":
3 | - "**/.env"
4 |
5 | # unquoted keys
6 | *:
7 | - "**/.env"
8 |
9 | # special chars in keys:
10 | git@github.com:*/copilot:
11 | - "/__tests__/**"
12 |
13 | # leading special chars in a key
14 | */copilot:
15 | - "/__tests__/**"
16 |
17 | @gitlab.com:gitlab-org/gitlab-runner.git:
18 | - "/__tests__/**"
19 |
--------------------------------------------------------------------------------
/src/languages/plaintext.js:
--------------------------------------------------------------------------------
1 | /*
2 | Language: Plain text
3 | Author: Egor Rogov (e.rogov@postgrespro.ru)
4 | Description: Plain text without any highlighting.
5 | Category: common
6 | */
7 |
8 | export default function(hljs) {
9 | return {
10 | name: 'Plain text',
11 | aliases: [
12 | 'text',
13 | 'txt'
14 | ],
15 | disableAutodetect: true
16 | };
17 | }
18 |
--------------------------------------------------------------------------------
/test/detect/django/default.txt:
--------------------------------------------------------------------------------
1 | {% if articles|length %}
2 | {% for article in articles %}
3 |
4 | {% custom %}
5 |
6 | {# Striped table #}
7 |
8 | | {{ article|default:"Hi... " }} |
9 |
10 | Published on {{ article.date }}
11 | |
12 |
13 |
14 | {% endfor %}
15 | {% endif %}
16 |
--------------------------------------------------------------------------------
/test/detect/sql/default.txt:
--------------------------------------------------------------------------------
1 | CREATE TABLE "topic" (
2 | "id" integer NOT NULL PRIMARY KEY,
3 | "forum_id" integer NOT NULL,
4 | "subject" varchar(255) NOT NULL
5 | );
6 | ALTER TABLE "topic"
7 | ADD CONSTRAINT forum_id FOREIGN KEY ("forum_id")
8 | REFERENCES "forum" ("id");
9 |
10 | -- Initials
11 | insert into "topic" ("forum_id", "subject")
12 | values (2, 'D''artagnian');
13 |
--------------------------------------------------------------------------------
/test/markup/django/default.txt:
--------------------------------------------------------------------------------
1 | {% if articles|length %}
2 | {% for article in articles %}
3 |
4 | {% custom %}
5 |
6 | {# Striped table #}
7 |
8 | | {{ article|default:"Hi... " }} |
9 |
10 | Published on {{ article.date }}
11 | |
12 |
13 |
14 | {% endfor %}
15 | {% endif %}
16 |
--------------------------------------------------------------------------------
/test/markup/handlebars/sub-expressions.txt:
--------------------------------------------------------------------------------
1 | {{helper (subExpression 1 2)}}
2 |
3 | {{{helper (subExpression 1 2)}}}
4 |
5 | {{{{#helper (subExpression 1 2)}}}} {{{{/helper}}}}
6 |
7 | {{#helper (subExpression 1 2)}} {{/helper}}
8 |
9 | {{>partial (subExpression 1 2)}}
10 |
11 | {{helper key=(subExpression 1 2)}}
12 |
13 | {{helper (subExpression (canBeNested 1 2) anotherParam)}}
14 |
--------------------------------------------------------------------------------
/test/markup/ini/types.txt:
--------------------------------------------------------------------------------
1 | i = 1_234
2 | f = 1.23
3 | f = 7e+12
4 | f = 2e3
5 | f = -1.234e-12
6 | basic = "string"
7 | multi_basic = """multiple
8 | lines"""
9 | literal = 'string'
10 | multi_literal = '''multiple
11 | lines'''
12 | b = true
13 | b = false
14 | b = on
15 | b = off
16 | b = yes
17 | b = no
18 | dotted.key = 1
19 | array = [1, 2, 3]
20 | inline = {name = "foo", id = 123}
21 |
--------------------------------------------------------------------------------
/test/detect/css/default.txt:
--------------------------------------------------------------------------------
1 | @font-face {
2 | font-family: Chunkfive; src: url('Chunkfive.otf');
3 | }
4 |
5 | body, .usertext {
6 | color: #F0F0F0; background: #600;
7 | font-family: Chunkfive, sans;
8 | --heading-1: 30px/32px Helvetica, sans-serif;
9 | }
10 |
11 | @import url(print.css);
12 | @media print {
13 | a[href^=http]::after {
14 | content: attr(href)
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test/markup/bash/token-containing-keyword.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | mycmd --disable-foo
3 |
4 |
5 | some-cmd set-some-setting
6 | some-cmd set_some_setting
7 |
8 |
9 | check-case foo
10 | check_case foo
11 |
--------------------------------------------------------------------------------
/test/markup/css/pseudo-selector.txt:
--------------------------------------------------------------------------------
1 | li:not(.red){}
2 | li:not(.red):not(.green){}
3 |
4 | :first-child {
5 | padding: 0;
6 | }
7 |
8 | :first-of-type {
9 | padding: 0;
10 | }
11 |
12 | :last-child {
13 | padding: 0;
14 | }
15 |
16 | :last-of-type {
17 | padding: 0;
18 | }
19 |
20 | p::first-letter {
21 | font-size: 1.5rem;
22 | font-weight: bold;
23 | color: brown;
24 | }
25 |
--------------------------------------------------------------------------------
/test/markup/rust/variables.expect.txt:
--------------------------------------------------------------------------------
1 | let foo;
2 | let mut bar;
3 | let _foo_bar;
4 | let r#foo;
--------------------------------------------------------------------------------
/test/markup/stata/built_ins.expect.txt:
--------------------------------------------------------------------------------
1 | local b1 = ln(`or')
2 | generate logit1 = log( pgty1 / ( 1 - pgty1))
3 | generate logit2 = log( pgty2 / ( 1 - pgty2))
4 |
--------------------------------------------------------------------------------
/test/markup/typescript/nested-templates.expect.txt:
--------------------------------------------------------------------------------
1 | let foo = true;
2 | `hello ${foo ? `Mr ${name}` : 'there'}`;
3 | foo = false;
4 |
--------------------------------------------------------------------------------
/test/detect/typescript/default.txt:
--------------------------------------------------------------------------------
1 | class MyClass {
2 | public static myValue: string;
3 | constructor(init: string) {
4 | this.myValue = init;
5 | }
6 | }
7 | import fs = require("fs");
8 | module MyModule {
9 | export interface MyInterface extends Other {
10 | myProperty: any;
11 | }
12 | }
13 | declare magicNumber number;
14 | myArray.forEach(() => { }); // fat arrow syntax
15 |
--------------------------------------------------------------------------------
/test/markup/erlang/numbers.txt:
--------------------------------------------------------------------------------
1 | Integer = 1234
2 | BigInteger = 1_234_000
3 | NegInteger = -20_000
4 | Float = 2.34
5 | BigFloat = 3_333.14159_26535_89793
6 | SciFloat = 2.4e23
7 | PlusSciFloat = 2.4e+23
8 | SmallSciFloat = 2.4e-23
9 | Binary = 2#1010
10 | StrangeBinary = 2#1010_1010_1010
11 | Octal = 8#777
12 | StrangeOctal = 8#777_666_555
13 | Hex = 16#1ABEF
14 | StrangeHex = 16#1234_FACE_987D
15 |
--------------------------------------------------------------------------------
/test/markup/swift/macro.txt:
--------------------------------------------------------------------------------
1 | macro warning(_ message: String) = #externalMacro(module: "MyMacros", type: "WarningMacro")
2 |
3 | @freestanding(declaration)
4 | macro error(_ message: String) = #externalMacro(module: "MyMacros", type: "ErrorMacro")
5 |
6 | @attached(member)
7 | macro OptionSetMembers()
8 |
9 | @attached(peer, names: overloaded)
10 | macro OptionSetMembers()
11 |
12 | #myMacro()
13 |
--------------------------------------------------------------------------------
/test/markup/vbnet/literals.txt:
--------------------------------------------------------------------------------
1 | Dim c1 = "1"c
2 | Dim c2 = "1"C
3 | Dim c3 = """"C
4 |
5 | Dim s1 = "123"
6 | Dim s2 = """1"""
7 |
8 | Dim d1 = #2020-11-11#
9 | Dim d1 = #2020-1-1#
10 | Dim d2 = #5/5/2005#
11 | Dim d3 = #13:13:13#
12 | Dim d4 = #13:13#
13 | Dim d5 = #1:13:13 AM#
14 | Dim d6 = #1:13 AM#
15 | Dim d7 = #1 AM#
16 | Dim d10 = #2020-11-11 13:13:13#
17 | Dim d11 = #5/5/2005 1:13:13 AM#
18 |
--------------------------------------------------------------------------------
/test/detect/haml/default.txt:
--------------------------------------------------------------------------------
1 | !!! XML
2 | %html
3 | %body
4 | %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
5 | /html comment
6 | -# ignore this line
7 | %ul(style='margin: 0')
8 | -items.each do |i|
9 | %i= i
10 | = variable
11 | =variable2
12 | ~ variable3
13 | ~variable4
14 | The current year is #{DataTime.now.year}.
15 |
--------------------------------------------------------------------------------
/test/detect/pgsql/default.txt:
--------------------------------------------------------------------------------
1 | BEGIN;
2 | SELECT sum(salary) OVER w, avg(salary) OVER w
3 | FROM empsalary
4 | WINDOW w AS (PARTITION BY depname ORDER BY salary DESC);
5 | END;
6 |
7 | CREATE FUNCTION days_of_week() RETURNS SETOF text AS $$
8 | BEGIN
9 | FOR i IN 7 .. 13 LOOP
10 | RETURN NEXT to_char(to_date(i::text,'J'),'TMDy');
11 | END LOOP;
12 | END;
13 | $$ STABLE LANGUAGE plpgsql;
14 |
--------------------------------------------------------------------------------
/test/markup/diff/comments.txt:
--------------------------------------------------------------------------------
1 | Index: languages/demo.js
2 | ===================================================================
3 | diff --git a/file.txt b/file.txt
4 | --- languages/demo.js (revision 199)
5 | +++ languages/demo.js (revision 200)
6 | @@ -1,8 +1,7 @@
7 | + Here we highlight correctly
8 | ====
9 | + Here too
10 | =====
11 | + Here we don't anymore after five '=' next to each other
12 |
--------------------------------------------------------------------------------
/test/markup/haml/default.txt:
--------------------------------------------------------------------------------
1 | !!! XML
2 | %html
3 | %body
4 | %h1.jumbo{:id=>"a", :style=>'font-weight: normal', :title=>title} highlight.js
5 | /html comment
6 | -# ignore this line
7 | %ul(style='margin: 0')
8 | -items.each do |i|
9 | %i= i
10 | = variable
11 | =variable2
12 | ~ variable3
13 | ~variable4
14 | The current year is #{DataTime.now.year}.
15 |
--------------------------------------------------------------------------------
/test/markup/swift/tuples.txt:
--------------------------------------------------------------------------------
1 | (3, "string")
2 | (c: (x: 1, y: 1), z: 1)
3 | (var: Array, let: Array)
4 | (_ x: inout Int) throws -> Int
5 | (abs(-2), abs(2))
6 | (x < y, a > b)
7 | ($0, $1)
8 | (@escaping (String) -> Void, @autoclosure () -> String) -> String
9 | (
10 | // x
11 | x,
12 | /* y */
13 | y
14 | )
15 | (let x, var y)
16 | ([key: value, key: value])
17 | (/my regex/)
18 |
--------------------------------------------------------------------------------
/test/markup/csharp/try-catch.expect.txt:
--------------------------------------------------------------------------------
1 | try
2 | {
3 | throw new InvalidCastException();
4 | }
5 | catch (InvalidCastException e) when (e.Data != null)
6 | {
7 | throw;
8 | }
9 |
--------------------------------------------------------------------------------
/test/markup/ebnf/terminators.expect.txt:
--------------------------------------------------------------------------------
1 | full-stop = "." .
2 | semicolon = ";" ;
3 | end-test = "end" ;
4 |
--------------------------------------------------------------------------------
/test/markup/handlebars/raw-block.expect.txt:
--------------------------------------------------------------------------------
1 | {{{{#raw}}}} {{verbatim}} content {{{{/raw}}}} {{var}}
2 |
--------------------------------------------------------------------------------
/test/markup/objectivec/preprocessor.txt:
--------------------------------------------------------------------------------
1 | #include
2 | #define foo 1<<16
3 |
4 | #ifdef DEBUG
5 | TYPE1 foo(void)
6 | #else
7 | int foo(void)
8 | #endif
9 | { }
10 |
11 | #define x(v) ((v))
12 | # define x(v) ((v))
13 | # define x(v) ((v))
14 |
15 | #if MACRO_WITH_STRING_ARG("hello \"world\"")
16 | #elif MULTI_LINE /* comment */ < \
17 | EXPRESSION
18 | int bar;
19 | #endif // comment
20 |
--------------------------------------------------------------------------------
/test/markup/taggerscript/functions.expect.txt:
--------------------------------------------------------------------------------
1 | text$func(
2 | par1,\),
3 | $func(%abc%,xyz),
4 | $noopnot(not a comment)
5 | )text
6 |
--------------------------------------------------------------------------------
/test/markup/ocaml/types.txt:
--------------------------------------------------------------------------------
1 | (* type variables *)
2 | type 'a t = 'a list
3 | let f (a : 'a list) : 'a = List.hd a
4 |
5 | (* polymorphic variants *)
6 | type t = [ `A | `B ]
7 |
8 | (* variants *)
9 | type result = Sat | Unsat | Unknown
10 |
11 | (* module and module types *)
12 | module type S = sig
13 | val compute : unit -> unit
14 | end
15 | module Impl : S = struct
16 | let compute () = ()
17 | end
18 |
--------------------------------------------------------------------------------
/test/detect/processing/default.txt:
--------------------------------------------------------------------------------
1 | import java.util.LinkedList;
2 | import java.awt.Point;
3 |
4 | PGraphics pg;
5 | String load;
6 |
7 | void setup() {
8 | size(displayWidth, displayHeight, P3D);
9 | pg = createGraphics(displayWidth*2,displayHeight,P2D);
10 | pg.beginDraw();
11 | pg.background(255,255,255);
12 | //pg.smooth(8);
13 | pg.endDraw();
14 | }
15 | void draw(){
16 | background(255);
17 | }
18 |
--------------------------------------------------------------------------------
/test/markup/cpp/expression-keywords.expect.txt:
--------------------------------------------------------------------------------
1 | double x = exp(log(2));
2 | return 0;
3 |
--------------------------------------------------------------------------------
/test/markup/http/http3.txt:
--------------------------------------------------------------------------------
1 | HTTP/3 200
2 | content-encoding: gzip
3 | accept-ranges: bytes
4 | age: 361798
5 | cache-control: max-age=604800
6 | content-type: text/html; charset=UTF-8
7 | date: Sat, 21 Jan 2023 12:31:21 GMT
8 | etag: "3147526947+ident"
9 | expires: Sat, 28 Jan 2023 12:31:21 GMT
10 | last-modified: Thu, 17 Oct 2019 07:18:26 GMT
11 | server: ECS (dcb/7ECB)
12 | x-cache: HIT
13 | content-length: 648
14 |
--------------------------------------------------------------------------------
/test/markup/processing/default.txt:
--------------------------------------------------------------------------------
1 | import java.util.LinkedList;
2 | import java.awt.Point;
3 |
4 | PGraphics pg;
5 | String load;
6 |
7 | void setup() {
8 | size(displayWidth, displayHeight, P3D);
9 | pg = createGraphics(displayWidth*2,displayHeight,P2D);
10 | pg.beginDraw();
11 | pg.background(255,255,255);
12 | //pg.smooth(8);
13 | pg.endDraw();
14 | }
15 | void draw(){
16 | background(255);
17 | }
18 |
--------------------------------------------------------------------------------
/test/markup/ldif/ldapmodify.expect.txt:
--------------------------------------------------------------------------------
1 | dn: uid=user.0,ou=People,dc=example,dc=com
2 | changeType: modify
3 | add: cn
4 | cn: Morris Day
5 | -
6 | add: mobile
7 | mobile: (408) 555-7844
8 |
--------------------------------------------------------------------------------
/test/markup/scala/transparent.expect.txt:
--------------------------------------------------------------------------------
1 | transparent inline def f() = 42
2 | transparent trait S
3 |
--------------------------------------------------------------------------------
/test/markup/typescript/namespace_as_identifier.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | const message = 'foo';
3 | const namespace = 'bar';
4 | function baz() {}
--------------------------------------------------------------------------------
/test/markup/typescript/satisfies-and-as.expect.txt:
--------------------------------------------------------------------------------
1 | const test3 = 'test3' as ValidName
2 | const test4 = 'test4' satisfies ValidName
3 |
--------------------------------------------------------------------------------
/.github/pull_request_template.md:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | ### Changes
7 |
8 |
9 | ### Checklist
10 | - [ ] Added markup tests, or they don't apply here because...
11 | - [ ] Updated the changelog at `CHANGES.md`
12 |
--------------------------------------------------------------------------------
/test/detect/hsp/default.txt:
--------------------------------------------------------------------------------
1 | #include "foo.hsp"
2 |
3 | // line comment
4 | message = "Hello, World!"
5 | message2 = {"Multi
6 | line
7 | string"}
8 | num = 0
9 | mes message
10 |
11 | input num : button "sqrt", *label
12 | stop
13 |
14 | *label
15 | /*
16 | block comment
17 | */
18 | if(num >= 0) {
19 | dialog "sqrt(" + num + ") = " + sqrt(num)
20 | } else {
21 | dialog "error", 1
22 | }
23 | stop
24 |
--------------------------------------------------------------------------------
/test/detect/java/default.txt:
--------------------------------------------------------------------------------
1 | /**
2 | * @author John Smith
3 | */
4 | package l2f.gameserver.model;
5 |
6 | public abstract strictfp class L2Char extends L2Object {
7 | public static final Short ERROR = 0x0001;
8 |
9 | public void moveTo(int x, int y, int z) {
10 | _ai = null;
11 | log("Should not be called");
12 | if (1 > 5) { // wtf!?
13 | return;
14 | }
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/test/detect/vim/default.txt:
--------------------------------------------------------------------------------
1 | if foo > 2 || has("gui_running")
2 | syntax on
3 | set hlsearch
4 | endif
5 |
6 | set autoindent
7 |
8 | " switch on highlighting
9 | function UnComment(fl, ll)
10 | while idx >= a:ll
11 | let srclines=getline(idx)
12 | let dstlines=substitute(srclines, b:comment, "", "")
13 | call setline(idx, dstlines)
14 | endwhile
15 | endfunction
16 |
17 | let conf = {'command': 'git'}
18 |
--------------------------------------------------------------------------------
/test/markup/hsp/default.txt:
--------------------------------------------------------------------------------
1 | #include "foo.hsp"
2 |
3 | // line comment
4 | message = "Hello, World!"
5 | message2 = {"Multi
6 | line
7 | string"}
8 | num = 0
9 | mes message
10 |
11 | input num : button "sqrt", *label
12 | stop
13 |
14 | *label
15 | /*
16 | block comment
17 | */
18 | if(num >= 0) {
19 | dialog "sqrt(" + num + ") = " + sqrt(num)
20 | } else {
21 | dialog "error", 1
22 | }
23 | stop
24 |
--------------------------------------------------------------------------------
/test/markup/kotlin/nested_comment.expect.txt:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/test/markup/vim/default.txt:
--------------------------------------------------------------------------------
1 | if foo > 2 || has("gui_running")
2 | syntax on
3 | set hlsearch
4 | endif
5 |
6 | set autoindent
7 |
8 | " switch on highlighting
9 | function UnComment(fl, ll)
10 | while idx >= a:ll
11 | let srclines=getline(idx)
12 | let dstlines=substitute(srclines, b:comment, "", "")
13 | call setline(idx, dstlines)
14 | endwhile
15 | endfunction
16 |
17 | let conf = {'command': 'git'}
18 |
--------------------------------------------------------------------------------
/test/detect/autoit/default.txt:
--------------------------------------------------------------------------------
1 | #NoTrayIcon
2 | #AutoIt3Wrapper_Run_Tidy=Y
3 | #include
4 |
5 | _Singleton(@ScriptName) ; Allow only one instance
6 | example(0, 10)
7 |
8 | Func example($min, $max)
9 | For $i = $min To $max
10 | If Mod($i, 2) == 0 Then
11 | MsgBox(64, "Message", $i & ' is even number!')
12 | Else
13 | MsgBox(64, "Message", $i & ' is odd number!')
14 | EndIf
15 | Next
16 | EndFunc ;==>example
--------------------------------------------------------------------------------
/test/markup/autoit/default.txt:
--------------------------------------------------------------------------------
1 | #NoTrayIcon
2 | #AutoIt3Wrapper_Run_Tidy=Y
3 | #include
4 |
5 | _Singleton(@ScriptName) ; Allow only one instance
6 | example(0, 10)
7 |
8 | Func example($min, $max)
9 | For $i = $min To $max
10 | If Mod($i, 2) == 0 Then
11 | MsgBox(64, "Message", $i & ' is even number!')
12 | Else
13 | MsgBox(64, "Message", $i & ' is odd number!')
14 | EndIf
15 | Next
16 | EndFunc ;==>example
--------------------------------------------------------------------------------
/test/markup/fsharp/attributes.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | [<Foo>]
3 | [<Bar("bar"); Foo(1, 2)>]
4 | let x () = ()
--------------------------------------------------------------------------------
/test/markup/javascript/object-attr.txt:
--------------------------------------------------------------------------------
1 | {
2 | key: value, // with comment
3 | key2: value,
4 | key2clone: value,
5 | 'key-3': value,
6 | key4: false ? undefined : true,
7 | key5: value, /* with a multiline comment */
8 | key6: value,
9 | key7: value, /* with a multiline comment */ // another comment
10 | key8: value,
11 | key9: value, /* with a REAL multiline
12 | comment */
13 | key10: value,
14 | }
15 |
16 |
--------------------------------------------------------------------------------
/test/markup/ruby/blocks.expect.txt:
--------------------------------------------------------------------------------
1 | [1, 2, 3].each do |num|
2 | puts num
3 | end
4 |
5 | names |= users.map do |user|
6 | user.name
7 | end
8 |
--------------------------------------------------------------------------------
/test/markup/coffeescript/division.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | x = 6/foo/i
3 | x = 6 /foo
4 | x = 6 / foo
5 | x = 6 /foo * 2/gm
6 | x = f /foo
7 | x = f / foo / gm
8 | x = f /foo * 2/6
9 |
--------------------------------------------------------------------------------
/test/markup/dart/string-interpolation.expect.txt:
--------------------------------------------------------------------------------
1 | '1234$identifier $true';
2 |
3 | '1234${1234 + true + 'foo'}';
4 |
--------------------------------------------------------------------------------
/test/markup/elixir/function-not-regex.expect.txt:
--------------------------------------------------------------------------------
1 | import Kernel, except: [
2 | spawn: 1,
3 | +: 2,
4 | /: 2,
5 | unless: 2
6 | ]
7 |
--------------------------------------------------------------------------------
/test/markup/pony/number-literals.txt:
--------------------------------------------------------------------------------
1 | let num: U32 = 42_000
2 | let num: U32 = 42_000_
3 | let num: U32 = 42_000.234
4 | let num: U8 = 1
5 | let num: F32 = 1.234
6 | let num: I32 = 1024
7 | let num: I32 = -1024
8 | let num: I32 = 0x400
9 | let num: I32 = 0X400
10 | let num: I32 = 0b10101010
11 | let num: I32 = 0B1010101
12 | let num: F32 = 42.12e-4
13 | let num: F32 = 42.12E-4
14 | let num: F32 = 42.12e+4
15 | let num: F32 = 42.12E+4
16 |
--------------------------------------------------------------------------------
/test/markup/xquery/direct_method.txt:
--------------------------------------------------------------------------------
1 | xquery version "3.1";
2 | let $var := "rooting" out 1 or 2 root causes
3 | return
4 |
5 | disable highlight for a name such as root {
6 | for $name in $var
7 | return
8 | $name as xs:string
9 | }
10 | return to unhighlighted order of things.
11 | "rooting" out root causes
12 |
13 |
--------------------------------------------------------------------------------
/test/fixtures/nested.js:
--------------------------------------------------------------------------------
1 | module.exports = function(hljs) {
2 | var BODY = {
3 | className: 'body', endsWithParent: true
4 | };
5 | var LIST = {
6 | className: 'list',
7 | variants: [
8 | {begin: /\(/, end: /\)/},
9 | {begin: /\[/, end: /\]/}
10 | ],
11 | contains: [BODY]
12 | };
13 | BODY.contains = [LIST];
14 | return {
15 | disableAutodetect: true,
16 | contains: [LIST]
17 | }
18 | };
19 |
--------------------------------------------------------------------------------
/test/markup/sql/string-types.expect.txt:
--------------------------------------------------------------------------------
1 | SELECT '\';
2 |
3 |
4 | SELECT "name" from users;
5 |
6 |
7 | SELECT `\`;
8 |
--------------------------------------------------------------------------------
/test/markup/swift/distributed-actor-runtime.expect.txt:
--------------------------------------------------------------------------------
1 | distributed actor Foobar {
2 | distributed func baz() {
3 | }
4 |
5 | func qux() {
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/test/markup/x86asm/labels-directives.expect.txt:
--------------------------------------------------------------------------------
1 | .cfi_startproc
2 | _ZN3lib13is_whitespace17h28afa23272bf056bE:
3 | .align 16, 0x90
4 | ja .Lfunc_end0
5 | .Lfunc_end0:
6 | ret
7 |
--------------------------------------------------------------------------------
/test/builds/rollup_import_via_commonjs.mjs:
--------------------------------------------------------------------------------
1 | // rollup.config.js
2 | import commonjs from '@rollup/plugin-commonjs';
3 |
4 | export default {
5 | input: 'test/builds/package.js',
6 | output: {
7 | file: 'build/bundle.js',
8 | format: 'iife'
9 | },
10 | plugins: [
11 | commonjs({
12 | include: 'build/**', // Default: undefined
13 | exclude: [ 'node_modules/**' ], // Default: undefined
14 | })
15 | ]
16 | };
17 |
--------------------------------------------------------------------------------
/test/detect/erlang-repl/default.txt:
--------------------------------------------------------------------------------
1 | 1> Str = "abcd".
2 | "abcd"
3 | 2> L = test:length(Str).
4 | 4
5 | 3> Descriptor = {L, list_to_atom(Str)}.
6 | {4,abcd}
7 | 4> L.
8 | 4
9 | 5> b().
10 | Descriptor = {4,abcd}
11 | L = 4
12 | Str = "abcd"
13 | ok
14 | 6> f(L).
15 | ok
16 | 7> b().
17 | Descriptor = {4,abcd}
18 | Str = "abcd"
19 | ok
20 | 8> {L, _} = Descriptor.
21 | {4,abcd}
22 | 9> L.
23 | 4
24 | 10> 2#101.
25 | 5
26 | 11> 1.85e+3.
27 | 1850
28 |
--------------------------------------------------------------------------------
/test/markup/bash/strings.txt:
--------------------------------------------------------------------------------
1 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
2 | TLS_DIR="$SCRIPT_DIR/../src/main/resources/tls"
3 | ROOT_DIR="$SCRIPT_DIR/.."
4 |
5 | jshell -s - << EOF
6 | System.out.printf("Procs: %s%n", getdata())
7 | EOF
8 |
9 | jshell -s - <<<'System.out.printf("Procs: %s%n", getdata())'
10 |
11 | cat <<< '$VARIABLE'
12 | cat <<< "$VARIABLE"
13 | cat <<< $VARIABLE
14 | cat <<< `$VARIABLE`
15 |
--------------------------------------------------------------------------------
/test/markup/crystal/operators.expect.txt:
--------------------------------------------------------------------------------
1 | +
2 | -
3 | *
4 | %
5 | &
6 | |
7 | ^
8 | **
9 | <<
10 | >>
11 | ==
12 | !=
13 | <
14 | <=
15 | >
16 | >=
17 | <=>
18 | ===
19 | //
20 | //=
21 | &+
22 | &-
23 | &*
24 | &**
25 | &+=
26 | &-=
27 | &*=
28 | !
29 | ~
30 | []
31 | []?
32 | []=
33 | /
34 |
--------------------------------------------------------------------------------
/test/markup/erlang-repl/default.txt:
--------------------------------------------------------------------------------
1 | 1> Str = "abcd".
2 | "abcd"
3 | 2> L = test:length(Str).
4 | 4
5 | 3> Descriptor = {L, list_to_atom(Str)}.
6 | {4,abcd}
7 | 4> L.
8 | 4
9 | 5> b().
10 | Descriptor = {4,abcd}
11 | L = 4
12 | Str = "abcd"
13 | ok
14 | 6> f(L).
15 | ok
16 | 7> b().
17 | Descriptor = {4,abcd}
18 | Str = "abcd"
19 | ok
20 | 8> {L, _} = Descriptor.
21 | {4,abcd}
22 | 9> L.
23 | 4
24 | 10> 2#101.
25 | 5
26 | 11> 1.85e+3.
27 | 1850
28 |
--------------------------------------------------------------------------------
/test/markup/groovy/oneoffs.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | def formattingMsg = label < 0 ? ('The following files need formatting:\n ' +
3 | codeStyleFiles.join('\n ')) : 'All files are correctly formatted'
4 |
--------------------------------------------------------------------------------
/test/markup/powershell/apos-herestring.expect.txt:
--------------------------------------------------------------------------------
1 | @' The wild cat jumped over the $height-tall fence.
2 | He did so with grace.
3 | '@
4 |
5 | This SHOULDNT be a part of the above strings span.
6 |
7 | @' The wild cat jumped over the $height-tall fence.
8 | He did so with grace.
9 | break-end-of-string'@
10 |
11 | This SHOULD be a part of the above strings span.
--------------------------------------------------------------------------------
/test/markup/verilog/numbers.expect.txt:
--------------------------------------------------------------------------------
1 | a = 'hff;
2 | A = 'HFF;
3 | b = 8'h33;
4 | B = 8'H33;
5 | c = 12;
6 | d = 'o755;
7 | e = 8'b1001_0001;
8 | f = 8'b1111zzzx;
9 |
--------------------------------------------------------------------------------
/test/builds/rollup_import_cdn_build_esm.mjs:
--------------------------------------------------------------------------------
1 | // rollup.config.js
2 | import commonjs from "@rollup/plugin-commonjs";
3 |
4 | export default {
5 | input: "test/builds/cdn_build_as_esm.mjs",
6 | output: {
7 | file: "build/bundle.js",
8 | format: "iife",
9 | },
10 | plugins: [
11 | commonjs({
12 | include: "build/**", // Default: undefined
13 | exclude: ["node_modules/**"], // Default: undefined
14 | }),
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/test/detect/pony/default.txt:
--------------------------------------------------------------------------------
1 | use "collections"
2 |
3 | class StopWatch
4 | """
5 | A simple stopwatch class for performance micro-benchmarking
6 | """
7 | var _s: U64 = 0
8 |
9 | fun delta(): U64 =>
10 | Time.nanos() - _s
11 |
12 | actor LonelyPony
13 | """
14 | A simple manifestation of the lonely pony problem
15 | """
16 | var env: Env
17 | let sw: StopWatch = StopWatch
18 |
19 | new create(env': Env) =>
20 | env = env
21 |
--------------------------------------------------------------------------------
/test/detect/powershell/default.txt:
--------------------------------------------------------------------------------
1 | $initialDate = [datetime]'2013/1/8'
2 |
3 | $rollingDate = $initialDate
4 |
5 | do {
6 | $client = New-Object System.Net.WebClient
7 | $results = $client.DownloadString("http://not.a.real.url")
8 | Write-Host "$rollingDate.ToShortDateString() - $results"
9 | $rollingDate = $rollingDate.AddDays(21)
10 | $username = [System.Environment]::UserName
11 | } until ($rollingDate -ge [datetime]'2013/12/31')
12 |
--------------------------------------------------------------------------------
/test/markup/csharp/generic_modifiers.txt:
--------------------------------------------------------------------------------
1 | interface IObserver;
2 | {}
3 |
4 | interface IObservable;
5 | {}
6 |
7 | public delegate void DContravariant(A argument);
8 |
9 | public delegate A DCovariant();
10 |
11 | void MethodWithGenericParameter();
12 |
13 | private static List leftHalfDiamond = new List();
14 |
15 | private static List> leftHalfDiamond = new List>();
16 |
--------------------------------------------------------------------------------
/test/markup/perl/number.txt:
--------------------------------------------------------------------------------
1 | use v5.38;
2 | use 5.0020;
3 |
4 | my $number = 9;
5 | $number = 0;
6 | $number = 0_;
7 | $number = 00;
8 | $number = 0.99;
9 | $number = 99;
10 | $number = 99.9;
11 | $number = 99.99;
12 | $number = ._99;
13 | $number = 0x99FF;
14 | $number = 0x99_EE_FF;
15 | $number = 0x_99_FF;
16 | $number = 0b00101011;
17 | $number = 0b0010_1011;
18 | $number = 0b_0010_1011;
19 | $number = 0777;
20 | $number = 07_7_7;
21 | $number = 0_777;
22 |
--------------------------------------------------------------------------------
/test/markup/swift/operator-declarations.expect.txt:
--------------------------------------------------------------------------------
1 | prefix operator +++
2 | postfix operator +++
3 | infix operator +-: AdditionPrecedence
4 |
--------------------------------------------------------------------------------
/test/builds/rollup_import_node_build_esm.mjs:
--------------------------------------------------------------------------------
1 | // rollup.config.js
2 | import commonjs from "@rollup/plugin-commonjs";
3 |
4 | export default {
5 | input: "test/builds/node_build_as_esm.mjs",
6 | output: {
7 | file: "build/bundle.js",
8 | format: "iife",
9 | },
10 | plugins: [
11 | commonjs({
12 | include: "build/**", // Default: undefined
13 | exclude: ["node_modules/**"], // Default: undefined
14 | }),
15 | ],
16 | };
17 |
--------------------------------------------------------------------------------
/test/markup/javascript/method-call.expect.txt:
--------------------------------------------------------------------------------
1 | x.continue(0);
2 |
3 | x = [
4 | hljs.COMMENT(/\{%\s*comment\s*%}/, /\{%\s*endcomment\s*%}/),
5 | hljs.COMMENT(/\{#/, /#}/),
6 | ]
7 |
8 |
--------------------------------------------------------------------------------
/test/markup/tcl/variables.txt:
--------------------------------------------------------------------------------
1 | $name
2 | ${name}
3 | ${::name}
4 | ${::namespace::name}
5 | ${::namespace::another::name}
6 |
7 | $name()
8 | $name(32)
9 | $name(index)
10 |
11 | $with_underscore::oth_er::and_finally(32)
12 |
13 | ${name()}
14 | ${name(32)}
15 | ${name(index)}
16 |
17 | ${ns::other::name()}
18 | ${ns::other::name(32)}
19 | ${ns::other::name(index)}
20 |
21 |
22 | $ns::other::name()
23 | $ns::other::name(32)
24 | $ns::other::name(index)
25 |
--------------------------------------------------------------------------------
/test/markup/javascript/seperated-parameters.expect.txt:
--------------------------------------------------------------------------------
1 | function visibleTodoFilter (state = 'watch', action) {}
2 |
3 | function visibleTodoFilter (state, action) {
4 |
5 | }
6 |
--------------------------------------------------------------------------------
/test/markup/json/comments.txt:
--------------------------------------------------------------------------------
1 | /* multi-line comment before */
2 | [
3 | {
4 | "title": "apples", // yum
5 | "count": [12000, 20000], /* so many? */
6 | "description": {"text": "...", "sensitive": false}
7 | },
8 | {
9 | "title": "oranges",
10 | "count": [17500, null],
11 | "description": {"text": "...", "sensitive": false}
12 | }
13 | // {
14 | // "title" : "brocolli"
15 | // }
16 | ]
17 | /* multi-line
18 | comment after */
19 |
--------------------------------------------------------------------------------
/test/markup/pony/method.expect.txt:
--------------------------------------------------------------------------------
1 | fun foo(bar: String): String =>
2 | bar + "baz"
3 |
4 | new create(hunger: I32) =>
5 | _hunger = hunger
6 |
7 | be feed(food: I32) =>
8 | _hunger = _hunger - food
--------------------------------------------------------------------------------
/test/markup/sql/functions.expect.txt:
--------------------------------------------------------------------------------
1 | select CURRENT_CATALOG,
2 | CURRENT_USER,
3 | CURRENT_TIME,
4 | CURRENT_TIME(),
5 | CURRENT_TIMESTAMP,
6 | CURRENT_TIMESTAMP()
7 | FROM sys;
8 |
--------------------------------------------------------------------------------
/test/markup/xml/non-ascii-element-names.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | sofá
4 | mueble
5 | Asiento cómodo para dos o más personas, que tiene respaldo y brazos.
6 |
7 |
8 | sillón
9 | mueble
10 | Silla de brazos, mayor y más cómoda que la ordinaria.
11 |
12 |
13 |
--------------------------------------------------------------------------------
/test/detect/ada/default.txt:
--------------------------------------------------------------------------------
1 | package body Sqlite.Simple is
2 |
3 | Foo : int := int'Size;
4 | Bar : int := long'Size;
5 |
6 | Error_Message_C : chars_ptr := Sqlite_Errstr (Error);
7 | Error_Message : String := Null_Ignore_Value (Error_Message_C);
8 | begin
9 |
10 | Named : for Index in Foo..Bar loop
11 | Put ("Hi[]{}");
12 | end loop Named;
13 |
14 | Foo := Bar;
15 | end Message;
16 |
17 | end Sqlite.Simple;
18 |
--------------------------------------------------------------------------------
/test/markup/crystal/toplevel-keywords.expect.txt:
--------------------------------------------------------------------------------
1 | class Foo; end
2 | struct Bar; end
3 |
4 | annotation JSON::Field; end
5 |
--------------------------------------------------------------------------------
/test/markup/java/titles.txt:
--------------------------------------------------------------------------------
1 | public class Greet {
2 | public Either f(int val) {
3 | new Type();
4 | if (val) {
5 | return getType();
6 | } else if (!val) {
7 | throw getError();
8 | }
9 | }
10 | }
11 |
12 | sealed interface Command permits LoginCommand {
13 | void run();
14 | }
15 |
16 | non-sealed abstract class UserPluginCommand extends Command {
17 | void runAsUser();
18 | }
19 |
--------------------------------------------------------------------------------
/test/markup/python/decorators.txt:
--------------------------------------------------------------------------------
1 | @foo
2 | def bar():
3 | pass
4 |
5 | @foo # bar
6 | def baz():
7 | pass
8 |
9 | @foo.bar.baz
10 | def qux():
11 | pass
12 |
13 | @surround_with("#", repeat=3)
14 | def text():
15 | return "hi!"
16 |
17 | @py38.style
18 | def func():
19 | pass
20 |
21 | @py["3.9"].style
22 | def func():
23 | pass
24 |
25 | @py[3.9].style
26 | def func():
27 | pass
28 |
29 | @2 + 2 == 5
30 | def func():
31 | pass
32 |
--------------------------------------------------------------------------------
/test/browser/plain.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | const {newTestCase, defaultCase, buildFakeDOM } = require('./test_case')
4 |
5 | describe('plain browser', function() {
6 |
7 | it('should return relevance key', async function() {
8 | await buildFakeDOM.bind(this, defaultCase)();
9 | var out = this.hljs.highlight("", { language: "javascript" });
10 | out.relevance.should.equal(0);
11 | });
12 |
13 | it('should highlight block', defaultCase.runner);
14 | });
15 |
--------------------------------------------------------------------------------
/test/markup/maxima/symbols.txt:
--------------------------------------------------------------------------------
1 | /* symbolic constants */
2 |
3 | [true, false, unknown, inf, minf, ind,
4 | und, %e, %i, %pi, %phi, %gamma];
5 |
6 | /* built-in variables */
7 |
8 | [_, __, %, %%, linel, simp, dispflag,
9 | stringdisp, lispdisp, %edispflag];
10 |
11 | /* built-in functions */
12 |
13 | [sin, cosh, exp, atan2, sqrt, log, struve_h,
14 | sublist_indices, read_array];
15 |
16 | /* user-defined symbols */
17 |
18 | [foo, ?bar, baz%, quux_mumble_blurf];
19 |
--------------------------------------------------------------------------------
/test/markup/reasonml/modules.txt:
--------------------------------------------------------------------------------
1 | let decode = json =>
2 | Json.Decode.{
3 | query: json |> field("query", string),
4 | cacheKey: json |> field("cacheKey", string),
5 | desc: json |> field("desc", string),
6 | lambda: json |> field("lambda", string),
7 | };
8 |
9 | Some.Bucket.Of.(
10 | let value = stuff();
11 | );
12 |
13 | let value = Some.Bucket.Of.stuff();
14 |
15 | module type RewiredModule = {
16 | type t = {
17 | name: string
18 | };
19 | };
--------------------------------------------------------------------------------
/test/markup/ada/default.txt:
--------------------------------------------------------------------------------
1 | package body Sqlite.Simple is
2 |
3 | Foo : int := int'Size;
4 | Bar : int := long'Size;
5 |
6 | Error_Message_C : chars_ptr := Sqlite_Errstr (Error);
7 | Error_Message : String := Null_Ignore_Value (Error_Message_C);
8 | begin
9 |
10 | Named : parallel for Index in Foo..Bar loop
11 | Put ("Hi[]{}");
12 | end loop Named;
13 |
14 | Foo := Bar;
15 | end Message;
16 |
17 | end Sqlite.Simple;
18 |
--------------------------------------------------------------------------------
/test/markup/csharp/floats.expect.txt:
--------------------------------------------------------------------------------
1 | float test = 1.0f;
2 | float test2 = 1.f;
3 | float test3 = 1.0;
4 | float test4 = 1;
5 | float test5 = 1_000;
6 |
7 |
--------------------------------------------------------------------------------
/test/markup/delphi/character-string.txt:
--------------------------------------------------------------------------------
1 | const
2 | CDecimalCharacterString = #123;
3 | CHexadecimalCharacterString = #$7B;
4 | COctalCharacterString = #&123;
5 | CBinaryCharacterString = #%1111011;
6 |
7 | CDecimalCharacterStringWithSeparator = #1_23;
8 | CHexadecimalCharacterStringWithSeparator = #$7_B;
9 | COctalCharacterStringWithSeparator = #&123;
10 | CBinaryCharacterStringWithSeparator = #%1_111011;
11 |
12 | CMultipleCharacterStrings = #123#$ABC#&765#%0011001;
--------------------------------------------------------------------------------
/test/fixtures/expect/useBr.txt:
--------------------------------------------------------------------------------
1 | <head>
<meta charset="utf-8">
<title></title>
</head>
2 |
--------------------------------------------------------------------------------
/test/markup/properties/syntax.txt:
--------------------------------------------------------------------------------
1 | # comment
2 | # comment
3 | ! comment
4 | ! comment
5 | key=val
6 | key = val
7 | key:val
8 | key : val
9 | key val
10 | key val
11 | key = val\
12 | val
13 | key\ key\:\= val
14 | key
15 | # if the number of backslashes at the end of the line is even, the next line is not included in the value
16 | key = val\\
17 | key = diffValue\\\\
18 | # val with odd number of backslash, here val2 is part of the key
19 | key = val\\\
20 | val2
21 |
--------------------------------------------------------------------------------
/test/markup/python/matrix-multiplication.expect.txt:
--------------------------------------------------------------------------------
1 | @meta
2 | class C:
3 |
4 | @decorator
5 | def f(self, H, V, beta, r):
6 | S = (H @ beta - r).T @ inv(H @ V @ H.T) @ (H @ beta - r)
7 | return S
8 |
--------------------------------------------------------------------------------
/test/markup/shell/command-continuation.txt:
--------------------------------------------------------------------------------
1 | $ docker run \
2 | --publish=7474:7474 --publish=7687:7687 \
3 | --volume=/neo4j/data:/data \
4 | --volume=/neo4j/plugins:/plugins \
5 | --volume=/neo4j/conf:/conf \
6 | --volume=/logs/neo4j:/logs \
7 | --user="$(id -u neo4j):$(id -g neo4j)" \
8 | --group-add=$groups \
9 | neo4j:3.4
10 | > /bin/cat \.travis.yml\
11 | -b | head -n1
12 | 1 language: node_js
13 | > echo 'hello'
14 | hello
15 |
--------------------------------------------------------------------------------
/test/detect/csharp/default.txt:
--------------------------------------------------------------------------------
1 | using System.IO.Compression;
2 |
3 | #pragma warning disable 414, 3021
4 |
5 | namespace MyApplication
6 | {
7 | [Obsolete("...")]
8 | class Program : IInterface
9 | {
10 | public static List JustDoIt(int count)
11 | {
12 | Span numbers = stackalloc int[length];
13 | Console.WriteLine($"Hello {Name}!");
14 | return new List(new int[] { 1, 2, 3 })
15 | }
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/test/markup/javascript/built-in.expect.txt:
--------------------------------------------------------------------------------
1 | let bi = BigInt('1');
2 | let inf = Infinity
3 | Number(undefined)
4 | let today = new Date()
--------------------------------------------------------------------------------
/test/markup/latex/chars.expect.txt:
--------------------------------------------------------------------------------
1 | {}$&^_~"[]()<>
2 |
3 | +-0123456789 pt
4 |
5 | ^^3abc
6 | ^^3ABC
7 | ^^xyz
8 | ^^#3
9 | ^^°!
10 | ^^{
11 | ^^}
12 | ^^$
13 | ^^&
14 | ^^%asdf
15 | ^^^
16 | ^^_
17 | ^^^^3bf2a3
18 | ^^^^g12345
19 |
--------------------------------------------------------------------------------
/test/markup/dockerfile/default.txt:
--------------------------------------------------------------------------------
1 | FROM ubuntu
2 |
3 | MAINTAINER laurent@docker.com
4 |
5 | ARG debug=0
6 |
7 | COPY www.conf /etc/php5/fpm/pool.d/
8 |
9 | RUN apt-get update \
10 | && apt-get install -y php5-fpm php-apc php5-curl php5-gd php5-intl php5-mysql
11 | RUN mkdir /tmp/sessions
12 |
13 | ENV APPLICATION_ENV dev
14 |
15 | USER www-data
16 |
17 | EXPOSE 80
18 |
19 | VOLUME ["/var/www/html"]
20 |
21 | WORKDIR "/var/www/html"
22 |
23 | CMD [ "/usr/sbin/php5-fpm", "-F" ]
24 |
--------------------------------------------------------------------------------
/test/markup/javascript/regex.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | `Bad ${foo / 1000}`
3 | foo = 2 / 2 + 2 / 2;
4 | foo = / 2 + 2 /;
5 | b = a++ / 2;
6 |
--------------------------------------------------------------------------------
/test/markup/llvm/simple.txt:
--------------------------------------------------------------------------------
1 | ;; foooo
2 | define i32 @mul_add(i32 %x, i32 %y, i32 %z) {
3 | entry:
4 | %tmp = mul i32 %x, %y
5 | %tmp2 = add i32 %tmp, %z
6 | %tmp3 = add i32 %tmp, 0
7 | ret i32 %tmp3
8 | }
9 |
10 | ; Named metadata
11 | !0 = !{i32 42, null, !"string"}
12 | !foo = !{!0}
13 |
14 | ; Some unnamed metadata nodes, which are referenced by the named metadata.
15 | !0 = !{!"zero"}
16 | !1 = !{!"one"}
17 | !2 = !{!"two"}
18 | ; A named metadata.
19 | !name = !{!0, !1, !2}
20 |
--------------------------------------------------------------------------------
/test/markup/r/numbers.txt:
--------------------------------------------------------------------------------
1 | 1 # Regression caused numbers at beginning not to be highlighted.
2 |
3 | # Numbers
4 |
5 | 0, 01, 08, 123456, 1256.701, 123e3, 123E+3, 1.23e-3, 1.23E3, .25, 2.
6 |
7 | # Integers
8 |
9 | 123L, -50L
10 |
11 | # Imaginary numbers
12 |
13 | 123i, -123i, 1.2e-3i, 1.i, .0i
14 |
15 | # Hex numbers
16 |
17 | 0x0, 0xabcdefABCDEF01234, 0xabcp123, 0xabcP-123, 0x1.2p2, 0xa.bp-3i
18 |
19 | # Invalid/not literals (for reference)
20 |
21 | # 2e, 0x1pa, 0x1.2, 0xg, .2L, 0.L
22 |
--------------------------------------------------------------------------------
/test/markup/scala/enum.expect.txt:
--------------------------------------------------------------------------------
1 | enum Color:
2 | case Red, Green, Blue
3 |
4 | enum State:
5 | case On
6 | case Off
7 |
--------------------------------------------------------------------------------
/test/detect/markdown/default.txt:
--------------------------------------------------------------------------------
1 | # hello world
2 |
3 | you can write text [with links](http://example.com) inline or [link references][1].
4 |
5 | * one _thing_ has *em*phasis
6 | * two __things__ are **bold**
7 |
8 | [1]: http://example.com
9 |
10 | ---
11 |
12 | hello world
13 | ===========
14 |
15 |
16 |
17 | > markdown is so cool
18 |
19 | so are code segments
20 |
21 | 1. one thing (yeah!)
22 | 2. two thing `i can write code`, and `more` wipee!
23 |
24 |
--------------------------------------------------------------------------------
/test/markup/ini/comments.expect.txt:
--------------------------------------------------------------------------------
1 |
2 |
3 | x = "abc"
4 | y = 123
5 | [table]
6 |
--------------------------------------------------------------------------------
/test/markup/java/functions.expect.txt:
--------------------------------------------------------------------------------
1 | public static <A,B,C> Tuple<A,B,C> fun(Future<Tuple<A,B,C>> future) throws Exceptions {
2 | }
3 |
4 | static Optional<List<Token>> parseAll(String s) {
5 | }
6 |
--------------------------------------------------------------------------------
/test/markup/javascript/jsdoc.txt:
--------------------------------------------------------------------------------
1 | /**
2 | * Create a point.
3 | * @author Test
4 | * @author Test Smith
5 | * @param {number} x - The x value.
6 | * @param {number} y
7 | * @returns {Point} A Point object.
8 | */
9 |
10 | /**
11 | * @typedef {Array}
12 | * @param {string=} n - Optional
13 | * @param {(string|number)} n - Multiple types
14 | * @param {*} n - Any type
15 | * @param {...string} n - repeatable arguments
16 | * @param {string[]} n - Array of strings
17 | */
18 |
--------------------------------------------------------------------------------
/test/detect/n1ql/default.txt:
--------------------------------------------------------------------------------
1 | SELECT *
2 | FROM `beer-sample`
3 | WHERE brewery_id IS NOT MISSING AND type="beer"
4 | LIMIT 1;
5 |
6 | UPSERT INTO product (KEY, VALUE) VALUES (
7 | "odwalla-juice1", {
8 | "productId": "odwalla-juice1",
9 | "unitPrice": 5.40,
10 | "type": "product",
11 | "color":"red"
12 | }
13 | ) RETURNING *;
14 |
15 | INFER `beer-sample` WITH {
16 | "sample_size": 10000,
17 | "num_sample_values": 1,
18 | "similarity_metric": 0.0
19 | };
20 |
--------------------------------------------------------------------------------
/test/markup/javascript/arrow-function.txt:
--------------------------------------------------------------------------------
1 | var f = x => x;
2 | f(x => x + (y=2, z=undefined, ...rest) => y);
3 | () => null;
4 | const FC = props => functional component
;
5 |
6 | const good = () => 0;
7 | const good = (x) => 0;
8 | const bad = (a => [...a, b]);
9 | const bad = (_ => doSomething());
10 | const bad = (() => 0);
11 | const bad = ((a, b) => [...a, b]);
12 | const array = [1, 2, 3].reduce((acc, next) => [...acc, next], []);
13 | sides.every((length,width=(3+2+(4/5))) => length > 0 );
14 |
15 |
--------------------------------------------------------------------------------
/test/markup/markdown/entity.expect.txt:
--------------------------------------------------------------------------------
1 | - named entities: &, ¾, Æ
2 | - decimal entities: A ¤
3 | - hexadecimal entities: � H.
--------------------------------------------------------------------------------
/test/markup/n1ql/default.txt:
--------------------------------------------------------------------------------
1 | SELECT *
2 | FROM `beer-sample`
3 | WHERE brewery_id IS NOT MISSING AND type="beer"
4 | LIMIT 1;
5 |
6 | UPSERT INTO product (KEY, VALUE) VALUES (
7 | "odwalla-juice1", {
8 | "productId": "odwalla-juice1",
9 | "unitPrice": 5.40,
10 | "type": "product",
11 | "color":"red"
12 | }
13 | ) RETURNING *;
14 |
15 | INFER `beer-sample` WITH {
16 | "sample_size": 10000,
17 | "num_sample_values": 1,
18 | "similarity_metric": 0.0
19 | };
20 |
--------------------------------------------------------------------------------
/test/detect/go/swift-like.txt:
--------------------------------------------------------------------------------
1 | func makeRequest(method string, url string, cb func(error, io.ReadCloser)) {
2 | req, _ := http.NewRequest(method, url, nil)
3 | resp, err := http.DefaultClient.Do(req)
4 | if err != nil {
5 | cb(err, nil)
6 | } else {
7 | cb(err, resp.Body)
8 | }
9 | }
10 | func main() {
11 | makeRequest("GET", "http://ipinfo.io/json", func(err error, body io.ReadCloser) {
12 | defer body.Close()
13 | io.Copy(os.Stdout, body)
14 | })
15 | }
16 |
--------------------------------------------------------------------------------
/test/detect/q/default.txt:
--------------------------------------------------------------------------------
1 | select time, price by date,stock from quote where price=(max;price)fby stock
2 | data:raze value flip trade
3 | select vwap:size wavg price by 5 xbar time.minute from aapl where date within (.z.d-10;.z.d)
4 | f1:{[x;y;z] show (x;y+z);sum 1 2 3}
5 | .z.pc:{[handle] show -3!(`long$.z.p;"Closed";handle)}
6 | // random normal distribution, e.g. nor 10
7 | nor:{$[x=2*n:x div 2;raze sqrt[-2*log n?1f]*/:(sin;cos)@\:(2*pi)*n?1f;-1_.z.s 1+x]}
8 |
9 | mode:{where g=max g:count each group x} // mode function
--------------------------------------------------------------------------------
/test/detect/rsl/default.txt:
--------------------------------------------------------------------------------
1 | #define TEST_DEFINE 3.14
2 | /* plastic surface shader
3 | *
4 | * Pixie is:
5 | * (c) Copyright 1999-2003 Okan Arikan. All rights reserved.
6 | */
7 |
8 | surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
9 | color specularcolor = 1;) {
10 | normal Nf = faceforward (normalize(N),I);
11 | Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks *
12 | specular(Nf,-normalize(I),roughness);
13 | Oi = Os;
14 | Ci *= Oi;
15 | }
16 |
--------------------------------------------------------------------------------
/test/markup/pony/control-flow.txt:
--------------------------------------------------------------------------------
1 | if a == b and b == a then
2 | env.out.print("they are the same")
3 | elseif a > b or b < a then
4 | env.out.print("a is bigger")
5 | else
6 | env.out.print("b bigger")
7 | end
8 |
9 | while count <= 10 do
10 | env.out.print(count.string())
11 | count = count + 1
12 | end
13 |
14 | for name in ["Bob"; "Fred"; "Sarah"].values() do
15 | env.out.print(name)
16 | end
17 |
18 | repeat
19 | env.out.print("hello!")
20 | counter = counter + 1
21 | until counter > 7 end
--------------------------------------------------------------------------------
/test/markup/q/default.txt:
--------------------------------------------------------------------------------
1 | select time, price by date,stock from quote where price=(max;price)fby stock
2 | data:raze value flip trade
3 | select vwap:size wavg price by 5 xbar time.minute from aapl where date within (.z.d-10;.z.d)
4 | f1:{[x;y;z] show (x;y+z);sum 1 2 3}
5 | .z.pc:{[handle] show -3!(`long$.z.p;"Closed";handle)}
6 | // random normal distribution, e.g. nor 10
7 | nor:{$[x=2*n:x div 2;raze sqrt[-2*log n?1f]*/:(sin;cos)@\:(2*pi)*n?1f;-1_.z.s 1+x]}
8 |
9 | mode:{where g=max g:count each group x} // mode function
--------------------------------------------------------------------------------
/test/markup/rsl/default.txt:
--------------------------------------------------------------------------------
1 | #define TEST_DEFINE 3.14
2 | /* plastic surface shader
3 | *
4 | * Pixie is:
5 | * (c) Copyright 1999-2003 Okan Arikan. All rights reserved.
6 | */
7 |
8 | surface plastic (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
9 | color specularcolor = 1;) {
10 | normal Nf = faceforward (normalize(N),I);
11 | Ci = Cs * (Ka*ambient() + Kd*diffuse(Nf)) + specularcolor * Ks *
12 | specular(Nf,-normalize(I),roughness);
13 | Oi = Os;
14 | Ci *= Oi;
15 | }
16 |
--------------------------------------------------------------------------------
/test/builds/package.js:
--------------------------------------------------------------------------------
1 | /*
2 | This file is used by import_via_commonjs.js to build a single "package"
3 | and acts as a sanity check that all our code is "use strict" safe
4 |
5 | See .github/workflows/tests.js.yml
6 | */
7 |
8 | import hljs from '../../build/lib/index.js';
9 | import { HighlightJS } from '../../build/lib/index.js'
10 |
11 | const language = "cpp";
12 | hljs.highlight("/* test */", {language});
13 | HighlightJS.highlight("/* test */", {language});
14 | console.log("Rollup built package works.");
15 |
--------------------------------------------------------------------------------
/test/markup/powershell/quote-herestring.expect.txt:
--------------------------------------------------------------------------------
1 | @" The wild cat jumped over the $height-tall fence.
2 | He did so with grace.
3 | "@
4 |
5 | This SHOULDNT be a part of the above strings span.
6 |
7 | @" The wild cat jumped over the $height-tall fence.
8 | He did so with grace.
9 | break-end-of-string"@
10 |
11 | This SHOULD be a part of the above strings span.
--------------------------------------------------------------------------------
/test/markup/sql/set-operator.expect.txt:
--------------------------------------------------------------------------------
1 | SELECT * FROM VALUES 1, 2 ,3 UNION ALL VALUES 1, 2, 3;
2 |
--------------------------------------------------------------------------------
/test/markup/xml/sublanguage_no_relevancy.expect.txt:
--------------------------------------------------------------------------------
1 | <script>foo();</script>
2 | <script>booger</script>
3 | <script>hjk</script>
4 |
--------------------------------------------------------------------------------
/test/detect/brainfuck/default.txt:
--------------------------------------------------------------------------------
1 | ++++++++++
2 | [ 3*10 and 10*10
3 | ->+++>++++++++++<<
4 | ]>>
5 | [ filling cells
6 | ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[]<[<]<[<]>>
7 | ]<
8 | +++++++++<<
9 | [ rough codes correction loop
10 | ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]<
11 | ]
12 | more accurate сodes correction
13 | >>>++>
14 | -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++>
15 | ++>+++++++++++>++++++++++++>------>+++
16 | rewind and output
17 | [<]>[.>]
18 |
--------------------------------------------------------------------------------
/test/markup/brainfuck/default.txt:
--------------------------------------------------------------------------------
1 | ++++++++++
2 | [ 3*10 and 10*10
3 | ->+++>++++++++++<<
4 | ]>>
5 | [ filling cells
6 | ->++>>++>++>+>++>>++>++>++>++>++>++>++>++>++>++>++[]<[<]<[<]>>
7 | ]<
8 | +++++++++<<
9 | [ rough codes correction loop
10 | ->>>+>+>+>+++>+>+>+>+>+>+>+>+>+>+>+>+>+>+[<]<
11 | ]
12 | more accurate сodes correction
13 | >>>++>
14 | -->+++++++>------>++++++>++>+++++++++>++++++++++>++++++++>--->++++++++++>------>++++++>
15 | ++>+++++++++++>++++++++++++>------>+++
16 | rewind and output
17 | [<]>[.>]
18 |
--------------------------------------------------------------------------------
/test/markup/clojure/symbols-numbers.expect.txt:
--------------------------------------------------------------------------------
1 | (def +x [(a 1) +2 -3.0 y-5])
2 | (System/getProperty "java.vm.version")
3 | (.getEnclosingClass java.util.Map$Entry)
4 | (java.util.Map$Entry. .getEnclosingClass)
--------------------------------------------------------------------------------
/test/markup/ini/array.expect.txt:
--------------------------------------------------------------------------------
1 |
2 | moo=["foo"]
3 |
4 | KNOWN_PEERS = [
5 | "finland.some-host.com:11625",
6 | "germany.some-host.com:11625",
7 | "hongkong.some-host.com:11625",
8 | 32,
9 | true
10 | ]
11 |
--------------------------------------------------------------------------------
/test/markup/r/strings.txt:
--------------------------------------------------------------------------------
1 | "test #"
2 | "a'b"
3 | 'a"b'
4 | "foo\"bar"
5 | 'foo\'bar'
6 | "\013x"
7 | "\xfex"
8 | "\uabc0x"
9 | "\U0123abcdx"
10 | "\u{abcd}x"
11 | "\U{0123abcd}x"
12 | r"(foo"bar)"
13 | r"{foo)"bar}"
14 | r"[foo)"bar]"
15 | r"-(foo)"bar)-"
16 | R"--(foo)-"bar)--"
17 | r'-(foo)'bar)-' # '
18 | r"(
19 | xyz
20 | "
21 | \
22 | )
23 | )"
24 | "this is a quote that spans
25 | multiple lines
26 | \"
27 |
28 | is this still a quote? it should be.
29 | # even still!
30 |
31 | "
32 | 'same for
33 | single quotes #'
34 |
--------------------------------------------------------------------------------
/test/markup/tap/basic.expect.txt:
--------------------------------------------------------------------------------
1 | 1..4
2 | ok 1 - Input file opened
3 | not ok 2 - First line of the input valid
4 | ok 3 - Read the rest of the file
5 | not ok 4 - Summarized correctly
6 |
--------------------------------------------------------------------------------
/test/api/index.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | describe('hljs', function() {
4 | require('./autoDetection');
5 | require('./beginKeywords');
6 | require('./binaryNumber');
7 | require('./cNumber');
8 | require('./getLanguage');
9 | require('./highlight');
10 | require('./ident');
11 | require('./keywords');
12 | require('./number');
13 | require('./registerAlias');
14 | require('./unregisterLanguage');
15 | require('./starters');
16 | require('./underscoreIdent');
17 | require('./multiClassMatch');
18 | });
19 |
--------------------------------------------------------------------------------
/test/detect/twig/default.txt:
--------------------------------------------------------------------------------
1 | {% if posts|length %}
2 | {% for article in articles %}
3 | <div>
4 | {{ article.title|upper() }}
5 |
6 | {# outputs 'WELCOME' #}
7 | </div>
8 | {% endfor %}
9 | {% endif %}
10 |
11 | {% set user = json_encode(user) %}
12 |
13 | {{ random(['apple', 'orange', 'citrus']) }}
14 |
15 | {{ include(template_from_string("Hello {{ name }}")) }}
16 |
17 |
18 | {#
19 | Comments may be long and multiline.
20 | Markup is <em>not</em> highlighted within comments.
21 | #}
22 |
--------------------------------------------------------------------------------