pygments.rb 0.5.4 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +40 -0
- data/README.md +3 -0
- data/lexers +0 -0
- data/lib/pygments/popen.rb +3 -2
- data/lib/pygments/version.rb +1 -1
- data/pygments.rb.gemspec +2 -1
- data/vendor/pygments-main/AUTHORS +20 -1
- data/vendor/pygments-main/CHANGES +55 -3
- data/vendor/pygments-main/LICENSE +1 -1
- data/vendor/pygments-main/MANIFEST.in +1 -1
- data/vendor/pygments-main/Makefile +5 -8
- data/vendor/pygments-main/REVISION +1 -1
- data/vendor/pygments-main/doc/Makefile +153 -0
- data/vendor/pygments-main/doc/_static/favicon.ico +0 -0
- data/vendor/pygments-main/doc/_static/logo_new.png +0 -0
- data/vendor/pygments-main/doc/_static/logo_only.png +0 -0
- data/vendor/pygments-main/doc/_templates/docssidebar.html +3 -0
- data/vendor/pygments-main/doc/_templates/indexsidebar.html +25 -0
- data/vendor/pygments-main/doc/_themes/pygments14/layout.html +98 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/bodybg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/docbg.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/listitem.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/logo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pocoo.png +0 -0
- data/vendor/pygments-main/doc/_themes/pygments14/static/pygments14.css_t +401 -0
- data/vendor/pygments-main/doc/_themes/pygments14/theme.conf +15 -0
- data/vendor/pygments-main/doc/conf.py +249 -0
- data/vendor/pygments-main/doc/docs/api.rst +316 -0
- data/vendor/pygments-main/doc/docs/authors.rst +4 -0
- data/vendor/pygments-main/doc/docs/changelog.rst +1 -0
- data/vendor/pygments-main/{docs/src/cmdline.txt → doc/docs/cmdline.rst} +9 -11
- data/vendor/pygments-main/{docs/src/filterdevelopment.txt → doc/docs/filterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/filters.txt → doc/docs/filters.rst} +4 -5
- data/vendor/pygments-main/{docs/src/formatterdevelopment.txt → doc/docs/formatterdevelopment.rst} +1 -1
- data/vendor/pygments-main/{docs/src/formatters.txt → doc/docs/formatters.rst} +6 -6
- data/vendor/pygments-main/doc/docs/index.rst +66 -0
- data/vendor/pygments-main/{docs/src/integrate.txt → doc/docs/integrate.rst} +3 -7
- data/vendor/pygments-main/{docs/src/java.txt → doc/docs/java.rst} +0 -0
- data/vendor/pygments-main/{docs/src/lexerdevelopment.txt → doc/docs/lexerdevelopment.rst} +13 -14
- data/vendor/pygments-main/{docs/src/lexers.txt → doc/docs/lexers.rst} +7 -5
- data/vendor/pygments-main/{docs/src/moinmoin.txt → doc/docs/moinmoin.rst} +0 -0
- data/vendor/pygments-main/{docs/src/plugins.txt → doc/docs/plugins.rst} +0 -0
- data/vendor/pygments-main/{docs/src/quickstart.txt → doc/docs/quickstart.rst} +22 -19
- data/vendor/pygments-main/{docs/src/rstdirective.txt → doc/docs/rstdirective.rst} +0 -0
- data/vendor/pygments-main/{docs/src/styles.txt → doc/docs/styles.rst} +2 -2
- data/vendor/pygments-main/{docs/src/tokens.txt → doc/docs/tokens.rst} +10 -7
- data/vendor/pygments-main/{docs/src/unicode.txt → doc/docs/unicode.rst} +8 -7
- data/vendor/pygments-main/doc/download.rst +41 -0
- data/vendor/pygments-main/doc/faq.rst +143 -0
- data/vendor/pygments-main/doc/index.rst +53 -0
- data/vendor/pygments-main/doc/languages.rst +151 -0
- data/vendor/pygments-main/doc/make.bat +190 -0
- data/vendor/pygments-main/{docs → doc}/pygmentize.1 +0 -0
- data/vendor/pygments-main/external/autopygmentize +65 -48
- data/vendor/pygments-main/external/markdown-processor.py +15 -15
- data/vendor/pygments-main/external/moin-parser.py +1 -1
- data/vendor/pygments-main/external/rst-directive.py +2 -3
- data/vendor/pygments-main/ez_setup.py +340 -234
- data/vendor/pygments-main/pygments/__init__.py +4 -4
- data/vendor/pygments-main/pygments/cmdline.py +81 -68
- data/vendor/pygments-main/pygments/console.py +1 -1
- data/vendor/pygments-main/pygments/filter.py +1 -1
- data/vendor/pygments-main/pygments/filters/__init__.py +11 -9
- data/vendor/pygments-main/pygments/formatter.py +3 -3
- data/vendor/pygments-main/pygments/formatters/__init__.py +5 -3
- data/vendor/pygments-main/pygments/formatters/_mapping.py +16 -5
- data/vendor/pygments-main/pygments/formatters/bbcode.py +1 -1
- data/vendor/pygments-main/pygments/formatters/html.py +44 -26
- data/vendor/pygments-main/pygments/formatters/img.py +21 -14
- data/vendor/pygments-main/pygments/formatters/latex.py +104 -12
- data/vendor/pygments-main/pygments/formatters/other.py +53 -6
- data/vendor/pygments-main/pygments/formatters/rtf.py +30 -16
- data/vendor/pygments-main/pygments/formatters/svg.py +2 -2
- data/vendor/pygments-main/pygments/formatters/terminal.py +41 -1
- data/vendor/pygments-main/pygments/formatters/terminal256.py +2 -2
- data/vendor/pygments-main/pygments/lexer.py +59 -39
- data/vendor/pygments-main/pygments/lexers/__init__.py +38 -15
- data/vendor/pygments-main/pygments/lexers/_asybuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_clbuiltins.py +15 -15
- data/vendor/pygments-main/pygments/lexers/_cocoabuiltins.py +73 -0
- data/vendor/pygments-main/pygments/lexers/_lassobuiltins.py +11 -1
- data/vendor/pygments-main/pygments/lexers/_luabuiltins.py +14 -8
- data/vendor/pygments-main/pygments/lexers/_mapping.py +81 -30
- data/vendor/pygments-main/pygments/lexers/_openedgebuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_phpbuiltins.py +1067 -95
- data/vendor/pygments-main/pygments/lexers/_postgres_builtins.py +7 -7
- data/vendor/pygments-main/pygments/lexers/_robotframeworklexer.py +5 -4
- data/vendor/pygments-main/pygments/lexers/_scilab_builtins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/_sourcemodbuiltins.py +12 -7
- data/vendor/pygments-main/pygments/lexers/_stan_builtins.py +112 -18
- data/vendor/pygments-main/pygments/lexers/_vimbuiltins.py +1 -1
- data/vendor/pygments-main/pygments/lexers/agile.py +644 -382
- data/vendor/pygments-main/pygments/lexers/asm.py +66 -29
- data/vendor/pygments-main/pygments/lexers/compiled.py +1643 -174
- data/vendor/pygments-main/pygments/lexers/dalvik.py +27 -6
- data/vendor/pygments-main/pygments/lexers/dotnet.py +45 -33
- data/vendor/pygments-main/pygments/lexers/foxpro.py +3 -3
- data/vendor/pygments-main/pygments/lexers/functional.py +1510 -570
- data/vendor/pygments-main/pygments/lexers/graph.py +81 -0
- data/vendor/pygments-main/pygments/lexers/hdl.py +29 -30
- data/vendor/pygments-main/pygments/lexers/inferno.py +96 -0
- data/vendor/pygments-main/pygments/lexers/jvm.py +622 -207
- data/vendor/pygments-main/pygments/lexers/math.py +438 -70
- data/vendor/pygments-main/pygments/lexers/other.py +885 -171
- data/vendor/pygments-main/pygments/lexers/parsers.py +24 -24
- data/vendor/pygments-main/pygments/lexers/qbasic.py +157 -0
- data/vendor/pygments-main/pygments/lexers/rdf.py +99 -0
- data/vendor/pygments-main/pygments/lexers/shell.py +28 -25
- data/vendor/pygments-main/pygments/lexers/special.py +7 -8
- data/vendor/pygments-main/pygments/lexers/sql.py +56 -23
- data/vendor/pygments-main/pygments/lexers/templates.py +377 -59
- data/vendor/pygments-main/pygments/lexers/text.py +208 -46
- data/vendor/pygments-main/pygments/lexers/web.py +729 -264
- data/vendor/pygments-main/pygments/modeline.py +1 -1
- data/vendor/pygments-main/pygments/plugin.py +1 -1
- data/vendor/pygments-main/pygments/scanner.py +1 -1
- data/vendor/pygments-main/pygments/sphinxext.py +153 -0
- data/vendor/pygments-main/pygments/style.py +3 -2
- data/vendor/pygments-main/pygments/styles/__init__.py +5 -1
- data/vendor/pygments-main/pygments/styles/autumn.py +1 -1
- data/vendor/pygments-main/pygments/styles/borland.py +1 -1
- data/vendor/pygments-main/pygments/styles/bw.py +1 -1
- data/vendor/pygments-main/pygments/styles/colorful.py +1 -1
- data/vendor/pygments-main/pygments/styles/default.py +1 -1
- data/vendor/pygments-main/pygments/styles/emacs.py +1 -1
- data/vendor/pygments-main/pygments/styles/friendly.py +1 -1
- data/vendor/pygments-main/pygments/styles/fruity.py +1 -1
- data/vendor/pygments-main/pygments/styles/igor.py +29 -0
- data/vendor/pygments-main/pygments/styles/manni.py +1 -1
- data/vendor/pygments-main/pygments/styles/monokai.py +4 -4
- data/vendor/pygments-main/pygments/styles/murphy.py +1 -1
- data/vendor/pygments-main/pygments/styles/native.py +1 -1
- data/vendor/pygments-main/pygments/styles/paraiso_dark.py +125 -0
- data/vendor/pygments-main/pygments/styles/paraiso_light.py +125 -0
- data/vendor/pygments-main/pygments/styles/pastie.py +1 -1
- data/vendor/pygments-main/pygments/styles/perldoc.py +1 -1
- data/vendor/pygments-main/pygments/styles/rrt.py +1 -1
- data/vendor/pygments-main/pygments/styles/tango.py +1 -1
- data/vendor/pygments-main/pygments/styles/trac.py +1 -1
- data/vendor/pygments-main/pygments/styles/vim.py +1 -1
- data/vendor/pygments-main/pygments/styles/vs.py +1 -1
- data/vendor/pygments-main/pygments/styles/xcode.py +51 -0
- data/vendor/pygments-main/pygments/token.py +4 -1
- data/vendor/pygments-main/pygments/unistring.py +6 -5
- data/vendor/pygments-main/pygments/util.py +35 -21
- data/vendor/pygments-main/scripts/check_sources.py +28 -44
- data/vendor/pygments-main/scripts/detect_missing_analyse_text.py +5 -4
- data/vendor/pygments-main/scripts/find_codetags.py +27 -19
- data/vendor/pygments-main/scripts/find_error.py +16 -13
- data/vendor/pygments-main/scripts/get_vimkw.py +3 -3
- data/vendor/pygments-main/scripts/vim2pygments.py +9 -7
- data/vendor/pygments-main/setup.py +19 -19
- data/vendor/pygments-main/tests/examplefiles/99_bottles_of_beer.chpl +118 -0
- data/vendor/pygments-main/tests/examplefiles/Error.pmod +38 -0
- data/vendor/pygments-main/tests/examplefiles/FakeFile.pike +360 -0
- data/vendor/pygments-main/tests/examplefiles/{ANTLRv3.g → antlr_ANTLRv3.g} +0 -0
- data/vendor/pygments-main/tests/examplefiles/clojure-weird-keywords.clj +5 -0
- data/vendor/pygments-main/tests/examplefiles/core.cljs +52 -0
- data/vendor/pygments-main/tests/examplefiles/demo.cfm +13 -1
- data/vendor/pygments-main/tests/examplefiles/demo.hbs +12 -0
- data/vendor/pygments-main/tests/examplefiles/ember.handlebars +33 -0
- data/vendor/pygments-main/tests/examplefiles/example.als +217 -0
- data/vendor/pygments-main/tests/examplefiles/example.c +1 -1
- data/vendor/pygments-main/tests/examplefiles/example.chai +6 -0
- data/vendor/pygments-main/tests/examplefiles/example.coffee +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.e +124 -0
- data/vendor/pygments-main/tests/examplefiles/example.f90 +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.feature +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.gd +23 -0
- data/vendor/pygments-main/tests/examplefiles/example.gi +64 -0
- data/vendor/pygments-main/tests/examplefiles/example.groovy +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.hs +27 -0
- data/vendor/pygments-main/tests/examplefiles/example.hx +44 -1
- data/vendor/pygments-main/tests/examplefiles/example.i6t +32 -0
- data/vendor/pygments-main/tests/examplefiles/example.i7x +45 -0
- data/vendor/pygments-main/tests/examplefiles/example.inf +374 -0
- data/vendor/pygments-main/tests/examplefiles/example.j +564 -0
- data/vendor/pygments-main/tests/examplefiles/example.java +16 -0
- data/vendor/pygments-main/tests/examplefiles/example.kal +75 -0
- data/vendor/pygments-main/tests/examplefiles/example.liquid +42 -0
- data/vendor/pygments-main/tests/examplefiles/example.ma +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.mq4 +187 -0
- data/vendor/pygments-main/tests/examplefiles/example.mqh +123 -0
- data/vendor/pygments-main/tests/examplefiles/example.ni +57 -0
- data/vendor/pygments-main/tests/examplefiles/example.nix +80 -0
- data/vendor/pygments-main/tests/examplefiles/example.pp +8 -0
- data/vendor/pygments-main/tests/examplefiles/example.red +257 -0
- data/vendor/pygments-main/tests/examplefiles/example.reds +150 -0
- data/vendor/pygments-main/tests/examplefiles/example.rkt +677 -29
- data/vendor/pygments-main/tests/examplefiles/example.sh +22 -0
- data/vendor/pygments-main/tests/examplefiles/example.slim +31 -0
- data/vendor/pygments-main/tests/examplefiles/example.sls +51 -0
- data/vendor/pygments-main/tests/examplefiles/example.stan +2 -0
- data/vendor/pygments-main/tests/examplefiles/example.todotxt +9 -0
- data/vendor/pygments-main/tests/examplefiles/exampleScript.cfc +241 -0
- data/vendor/pygments-main/tests/examplefiles/exampleTag.cfc +18 -0
- data/vendor/pygments-main/tests/examplefiles/example_elixir.ex +192 -350
- data/vendor/pygments-main/tests/examplefiles/hash_syntax.rb +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.at +6 -0
- data/vendor/pygments-main/tests/examplefiles/hello.golo +5 -0
- data/vendor/pygments-main/tests/examplefiles/hello.lsl +12 -0
- data/vendor/pygments-main/tests/examplefiles/{File.hy → hybris_File.hy} +0 -0
- data/vendor/pygments-main/tests/examplefiles/{mg_sample.pro → idl_sample.pro} +0 -0
- data/vendor/pygments-main/tests/examplefiles/iex_example +23 -0
- data/vendor/pygments-main/tests/examplefiles/inet_pton6.dg +24 -24
- data/vendor/pygments-main/tests/examplefiles/language.hy +165 -0
- data/vendor/pygments-main/tests/examplefiles/limbo.b +456 -0
- data/vendor/pygments-main/tests/examplefiles/livescript-demo.ls +3 -1
- data/vendor/pygments-main/tests/examplefiles/main.cmake +2 -0
- data/vendor/pygments-main/tests/examplefiles/objc_example.m +163 -16
- data/vendor/pygments-main/tests/examplefiles/{example.p → openedge_example} +0 -0
- data/vendor/pygments-main/tests/examplefiles/pawn_example +25 -0
- data/vendor/pygments-main/tests/examplefiles/qbasic_example +2 -0
- data/vendor/pygments-main/tests/examplefiles/r6rs-comments.scm +23 -0
- data/vendor/pygments-main/tests/examplefiles/{robotframework.txt → robotframework_test.txt} +0 -0
- data/vendor/pygments-main/tests/examplefiles/rql-queries.rql +34 -0
- data/vendor/pygments-main/tests/examplefiles/scope.cirru +43 -0
- data/vendor/pygments-main/tests/examplefiles/sparql.rq +23 -0
- data/vendor/pygments-main/tests/examplefiles/test.R +37 -5
- data/vendor/pygments-main/tests/examplefiles/test.apl +26 -0
- data/vendor/pygments-main/tests/examplefiles/test.cyp +123 -0
- data/vendor/pygments-main/tests/examplefiles/test.idr +93 -0
- data/vendor/pygments-main/tests/examplefiles/test.mask +41 -0
- data/vendor/pygments-main/tests/examplefiles/test.pan +54 -0
- data/vendor/pygments-main/tests/examplefiles/test.php +3 -1
- data/vendor/pygments-main/tests/examplefiles/test.pig +148 -0
- data/vendor/pygments-main/tests/examplefiles/test.pwn +253 -0
- data/vendor/pygments-main/tests/examplefiles/test.r3 +27 -7
- data/vendor/pygments-main/tests/examplefiles/test.rsl +111 -0
- data/vendor/pygments-main/tests/examplefiles/test.swift +65 -0
- data/vendor/pygments-main/tests/examplefiles/test.zep +33 -0
- data/vendor/pygments-main/tests/examplefiles/unicode.go +10 -0
- data/vendor/pygments-main/tests/examplefiles/{test.bas → vbnet_test.bas} +0 -0
- data/vendor/pygments-main/tests/examplefiles/vctreestatus_hg +4 -0
- data/vendor/pygments-main/tests/examplefiles/vimrc +21 -0
- data/vendor/pygments-main/tests/run.py +14 -19
- data/vendor/pygments-main/tests/string_asserts.py +22 -0
- data/vendor/pygments-main/tests/test_basic_api.py +28 -14
- data/vendor/pygments-main/tests/test_cfm.py +46 -0
- data/vendor/pygments-main/tests/test_clexer.py +208 -3
- data/vendor/pygments-main/tests/test_cmdline.py +6 -5
- data/vendor/pygments-main/tests/test_examplefiles.py +30 -19
- data/vendor/pygments-main/tests/test_html_formatter.py +15 -13
- data/vendor/pygments-main/tests/test_latex_formatter.py +4 -2
- data/vendor/pygments-main/tests/test_lexers_other.py +11 -11
- data/vendor/pygments-main/tests/test_objectiveclexer.py +81 -0
- data/vendor/pygments-main/tests/test_perllexer.py +1 -1
- data/vendor/pygments-main/tests/test_qbasiclexer.py +43 -0
- data/vendor/pygments-main/tests/test_regexlexer.py +8 -1
- data/vendor/pygments-main/tests/test_rtf_formatter.py +109 -0
- data/vendor/pygments-main/tests/test_string_asserts.py +39 -0
- data/vendor/pygments-main/tests/test_token.py +3 -3
- data/vendor/pygments-main/tests/test_using_api.py +1 -1
- data/vendor/pygments-main/tests/test_util.py +1 -1
- metadata +138 -51
- data/vendor/pygments-main/docs/generate.py +0 -472
- data/vendor/pygments-main/docs/src/api.txt +0 -270
- data/vendor/pygments-main/docs/src/authors.txt +0 -5
- data/vendor/pygments-main/docs/src/changelog.txt +0 -5
- data/vendor/pygments-main/docs/src/index.txt +0 -69
- data/vendor/pygments-main/docs/src/installation.txt +0 -71
- data/vendor/pygments-main/external/rst-directive-old.py +0 -77
- data/vendor/pygments-main/scripts/reindent.py +0 -291
- data/vendor/pygments-main/tests/examplefiles/import.hs +0 -4
- data/vendor/pygments-main/tests/examplefiles/objc_example2.m +0 -24
- data/vendor/pygments-main/tests/old_run.py +0 -138
@@ -1,32 +1,179 @@
|
|
1
|
-
|
1
|
+
// Test various types of includes
|
2
|
+
#import <Foundation/Foundation.h>
|
3
|
+
# import <AppKit/AppKit.h>
|
4
|
+
#import "stdio.h"
|
5
|
+
#\
|
6
|
+
import \
|
7
|
+
"stdlib.h"
|
8
|
+
# /*line1*/ \
|
9
|
+
import /* line 2 */ \
|
10
|
+
"stdlib.h" // line 3
|
2
11
|
|
3
|
-
|
12
|
+
// Commented out code with preprocessor
|
13
|
+
#if 0
|
14
|
+
#define MY_NUMBER 3
|
15
|
+
#endif
|
4
16
|
|
5
|
-
|
6
|
-
|
17
|
+
#\
|
18
|
+
if 1
|
19
|
+
#define TEST_NUMBER 3
|
20
|
+
#endif
|
21
|
+
|
22
|
+
// Empty preprocessor
|
23
|
+
#
|
24
|
+
|
25
|
+
// Class forward declaration
|
26
|
+
@class MyClass;
|
27
|
+
|
28
|
+
// Empty classes
|
29
|
+
@interface EmptyClass
|
30
|
+
@end
|
31
|
+
@interface EmptyClass2
|
32
|
+
{
|
33
|
+
}
|
34
|
+
@end
|
35
|
+
@interface EmptyClass3 : EmptyClass2
|
36
|
+
{
|
37
|
+
}
|
38
|
+
@end
|
39
|
+
|
40
|
+
// Custom class inheriting from built-in
|
41
|
+
@interface MyClass : NSObject
|
42
|
+
{
|
43
|
+
@public
|
44
|
+
NSString *myString;
|
45
|
+
__weak NSString *_weakString;
|
46
|
+
@protected
|
47
|
+
NSTextField *_textField;
|
48
|
+
@private
|
49
|
+
NSDate *privateDate;
|
7
50
|
}
|
8
51
|
|
52
|
+
// Various property aatributes
|
53
|
+
@property(copy, readwrite, nonatomic) NSString *myString;
|
54
|
+
@property(weak) NSString *weakString;
|
55
|
+
@property(retain, strong, atomic) IBOutlet NSTextField *textField;
|
56
|
+
|
57
|
+
// Class methods
|
58
|
+
+ (void)classMethod1:(NSString *)arg;
|
59
|
+
+ (void)classMethod2:(NSString *) arg; // Test space before arg
|
60
|
+
|
9
61
|
@end
|
10
62
|
|
11
|
-
|
63
|
+
typedef id B;
|
12
64
|
|
13
|
-
|
65
|
+
#pragma mark MyMarker
|
14
66
|
|
67
|
+
// MyClass.m
|
68
|
+
// Class extension to declare private property
|
69
|
+
@interface MyClass ()
|
70
|
+
@property(retain) NSDate *privateDate;
|
71
|
+
- (void)hiddenMethod;
|
15
72
|
@end
|
16
73
|
|
17
|
-
|
18
|
-
|
74
|
+
// Special category
|
75
|
+
@interface MyClass (Special)
|
76
|
+
@property(retain) NSDate *specialDate;
|
77
|
+
@end
|
78
|
+
|
79
|
+
@implementation MyClass
|
80
|
+
@synthesize myString;
|
81
|
+
@synthesize privateDate;
|
82
|
+
|
83
|
+
- (id)a:(B)b {
|
84
|
+
/**
|
85
|
+
* C-style comment
|
86
|
+
*/
|
87
|
+
|
88
|
+
// Selector keywords/types
|
89
|
+
SEL someMethod = @selector(hiddenMethod);
|
90
|
+
|
91
|
+
// Boolean types
|
92
|
+
Boolean b1 = FALSE;
|
93
|
+
BOOL b2 = NO;
|
94
|
+
bool b3 = true;
|
19
95
|
|
96
|
+
/**
|
97
|
+
* Number literals
|
98
|
+
*/
|
99
|
+
// Int Literal
|
100
|
+
NSNumber *n1 = @( 1 );
|
101
|
+
// Method call
|
102
|
+
NSNumber *n2 = @( [b length] );
|
103
|
+
// Define variable
|
104
|
+
NSNumber *n3 = @( TEST_NUMBER );
|
105
|
+
// Arthimetic expression
|
106
|
+
NSNumber *n4 = @(1 + 2);
|
107
|
+
// From variable
|
108
|
+
int myInt = 5;
|
109
|
+
NSNumber *n5 = @(myInt);
|
110
|
+
// Nest expression
|
111
|
+
NSNumber *n6 = @(1 + (2 + 6.0));
|
112
|
+
// Bool literal
|
113
|
+
NSNumber *n7 = @NO;
|
114
|
+
// Bool expression
|
115
|
+
NSNumber *n8 = @(YES);
|
116
|
+
// Character
|
117
|
+
NSNumber *n9 = @'a';
|
118
|
+
// int
|
119
|
+
NSNumber *n10 = @123;
|
120
|
+
// unsigned
|
121
|
+
NSNumber *n11 = @1234U;
|
122
|
+
// long
|
123
|
+
NSNumber *n12 = @1234567890L;
|
124
|
+
// float
|
125
|
+
NSNumber *n13 = @3.14F;
|
126
|
+
// double
|
127
|
+
NSNumber *n14 = @3.14F;
|
128
|
+
|
129
|
+
// Array literals
|
130
|
+
NSArray *arr = @[ @"1", @"2" ];
|
131
|
+
arr = @[ @[ @"1", @"2" ], [arr lastObject] ];
|
132
|
+
[arr lastObject];
|
133
|
+
[@[ @"1", @"2" ] lastObject];
|
134
|
+
|
135
|
+
// Dictionary literals
|
136
|
+
NSDictionary *d = @{ @"key": @"value" };
|
137
|
+
[[d allKeys] lastObject];
|
138
|
+
[[@{ @"key": @"value" } allKeys] lastObject];
|
139
|
+
d = @{ @"key": @{ @"key": @"value" } };
|
20
140
|
|
21
|
-
|
22
|
-
|
23
|
-
|
141
|
+
[self hiddenMethod];
|
142
|
+
[b length];
|
143
|
+
[privateDate class];
|
144
|
+
|
145
|
+
NSDictionary *dictionary = [NSDictionary dictionaryWithObjectsAndKeys:
|
146
|
+
@"1", @"one", @"2", @"two", @"3", @"three", nil];
|
147
|
+
|
148
|
+
NSString *key;
|
149
|
+
for (key in dictionary) {
|
150
|
+
NSLog(@"Number: %@, Word: %@", key, [dictionary valueForKey:key]);
|
151
|
+
}
|
152
|
+
|
153
|
+
// Blocks
|
154
|
+
int (^myBlock)(int arg1, int arg2);
|
155
|
+
NSString *(^myName)(NSString *) = ^(NSString *value) {
|
156
|
+
return value;
|
157
|
+
};
|
158
|
+
|
159
|
+
return nil;
|
24
160
|
}
|
25
161
|
|
26
|
-
|
27
|
-
|
162
|
+
- (void)hiddenMethod {
|
163
|
+
// Synchronized block
|
164
|
+
@synchronized(self) {
|
165
|
+
[myString retain];
|
166
|
+
[myString release];
|
167
|
+
}
|
168
|
+
}
|
28
169
|
|
29
|
-
|
170
|
+
+ (void)classMethod1:(NSString *)arg {}
|
171
|
+
+ (void)classMethod2:(NSString *) arg
|
172
|
+
{
|
173
|
+
// Autorelease pool block
|
174
|
+
@autoreleasepool {
|
175
|
+
NSLog(@"Hello, World!");
|
176
|
+
}
|
177
|
+
}
|
30
178
|
|
31
|
-
|
32
|
-
NSNumber *n2 = @( [a length] );
|
179
|
+
@end
|
File without changes
|
@@ -0,0 +1,25 @@
|
|
1
|
+
{include.i}
|
2
|
+
{nested.i {include.i}}
|
3
|
+
|
4
|
+
&SCOPED-DEFINE MY_NAME "Abe"
|
5
|
+
|
6
|
+
DEF VAR i AS INT NO-UNDO.
|
7
|
+
i = 0xABE + 1337 / (1 * 1.00)
|
8
|
+
|
9
|
+
def var clowercasetest as char no-undo.
|
10
|
+
DEF VAR vardashtest AS DATETIME-TZ NO-UNDO.
|
11
|
+
|
12
|
+
DEFINE TEMP-TABLE ttNames NO-UNDO
|
13
|
+
FIELD cName AS CHAR
|
14
|
+
INDEX IXPK_ttNames IS PRIMARY UNIQUE cName.
|
15
|
+
|
16
|
+
/* One-line comment */
|
17
|
+
/* Two-line
|
18
|
+
Comment */
|
19
|
+
|
20
|
+
CREATE ttNames.
|
21
|
+
ASSIGN ttNames.cName = {&MY_NAME}.
|
22
|
+
|
23
|
+
FOR EACH ttNames:
|
24
|
+
MESSAGE "Hello, " + ttNames.cName + '!' VIEW-AS ALERT-BOX.
|
25
|
+
END.
|
@@ -0,0 +1,23 @@
|
|
1
|
+
#!r6rs
|
2
|
+
|
3
|
+
#|
|
4
|
+
|
5
|
+
The FACT procedure computes the factorial
|
6
|
+
|
7
|
+
of a non-negative integer.
|
8
|
+
|
9
|
+
|#
|
10
|
+
|
11
|
+
(define fact
|
12
|
+
|
13
|
+
(lambda (n)
|
14
|
+
|
15
|
+
;; base case
|
16
|
+
|
17
|
+
(if (= n 0)
|
18
|
+
|
19
|
+
#;(= n 1)
|
20
|
+
|
21
|
+
1 ; identity of *
|
22
|
+
|
23
|
+
(* n (fact (- n 1))))))
|
File without changes
|
@@ -0,0 +1,34 @@
|
|
1
|
+
Any N, N2 where N is Note, N2 is Note, N a_faire_par P1, P1 nom 'john', N2 a_faire_par P2, P2 nom 'jane' ;
|
2
|
+
DISTINCT Any N, D, C, T, A ORDERBY D DESC LIMIT 40 where N is Note, N diem D, W is Workcase, W concerned_by N, N cost C, N text T, N author A, N diem <= today
|
3
|
+
Bookmark B WHERE B owned_by G, G eid 5;
|
4
|
+
Any X WHERE E eid 22762, NOT E is_in X, X modification_date D ORDERBY D DESC LIMIT 41;
|
5
|
+
Any A, R, SUB ORDERBY R WHERE A is "Workcase", S is Division, S concerned_by A, A subject SUB, S eid 85, A ref R;
|
6
|
+
Any D, T, L WHERE D is Document, A concerned_by D,A eid 14533, D title T, D location L;
|
7
|
+
Any N,A,B,C,D ORDERBY A DESC WHERE N is Note, W concerned_by N, W eid 14533, N diem A,N author B,N text C,N cost D;
|
8
|
+
Any X ORDERBY D DESC LIMIT 41 WHERE E eid 18134, NOT E concerned_by X, X modification_date D
|
9
|
+
DISTINCT Any N, D, C, T, A ORDERBY D ASC LIMIT 40 WHERE N is Note, N diem D, P is Person, N to_be_contacted_by G, N cost C, N text T, N author A, G login "john";
|
10
|
+
INSERT Person X: X surname "Doe", X firstname "John";
|
11
|
+
Workcase W where W ref "ABCD12";
|
12
|
+
Workcase W where W ref LIKE "AB%";
|
13
|
+
Any X WHERE X X eid 53
|
14
|
+
Any X WHERE X Document X occurence_of F, F class C, C name 'Comics' X owned_by U, U login 'syt' X available true
|
15
|
+
Person P WHERE P work_for P, S name 'Acme', P interested_by T, T name 'training'
|
16
|
+
Note N WHERE N written_on D, D day> (today -10), N written_by P, P name 'joe' or P name 'jack'
|
17
|
+
Person P WHERE (P interested_by T, T name 'training') or (P city 'Paris')
|
18
|
+
Any N, P WHERE X is Person, X name N, X first_name P
|
19
|
+
String N, P WHERE X is Person, X name N, X first_name P
|
20
|
+
INSERT Person X: X name 'widget'
|
21
|
+
INSERT Person X, Person Y: X name 'foo', Y name 'nice', X friend Y
|
22
|
+
INSERT Person X: X name 'foo', X friend Y WHERE name 'nice'
|
23
|
+
SET X name 'bar', X first_name 'original' where X is Person X name 'foo'
|
24
|
+
SET X know Y WHERE X friend Y
|
25
|
+
DELETE Person X WHERE X name 'foo'
|
26
|
+
DELETE X friend Y WHERE X is Person, X name 'foo'
|
27
|
+
Any X WHERE X name LIKE '%lt'
|
28
|
+
Any X WHERE X name IN ( 'joe', 'jack', 'william', 'averell')
|
29
|
+
Any X, V WHERE X concerns P, P eid 42, X corrected_in V?
|
30
|
+
Any C, P WHERE C is Card, P? documented_by C
|
31
|
+
Point P where P abs X, P ord Y, P value X+Y
|
32
|
+
Document X where X class C, C name 'Cartoon', X owned_by U, U login 'joe', X available true
|
33
|
+
(Any X WHERE X is Document) UNION (Any X WHERE X is File)
|
34
|
+
Any A,B WHERE A creation_date B WITH A BEING (Any X WHERE X is Document) UNION (Any X WHERE X is File)
|
@@ -0,0 +1,43 @@
|
|
1
|
+
|
2
|
+
-- https://github.com/Cirru/cirru-gopher/blob/master/code/scope.cr
|
3
|
+
|
4
|
+
set a (int 2)
|
5
|
+
|
6
|
+
print (self)
|
7
|
+
|
8
|
+
set c (child)
|
9
|
+
|
10
|
+
under c
|
11
|
+
under parent
|
12
|
+
print a
|
13
|
+
|
14
|
+
print $ get c a
|
15
|
+
|
16
|
+
set c x (int 3)
|
17
|
+
print $ get c x
|
18
|
+
|
19
|
+
set just-print $ code
|
20
|
+
print a
|
21
|
+
|
22
|
+
print just-print
|
23
|
+
|
24
|
+
eval (self) just-print
|
25
|
+
eval just-print
|
26
|
+
|
27
|
+
print (string "string with space")
|
28
|
+
print (string "escapes \n \"\\")
|
29
|
+
|
30
|
+
brackets ((((()))))
|
31
|
+
|
32
|
+
"eval" $ string "eval"
|
33
|
+
|
34
|
+
print (add $ (int 1) (int 2))
|
35
|
+
|
36
|
+
print $ unwrap $
|
37
|
+
map (a $ int 1) (b $ int 2)
|
38
|
+
|
39
|
+
print a
|
40
|
+
int 1
|
41
|
+
, b c
|
42
|
+
int 2
|
43
|
+
, d
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# This is a test SPARQL query
|
2
|
+
|
3
|
+
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
|
4
|
+
PREFIX ex: <http://example.org/>
|
5
|
+
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
|
6
|
+
PREFIX dcterms: <http://purl.org/dc/terms/>
|
7
|
+
|
8
|
+
SELECT ?person (COUNT(?nick) AS ?nickCount) {
|
9
|
+
?person foaf:nick ?nick ;
|
10
|
+
foaf:lastName "Smith" ;
|
11
|
+
foaf:age "21"^^xsd:int ;
|
12
|
+
ex:title 'Mr' ; # single-quoted string
|
13
|
+
ex:height 1.80 ; # float
|
14
|
+
ex:distanceToSun +1.4e8 ; # float with exponent
|
15
|
+
ex:ownsACat true ;
|
16
|
+
dcterms:description "Someone with a cat called \"cat\"."@en .
|
17
|
+
OPTIONAL { ?person foaf:isPrimaryTopicOf ?page }
|
18
|
+
OPTIONAL { ?person foaf:name ?name
|
19
|
+
{ ?person foaf:depiction ?img }
|
20
|
+
UNION
|
21
|
+
{ ?person foaf:firstName ?firstN } }
|
22
|
+
FILTER ( bound(?page) || bound(?img) || bound(?firstN) )
|
23
|
+
} GROUP BY ?person ORDER BY ?img
|
@@ -33,10 +33,11 @@ NA_foo_ <- NULL
|
|
33
33
|
123456.78901
|
34
34
|
123e3
|
35
35
|
123E3
|
36
|
-
|
37
|
-
1.
|
38
|
-
1.
|
39
|
-
|
36
|
+
6.02e23
|
37
|
+
1.6e-35
|
38
|
+
1.E12
|
39
|
+
.1234
|
40
|
+
## integers
|
40
41
|
123L
|
41
42
|
1.23L
|
42
43
|
## imaginary numbers
|
@@ -80,7 +81,7 @@ repeat {1+1}
|
|
80
81
|
## Switch
|
81
82
|
x <- 3
|
82
83
|
switch(x, 2+2, mean(1:10), rnorm(5))
|
83
|
-
## Function, dot-dot-dot, return
|
84
|
+
## Function, dot-dot-dot, return, sum
|
84
85
|
foo <- function(...) {
|
85
86
|
return(sum(...))
|
86
87
|
}
|
@@ -151,3 +152,34 @@ world!'
|
|
151
152
|
|
152
153
|
## Backtick strings
|
153
154
|
`foo123 +!"bar'baz` <- 2 + 2
|
155
|
+
|
156
|
+
## Builtin funcitons
|
157
|
+
file.create()
|
158
|
+
gamma()
|
159
|
+
grep()
|
160
|
+
paste()
|
161
|
+
rbind()
|
162
|
+
rownames()
|
163
|
+
R.Version()
|
164
|
+
R.version.string()
|
165
|
+
sample()
|
166
|
+
sapply()
|
167
|
+
save.image()
|
168
|
+
seq()
|
169
|
+
setwd()
|
170
|
+
sin()
|
171
|
+
|
172
|
+
## Data structures
|
173
|
+
servo <- matrix(1:25, nrow = 5)
|
174
|
+
numeric()
|
175
|
+
vector(servo)
|
176
|
+
data.frame()
|
177
|
+
list1 <- list(time = 1:40)
|
178
|
+
# multidimensional array
|
179
|
+
array(c(c(c(2,300,4),c(8,9,0)),c(c(5,60,0),c(66,7,847))), dim=c(3,2,2))
|
180
|
+
|
181
|
+
## Namespace
|
182
|
+
library(ggplot2)
|
183
|
+
require(plyr)
|
184
|
+
attach(cars)
|
185
|
+
source("test.R")
|
@@ -0,0 +1,26 @@
|
|
1
|
+
∇ R←M COMBIN N;D;E;F;G;P
|
2
|
+
⍝ Returns a matrix of every possible
|
3
|
+
⍝ combination of M elements from the
|
4
|
+
⍝ vector ⍳N. That is, returns a
|
5
|
+
⍝ matrix with M!N rows and N columns.
|
6
|
+
⍝
|
7
|
+
E←(⍳P←N-R←M-1)-⎕IO
|
8
|
+
D←R+⍳P
|
9
|
+
R←(P,1)⍴D
|
10
|
+
P←P⍴1
|
11
|
+
L1:→(⎕IO>1↑D←D-1)⍴0
|
12
|
+
P←+\P
|
13
|
+
G←+\¯1↓0,F←⌽P
|
14
|
+
E←F/E-G
|
15
|
+
R←(F/D),R[E+⍳⍴E;]
|
16
|
+
E←G
|
17
|
+
→L1
|
18
|
+
∇
|
19
|
+
|
20
|
+
∇ R←M QUICKEXP N
|
21
|
+
⍝ Matrix exponentiation
|
22
|
+
B ← ⌊ 1 + 2 ⍟ N
|
23
|
+
V ← (B ⍴ 2) ⊤ N
|
24
|
+
L ← ⊂ M
|
25
|
+
R ← ⊃ +.× / V / L ⊣ { L ← (⊂ A +.× A ← ↑L) , L }¨ ⍳ B-1
|
26
|
+
∇
|