rouge 3.13.0 → 3.14.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a05162378ada50863a8c1a08984934c22af14e5288510b83fef150bae1f6be77
4
- data.tar.gz: c3785466ac705a0acac1af6d60f73c0a697fa4b7504874b8d58db6a2efcaf21d
3
+ metadata.gz: d43552856d88e799ffb7f4255d865641bfaafd5dac3945b2646540ff816628c4
4
+ data.tar.gz: 5768d921766cf2eb677fc63e783b707ee0f52a7320b73f4bbbc333ee14e79f77
5
5
  SHA512:
6
- metadata.gz: cffd7cde0caf543698b605bbdf64394a529c4fb11c025bd6ffa00d04d336f8a5cff8663d3d5a7e3f57a0f061d152d01914e2c3fbeaead37d6daf37ea491169bc
7
- data.tar.gz: faefcadccccee11a7e896fc408dcbfddf858c73f44697b5961777285e4f7d878fcd7ee0eefd3d42a9cd5442946dfc9ded90d6875b5d12771a6bd1eb631b57c43
6
+ metadata.gz: fdfd25582e56396cb78b370372b4587b243c1608fa7d4ee32a9659f13fc8939bba2305b5add8d83569543766eefed1abbb8ff5f0d76593964db2b3624b1d112b
7
+ data.tar.gz: 5d2f0526caf091491969d89180fab9a30441ddc5390bbb10c8acb2ea8b9af96b044e91ed32e6db58fa9783a12c530eb3a25d829f031c0ecb7a7e02858592da57
@@ -0,0 +1,11 @@
1
+ .bank 0
2
+ .org $C000
3
+ Reset:
4
+ jsr WaitSync ; wait for VSYNC
5
+ jsr ClearRAM ; clear RAM
6
+ jsr WaitSync ; wait for VSYNC (and PPU warmup)
7
+
8
+ lda #$3f ; $3F -> A register
9
+ ldy #$00 ; $00 -> Y register
10
+ sta PPU_ADDR ; write #HIGH byte first
11
+ sty PPU_ADDR ; $3F00 -> PPU address
@@ -0,0 +1,10 @@
1
+ // Printer.ice
2
+ module Demo
3
+ {
4
+ interface Printer
5
+ {
6
+ // A client can invoke this operation on a server.
7
+ // In this example we print the string s
8
+ void printString(string s);
9
+ }
10
+ }
@@ -48,7 +48,7 @@ module Rouge
48
48
  state :root do
49
49
  mixin :whitespace
50
50
  # Comments
51
- rule %r(//(.*?)\n), Comment::Single
51
+ rule %r(//.*), Comment::Single
52
52
  rule %r(/(\\\n)?[*](.|\n)*?[*](\\\n)?/), Comment::Multiline
53
53
  rule %r(/\+), Comment::Multiline, :nested_comment
54
54
  # Keywords
@@ -17,8 +17,8 @@ module Rouge
17
17
 
18
18
  state :comments_and_whitespace do
19
19
  rule %r/\s+/, Text
20
- rule %r(#.*?\n), Comment::Single
21
- rule %r(//.*?\n), Comment::Single
20
+ rule %r(#.*), Comment::Single
21
+ rule %r(//.*?$), Comment::Single
22
22
  rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
23
23
  end
24
24
 
@@ -27,8 +27,8 @@ module Rouge
27
27
 
28
28
  state :root do
29
29
  rule %r/\s+/m, Text
30
- rule %r(//.*?\n), Comment::Single
31
- rule %r(#.*?\n), Comment::Single
30
+ rule %r(//.*), Comment::Single
31
+ rule %r(#.*), Comment::Single
32
32
  rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
33
33
  rule %r(/[+]), Comment::Multiline, :nested_comment
34
34
 
@@ -6,16 +6,17 @@ module Rouge
6
6
  load_lexer 'json.rb'
7
7
 
8
8
  class JSONDOC < JSON
9
- desc "JavaScript Object Notation with extenstions for documentation"
9
+ desc "JavaScript Object Notation with extensions for documentation"
10
10
  tag 'json-doc'
11
11
 
12
- prepend :root do
12
+ prepend :name do
13
13
  rule %r/([$\w]+)(\s*)(:)/ do
14
14
  groups Name::Attribute, Text, Punctuation
15
15
  end
16
+ end
16
17
 
18
+ prepend :value do
17
19
  rule %r(/[*].*?[*]/), Comment
18
-
19
20
  rule %r(//.*?$), Comment::Single
20
21
  rule %r/(\.\.\.)/, Comment::Single
21
22
  end
@@ -266,7 +266,7 @@ module Rouge
266
266
  end
267
267
 
268
268
  rule %r/(with|for)\b/, Name::Tag
269
- rule %r/[^\s\.]+(\.[^\s\.]+)+\b/, Name::Other
269
+ rule %r/[\/\w-]+(\.[\w-]+)+\b/, Text
270
270
 
271
271
  mixin :variable_tag_markup
272
272
  end
@@ -87,8 +87,8 @@ module Rouge
87
87
 
88
88
  state :whitespace do
89
89
  rule %r/\n+/m, Text, :expr_bol
90
- rule %r(^\*(\\.|.)*?\n), Comment::Single, :expr_bol
91
- rule %r(;(\\.|.)*?\n), Comment::Single, :expr_bol
90
+ rule %r(^\*(\\.|.)*?$), Comment::Single, :expr_bol
91
+ rule %r(;(\\.|.)*?$), Comment::Single, :expr_bol
92
92
  mixin :inline_whitespace
93
93
  end
94
94
 
@@ -22,7 +22,7 @@ module Rouge
22
22
  _throw
23
23
  _lock _endlock
24
24
  _if _then _elif _else _endif
25
- _for _over _while _loop _endloop _loopbody _continue _leave
25
+ _for _over _while _loop _finally _endloop _loopbody _continue _leave
26
26
  _return
27
27
  _class
28
28
  _local _constant _recursive _global _dynamic _import
@@ -0,0 +1,78 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Lexers
6
+ class NesAsm < RegexLexer
7
+ title "NesAsm"
8
+ desc "Nesasm3 assembly (6502 asm)"
9
+ tag 'nesasm'
10
+ aliases 'nes'
11
+ filenames '*.nesasm'
12
+
13
+ def self.keywords
14
+ @keywords ||= %w(
15
+ ADC AND ASL BIT BRK CMP CPX CPY DEC EOR INC JMP JSR LDA LDX LDY LSR
16
+ NOP ORA ROL ROR RTI RTS SBC STA STX STY TAX TXA DEX INX TAY TYA DEY
17
+ INY BPL BMI BVC BVS BCC BCS BNE BEQ CLC SEC CLI SEI CLV CLD SED TXS
18
+ TSX PHA PLA PHP PLP
19
+ )
20
+ end
21
+
22
+ def self.keywords_type
23
+ @keywords_type ||= %w(
24
+ DB DW BYTE WORD
25
+ )
26
+ end
27
+
28
+ def self.keywords_reserved
29
+ @keywords_reserved ||= %w(
30
+ INCBIN INCLUDE ORG BANK RSSET RS MACRO ENDM DS PROC ENDP PROCGROUP
31
+ ENDPROCGROUP INCCHR DEFCHR ZP BSS CODE DATA IF IFDEF IFNDEF ELSE
32
+ ENDIF FAIL INESPRG INESCHR INESMAP INESMIR FUNC
33
+ )
34
+ end
35
+
36
+ state :root do
37
+ rule %r/\s+/m, Text
38
+ rule %r(;.*), Comment::Single
39
+
40
+ rule %r/[\(\)\,\.\[\]]/, Punctuation
41
+ rule %r/\#?\%[0-1]+/, Num::Bin # #%00110011 %00110011
42
+ rule %r/\#?\$\h+/, Num::Hex # $1f #$1f
43
+ rule %r/\#?\d+/, Num # 10 #10
44
+ rule %r([~&*+=\|?:<>/-]), Operator
45
+
46
+ rule %r/\#?\w+:?/i do |m|
47
+ name = m[0].upcase
48
+
49
+ if self.class.keywords.include? name
50
+ token Keyword
51
+ elsif self.class.keywords_type.include? name
52
+ token Keyword::Type
53
+ elsif self.class.keywords_reserved.include? name
54
+ token Keyword::Reserved
55
+ else
56
+ token Name::Function
57
+ end
58
+ end
59
+
60
+ rule %r/\#?(?:LOW|HIGH)\(.*\)/i, Keyword::Reserved # LOW() #HIGH()
61
+
62
+ rule %r/\#\(/, Punctuation # #()
63
+
64
+ rule %r/"/, Str, :string
65
+
66
+ rule %r/'\w'/, Str::Char # 'A' for example
67
+
68
+ rule %r/\\\??[\d@#]/, Name::Builtin # builtin parameters for use inside macros and functions: \1-\9 , \?1-\?9 , \# , \@
69
+ end
70
+
71
+ state :string do
72
+ rule %r/"/, Str, :pop!
73
+ rule %r/\\"?/, Str::Escape
74
+ rule %r/[^"\\]+/m, Str
75
+ end
76
+ end
77
+ end
78
+ end
@@ -41,7 +41,7 @@ module Rouge
41
41
  state :base do
42
42
  rule %r/\s+/, Text
43
43
 
44
- rule %r/#.*?\n/, Comment::Single
44
+ rule %r/#.*/, Comment::Single
45
45
  rule %r/(?:on|off)\b/, Name::Constant
46
46
  rule %r/[$][\w-]+/, Name::Variable
47
47
 
@@ -46,7 +46,7 @@ module Rouge
46
46
  state :root do
47
47
  mixin :whitespace
48
48
  rule %r/"""/, Str::Doc, :docstring
49
- rule %r{//(.*?)\n}, Comment::Single
49
+ rule %r{//.*}, Comment::Single
50
50
  rule %r{/(\\\n)?[*](.|\n)*?[*](\\\n)?/}, Comment::Multiline
51
51
  rule %r/"/, Str, :string
52
52
  rule %r([~!%^&*+=\|?:<>/-]), Operator
@@ -17,7 +17,7 @@ module Rouge
17
17
  state :root do
18
18
  rule %r/[\s]+/, Text
19
19
  rule %r/[,;{}\[\]()]/, Punctuation
20
- rule %r/\/(\\\n)?\/(\n|(.|\n)*?[^\\]\n)/, Comment::Single
20
+ rule %r/\/(\\\n)?\/($|(.|\n)*?[^\\]$)/, Comment::Single
21
21
  rule %r/\/(\\\n)?\*(.|\n)*?\*(\\\n)?\//, Comment::Multiline
22
22
  rule kw, Keyword
23
23
  rule datatype, Keyword::Type
@@ -43,7 +43,7 @@ module Rouge
43
43
  rule %r/'#{idrest}[^']/, Str::Symbol
44
44
  rule %r/[^\S\n]+/, Text
45
45
 
46
- rule %r(//.*?\n), Comment::Single
46
+ rule %r(//.*), Comment::Single
47
47
  rule %r(/\*), Comment::Multiline, :comment
48
48
 
49
49
  rule %r/@#{idrest}/, Name::Decorator
@@ -117,7 +117,7 @@ module Rouge
117
117
  rule %r/\s+/, Text
118
118
  rule %r/{/, Operator, :pop!
119
119
  rule %r/\(/, Operator, :pop!
120
- rule %r(//.*?\n), Comment::Single, :pop!
120
+ rule %r(//.*), Comment::Single, :pop!
121
121
  rule %r(#{idrest}|#{op}+|`[^`]+`), Name::Class, :pop!
122
122
  end
123
123
 
@@ -142,7 +142,7 @@ module Rouge
142
142
  pop!
143
143
  end
144
144
 
145
- rule %r(//.*?\n), Comment::Single, :pop!
145
+ rule %r(//.*), Comment::Single, :pop!
146
146
  rule %r/\.|#{idrest}|#{op}+|`[^`]+`/, Keyword::Type
147
147
  end
148
148
 
@@ -58,7 +58,7 @@ module Rouge
58
58
 
59
59
  state :comments_and_whitespace do
60
60
  rule %r/\s+/, Text
61
- rule %r(#.*?\n), Comment::Single
61
+ rule %r(#.*), Comment::Single
62
62
  rule %r(/(\\\n)?[*].*?[*](\\\n)?/)m, Comment::Multiline
63
63
  end
64
64
 
@@ -0,0 +1,32 @@
1
+ # -*- coding: utf-8 -*- #
2
+ # frozen_string_literal: true
3
+
4
+ module Rouge
5
+ module Lexers
6
+ load_lexer 'c.rb'
7
+
8
+ class Slice < C
9
+ tag 'slice'
10
+ filenames '*.ice'
11
+ mimetypes 'text/slice'
12
+
13
+ title "Slice"
14
+ desc "Specification Language for Ice (doc.zeroc.com)"
15
+
16
+ def self.keywords
17
+ @keywords ||= Set.new %w(
18
+ extends implements enum interface struct class module dictionary
19
+ const optional out throws exception local idempotent sequence
20
+
21
+ Object LocalObject Value
22
+ )
23
+ end
24
+
25
+ def self.keywords_type
26
+ @keywords_type ||= Set.new %w(
27
+ bool string byte long float double int void short
28
+ )
29
+ end
30
+ end
31
+ end
32
+ end
@@ -65,7 +65,7 @@ module Rouge
65
65
 
66
66
  # Preprocessor instructions
67
67
  rule %r"/\*.*?\*/"m, Comment::Multiline
68
- rule %r"//.*\n", Comment::Single
68
+ rule %r"//.*", Comment::Single
69
69
  rule %r"#(define|undef|if(n)?def|else|endif|include)", Comment::Preproc
70
70
  rule %r"\\\r?\n", Comment::Preproc
71
71
  rule %r"__(EVAL|EXEC|LINE__|FILE__)", Name::Builtin
@@ -17,6 +17,12 @@ module Rouge
17
17
  rule %r/\s+/, Text
18
18
  rule %r/#.*?$/, Comment
19
19
  rule %r/(true|false)/, Keyword::Constant
20
+
21
+ rule %r/(\S+)(\s*)(=)(\s*)(\{)/ do |m|
22
+ groups Name::Namespace, Text, Operator, Text, Punctuation
23
+ push :inline
24
+ end
25
+
20
26
  rule %r/(?<!=)\s*\[[\S]+\]/, Name::Namespace
21
27
 
22
28
  rule %r/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z/, Literal::Date
@@ -33,7 +39,6 @@ module Rouge
33
39
  groups Name::Property, Text, Punctuation
34
40
  push :value
35
41
  end
36
-
37
42
  end
38
43
 
39
44
  state :value do
@@ -63,6 +68,16 @@ module Rouge
63
68
  mixin :content
64
69
  rule %r/\]/, Punctuation, :pop!
65
70
  end
71
+
72
+ state :inline do
73
+ mixin :content
74
+
75
+ rule %r/(#{identifier})(\s*)(=)/ do
76
+ groups Name::Property, Text, Punctuation
77
+ end
78
+
79
+ rule %r/\}/, Punctuation, :pop!
80
+ end
66
81
  end
67
82
  end
68
83
  end
@@ -100,7 +100,7 @@ module Rouge
100
100
 
101
101
  state :whitespace do
102
102
  rule %r/\n+/m, Text, :bol
103
- rule %r(//(\\.|.)*?\n), Comment::Single, :bol
103
+ rule %r(//(\\.|.)*?$), Comment::Single, :bol
104
104
  mixin :inline_whitespace
105
105
  end
106
106
 
@@ -3,6 +3,6 @@
3
3
 
4
4
  module Rouge
5
5
  def self.version
6
- "3.13.0"
6
+ "3.14.0"
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rouge
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.13.0
4
+ version: 3.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeanine Adkisson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-11-12 00:00:00.000000000 Z
11
+ date: 2019-12-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments.
14
14
  email:
@@ -130,6 +130,7 @@ files:
130
130
  - lib/rouge/demos/msgtrans
131
131
  - lib/rouge/demos/mxml
132
132
  - lib/rouge/demos/nasm
133
+ - lib/rouge/demos/nesasm
133
134
  - lib/rouge/demos/nginx
134
135
  - lib/rouge/demos/nim
135
136
  - lib/rouge/demos/nix
@@ -167,6 +168,7 @@ files:
167
168
  - lib/rouge/demos/sed
168
169
  - lib/rouge/demos/shell
169
170
  - lib/rouge/demos/sieve
171
+ - lib/rouge/demos/slice
170
172
  - lib/rouge/demos/slim
171
173
  - lib/rouge/demos/smalltalk
172
174
  - lib/rouge/demos/smarty
@@ -331,6 +333,7 @@ files:
331
333
  - lib/rouge/lexers/msgtrans.rb
332
334
  - lib/rouge/lexers/mxml.rb
333
335
  - lib/rouge/lexers/nasm.rb
336
+ - lib/rouge/lexers/nesasm.rb
334
337
  - lib/rouge/lexers/nginx.rb
335
338
  - lib/rouge/lexers/nim.rb
336
339
  - lib/rouge/lexers/nix.rb
@@ -371,6 +374,7 @@ files:
371
374
  - lib/rouge/lexers/sed.rb
372
375
  - lib/rouge/lexers/shell.rb
373
376
  - lib/rouge/lexers/sieve.rb
377
+ - lib/rouge/lexers/slice.rb
374
378
  - lib/rouge/lexers/slim.rb
375
379
  - lib/rouge/lexers/smalltalk.rb
376
380
  - lib/rouge/lexers/smarty.rb