Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package rubygem-rouge for openSUSE:Factory checked in at 2025-03-31 11:42:38 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-rouge (Old) and /work/SRC/openSUSE:Factory/.rubygem-rouge.new.2696 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-rouge" Mon Mar 31 11:42:38 2025 rev:24 rq:1265395 version:4.5.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-rouge/rubygem-rouge.changes 2024-11-07 16:28:22.912130744 +0100 +++ /work/SRC/openSUSE:Factory/.rubygem-rouge.new.2696/rubygem-rouge.changes 2025-03-31 11:43:55.790025833 +0200 @@ -1,0 +2,32 @@ +Wed Jan 29 07:52:09 UTC 2025 - Johannes Kastl <opensuse_buildserv...@ojkastl.de> + +- update to 4.5.1: + * JSON5 Lexer + - Fix prerequisite dependency in JSON5 (#2084 by Tan Le) +- update to 4.5.0: + * General + - Support multiple states when parsing rules (#2078 by Tan + Le) + * COBOL Lexer (NEW) + - Add a lexer, tests and examples for COBOL (#2067 by Bart + Broere) + * Groovy Lexer + - Recognize Nextflow files as Groovy files (#2081 by + Bond-009) + * INI Lexer + - Add more extensions and mimetypes for INI lexer (#2075 by + Tan Le) + - Default .cfg highlight to INI lexer (#2074 by Tan Le) + * Javascript Lexer + - Support private property identifier in JS lexer (#2076 by + Tan Le) + * JSON5 Lexer (NEW) + - implement a json5 lexer (#1561 by Jeanine Adkisson) + * Ruby Lexer + - Recognize Thor files as Ruby files (#2080 by Vitaly + Slobodin) + * Terraform Lexer + - Support special escape sequences in Terraform (#2073 by Tan + Le) + +------------------------------------------------------------------- Old: ---- rouge-4.4.0.gem New: ---- rouge-4.5.1.gem rouge-4.5.1.gem.sha256 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-rouge.spec ++++++ --- /var/tmp/diff_new_pack.UIESNx/_old 2025-03-31 11:43:56.382050399 +0200 +++ /var/tmp/diff_new_pack.UIESNx/_new 2025-03-31 11:43:56.382050399 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-rouge # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -24,7 +24,7 @@ # Name: rubygem-rouge -Version: 4.4.0 +Version: 4.5.1 Release: 0 %define mod_name rouge %define mod_full_name %{mod_name}-%{version} @@ -34,7 +34,8 @@ BuildRequires: update-alternatives URL: http://rouge.jneen.net/ Source: https://rubygems.org/gems/%{mod_full_name}.gem -Source1: gem2rpm.yml +Source1: rouge-4.5.1.gem.sha256 +Source2: gem2rpm.yml Summary: A pure-ruby colorizer based on pygments License: BSD-2-Clause OR MIT ++++++ gem2rpm.yml ++++++ --- /var/tmp/diff_new_pack.UIESNx/_old 2025-03-31 11:43:56.422052058 +0200 +++ /var/tmp/diff_new_pack.UIESNx/_new 2025-03-31 11:43:56.426052225 +0200 @@ -21,9 +21,10 @@ # ## used by gem2rpm # :patches: # foo.patch: -p1 -# bar.patch: +# bar.patch: # ## used by gem2rpm :sources: + - rouge-4.5.1.gem.sha256 # - foo.desktop # - bar.desktop # :gem_install_args: '....' ++++++ rouge-4.4.0.gem -> rouge-4.5.1.gem ++++++ Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/demos/cobol new/lib/rouge/demos/cobol --- old/lib/rouge/demos/cobol 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rouge/demos/cobol 2024-11-12 00:02:35.000000000 +0100 @@ -0,0 +1,103 @@ + *----------------------- + * This file was sourced from https://github.com/openmainframeproject/cobol-programming-course + * Credits: + * The course materials were made available through a joint collaboration between IBM, its clients, and + * American River College and proposed as a new project by IBM. + *----------------------- + * Copyright Contributors to the COBOL Programming Course + * SPDX-License-Identifier: CC-BY-4.0 + *----------------------- + IDENTIFICATION DIVISION. + *----------------------- + PROGRAM-ID. CBL0001 + AUTHOR. Otto B. Fun. + *-------------------- + ENVIRONMENT DIVISION. + *-------------------- + INPUT-OUTPUT SECTION. + FILE-CONTROL. + SELECT PRINT-LINE ASSIGN TO PRTLINE. + SELECT ACCT-REC ASSIGN TO ACCTREC. + *SELECT clause creates an internal file name + *ASSIGN clause creates a name for an external data source, + *which is associated with the JCL DDNAME used by the z/OS + *e.g. ACCTREC is linked in JCL file CBL0001J to &SYSUID..DATA + *where &SYSUID. stands for Your z/OS user id + *e.g. if Your user id is Z54321, + *the data set used for ACCTREC is Z54321.DATA + *------------- + DATA DIVISION. + *------------- + FILE SECTION. + FD PRINT-LINE RECORDING MODE F. + 01 PRINT-REC. + 05 ACCT-NO-O PIC X(8). + 05 ACCT-LIMIT-O PIC $$,$$$,$$9.99. + 05 ACCT-BALANCE-O PIC $$,$$$,$$9.99. + * PIC $$,$$$,$$9.99 -- Alternative for PIC on chapter 7.2.3, + * using $ to allow values of different amounts of digits + * and .99 instead of v99 to allow period display on output + 05 LAST-NAME-O PIC X(20). + 05 FIRST-NAME-O PIC X(15). + 05 COMMENTS-O PIC X(50). + * since the level 05 is higher than level 01, + * all variables belong to PRINT-REC (see chapter 7.3.3) + * + FD ACCT-REC RECORDING MODE F. + 01 ACCT-FIELDS. + 05 ACCT-NO PIC X(8). + 05 ACCT-LIMIT PIC S9(7)V99 COMP-3. + 05 ACCT-BALANCE PIC S9(7)V99 COMP-3. + * PIC S9(7)v99 -- seven-digit plus a sign digit value + * COMP-3 -- packed BCD (binary coded decimal) representation + 05 LAST-NAME PIC X(20). + 05 FIRST-NAME PIC X(15). + 05 CLIENT-ADDR. + 10 STREET-ADDR PIC X(25). + 10 CITY-COUNTY PIC X(20). + 10 USA-STATE PIC X(15). + 05 RESERVED PIC X(7). + 05 COMMENTS PIC X(50). + * + WORKING-STORAGE SECTION. + 01 FLAGS. + 05 LASTREC PIC X VALUE SPACE. + *------------------ + PROCEDURE DIVISION. + *------------------ + OPEN-FILES. + OPEN INPUT ACCT-REC. + OPEN OUTPUT PRINT-LINE. + * + READ-NEXT-RECORD. + PERFORM READ-RECORD + * The previous statement is needed before entering the loop. + * Both the loop condition LASTREC = 'Y' + * and the call to WRITE-RECORD depend on READ-RECORD having + * been executed before. + * The loop starts at the next line with PERFORM UNTIL + PERFORM UNTIL LASTREC = 'Y' + PERFORM WRITE-RECORD + PERFORM READ-RECORD + END-PERFORM + . + * + CLOSE-STOP. + CLOSE ACCT-REC. + CLOSE PRINT-LINE. + GOBACK. + * + READ-RECORD. + READ ACCT-REC + AT END MOVE 'Y' TO LASTREC + END-READ. + * + WRITE-RECORD. + MOVE ACCT-NO TO ACCT-NO-O. + MOVE ACCT-LIMIT TO ACCT-LIMIT-O. + MOVE ACCT-BALANCE TO ACCT-BALANCE-O. + MOVE LAST-NAME TO LAST-NAME-O. + MOVE FIRST-NAME TO FIRST-NAME-O. + MOVE COMMENTS TO COMMENTS-O. + WRITE PRINT-REC. + * diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/demos/json5 new/lib/rouge/demos/json5 --- old/lib/rouge/demos/json5 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rouge/demos/json5 2024-11-12 00:02:35.000000000 +0100 @@ -0,0 +1,12 @@ +{ + // comments + unquoted: 'and you can quote me on that', + singleQuotes: 'I can use "double quotes" here', + lineBreaks: "Look, Mom! \ +No \\n's!", + hexadecimal: 0xdecaf, + leadingDecimalPoint: .8675309, andTrailing: 8675309., + positiveSign: +1, + trailingComma: 'in objects', andIn: ['arrays',], + "backwardsCompatible": "with JSON", +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/guessers/disambiguation.rb new/lib/rouge/guessers/disambiguation.rb --- old/lib/rouge/guessers/disambiguation.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/guessers/disambiguation.rb 2024-11-12 00:02:35.000000000 +0100 @@ -66,6 +66,12 @@ end end + disambiguate '*.cfg' do + next CiscoIos if matches?(/\A\s*(version|banner|interface)\b/) + + INI + end + disambiguate '*.pl' do next Perl if contains?('my $') next Prolog if contains?(':-') diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/cobol.rb new/lib/rouge/lexers/cobol.rb --- old/lib/rouge/lexers/cobol.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rouge/lexers/cobol.rb 2024-11-12 00:02:35.000000000 +0100 @@ -0,0 +1,137 @@ +# -*- coding: utf-8 -*- # +# frozen_string_literal: true + +module Rouge + module Lexers + class COBOL < RegexLexer + title 'COBOL' + desc 'COBOL (Common Business-Oriented Language) programming language' + tag 'cobol' + filenames '*.cob', '*.cbl' + mimetypes 'text/x-cobol' + + identifier = /\p{Alpha}[\p{Alnum}-]*/ + + def self.divisions + @divisions ||= %w( + IDENTIFICATION ENVIRONMENT DATA PROCEDURE DIVISION + ) + end + + def self.sections + @sections ||= %w( + CONFIGURATION INPUT-OUTPUT FILE WORKING-STORAGE LOCAL-STORAGE LINKAGE SECTION + ) + end + + # List of COBOL keywords + # sourced from https://www.ibm.com/docs/en/cobol-zos/6.4?topic=appendixes-reserved-words + def self.keywords + @keywords ||= Set.new(%w( + ACCEPT ACCESS ACTIVE-CLASS ADD ADDRESS ADVANCING AFTER ALIGNED ALL ALLOCATE ALPHABET ALPHABETIC ALPHABETIC-LOWER + ALPHABETIC-UPPER ALPHANUMERIC ALPHANUMERIC-EDITED ALSO ALTER ALTERNATE AND ANYCASE ANY APPLY ARE AREA AREAS + ASCENDING ASSIGN AT AUTHOR B-AND B-NOT B-OR B-XOR BASED BASIS BEFORE BEGINNING BINARY BINARY-CHAR BINARY-DOUBLE + BINARY-LONG BINARY-SHORT BIT BLANK BLOCK BOOLEAN BOTTOM BY BYTE-LENGTH CALL CANCEL CBL CD CF CH CHARACTER + CHARACTERS CLASS CLASS-ID CLOCK-UNITS CLOSE COBOL CODE CODE-SET COL COLLATING COLS COLUMN COLUMNS COM-REG COMMA + COMMON COMMUNICATION COMP-1 COMP-2 COMP-3 COMP-4 COMP-5 COMP COMPUTATIONAL-1 COMPUTATIONAL-2 + COMPUTATIONAL-3 COMPUTATIONAL-4 COMPUTATIONAL-5 COMPUTATIONAL COMPUTE CONDITION CONSTANT CONTAINS CONTENT + CONTINUE CONTROL CONTROLS CONVERTING COPY CORR CORRESPONDING COUNT CRT CURRENCY CURSOR DATA-POINTER DATE + DATE-COMPILED DATE-WRITTEN DAY DAY-OF-WEEK DBCS DE DEBUG-CONTENTS DEBUG-ITEM DEBUG-LINE DEBUG-NAME DEBUG-SUB-1 + DEBUG-SUB-2 DEBUG-SUB-3 DEBUGGING DECIMAL-POINT DECLARATIVES DEFAULT DELETE DELIMITED DELIMITER DEPENDING + DESCENDING DESTINATION DETAIL DISABLE DISPLAY-1 DISPLAY DIVIDE DOWN DUPLICATES DYNAMIC EC EGCS EGI + EJECT ELSE EMI ENABLE END-ACCEPT END-ADD END-CALL END-COMPUTE END-DELETE END-DISPLAY END-DIVIDE END-EVALUATE + END-EXEC END-IF END-INVOKE END-JSON END-MULTIPLY END-OF-PAGE END-PERFORM END-READ END-RECEIVE END-RETURN + END-REWRITE END-SEARCH END-START END-STRING END-SUBTRACT END-UNSTRING END-WRITE END-XML ENDING END ENTER ENTRY + EO EOP EQUAL ERROR ESI EVALUATE EVERY EXCEPTION EXCEPTION-OBJECT EXEC EXECUTE EXIT EXTEND EXTERNAL + FACTORY FALSE FD FILE-CONTROL FILLER FINAL FIRST FLOAT-EXTENDED FLOAT-LONG FLOAT-SHORT FOOTING FOR FORMAT + FREE FROM FUNCTION FUNCTION-ID FUNCTION-POINTER GENERATE GET GIVING GLOBAL GO GOBACK GREATER GROUP GROUP-USAGE + HEADING HIGH-VALUE HIGH-VALUES I-O-CONTROL I-O ID IF IN INDEX INDEXED INDICATE INHERITS INITIAL + INITIALIZE INITIATE INPUT INSERT INSPECT INSTALLATION INTERFACE INTERFACE-ID INTO INVALID INVOKE + IS JAVA JNIENVPTR JSON JSON-CODE JSON-STATUS JUST JUSTIFIED KANJI KEY LABEL LAST LEADING LEFT LENGTH LESS LIMIT + LIMITS LINAGE-COUNTER LINAGE LINE-COUNTER LINES LINE LOCALE LOCK LOW-VALUE LOW-VALUES + MEMORY MERGE MESSAGE METHOD METHOD-ID MINUS MODE MODULES MORE-LABELS MOVE MULTIPLE MULTIPLY NATIONAL + NATIONAL-EDITED NATIVE NEGATIVE NESTED NEXT NO NOT NULL NULLS NUMBER NUMERIC NUMERIC-EDITED OBJECT + OBJECT-COMPUTER OBJECT-REFERENCE OCCURS OF OFF OMITTED ON OPEN OPTIONAL OPTIONS OR ORDER ORGANIZATION + OTHER OUTPUT OVERFLOW OVERRIDE PACKED-DECIMAL PADDING PAGE PAGE-COUNTER PASSWORD PERFORM PF PH PIC PICTURE + PLUS POINTER- POINTER-31 POINTER-32 POINTER-64 POINTER POSITION POSITIVE PRESENT PRINTING + PROCEDURE-POINTER PROCEDURES PROCEED PROCESSING PROGRAM-ID PROGRAM-POINTER PROGRAM PROPERTY PROTOTYPE + PURGE QUEUE QUOTE QUOTES RAISE RAISING RANDOM RD READ READY RECEIVE RECORD RECORDING RECORDS RECURSIVE REDEFINES + REEL REFERENCE REFERENCES RELATIVE RELEASE RELOAD REMAINDER REMOVAL RENAMES REPLACE REPLACING REPORT REPORTING + REPORTS REPOSITORY RERUN RESERVE RESET RESUME RETRY RETURN RETURN-CODE RETURNING REVERSED REWIND REWRITE RF RH + RIGHT ROUNDED RUN SAME SCREEN SD SEARCH SECTION SECURITY SEGMENT SEGMENT-LIMIT SELECT SELF SEND SENTENCE + SEPARATE SEQUENCE SEQUENTIAL SERVICE SET SHARING SHIFT-IN SHIFT-OUT SIGN SIZE SKIP1 SKIP2 SKIP3 + SORT-CONTROL SORT-CORE-SIZE SORT-FILE-SIZE SORT-MERGE SORT-MESSAGE SORT-MODE-SIZE SORT-RETURN SORT + SOURCE-COMPUTER SOURCES SOURCE SPACE SPACES SPECIAL-NAMES SQL SQLIMS STANDARD-1 STANDARD-2 STANDARD START STATUS STOP + STRING SUB-QUEUE-1 SUB-QUEUE-2 SUB-QUEUE-3 SUBTRACT SUM SUPER SUPPRESS SYMBOLIC SYNC SYNCHRONIZED SYSTEM-DEFAULT + TABLE TALLY TALLYING TAPE TERMINAL TERMINATE TEST TEXT THAN THEN THROUGH THRU TIME TIMES TITLE TO TOP TRACE + TRAILING TRUE TYPE TYPEDEF UNIT UNIVERSAL UNLOCK UNSTRING UNTIL UP UPON USAGE USE USER-DEFAULT USING UTF-8 + VAL-STATUS VALID VALIDATE VALIDATE-STATUS VALUE VALUES VARYING VOLATILE WHEN WHEN-COMPILED WITH WORDS + WRITE WRITE-ONLY XML-CODE XML-EVENT XML-INFORMATION XML-NAMESPACE XML-NAMESPACE-PREFIX + XML-NNAMESPACE XML-NNAMESPACE-PREFIX XML-NTEXT XML-SCHEMA XML-TEXT XML ZERO ZEROES ZEROS + )) + end + + state :root do + # First detect the comments + rule %r/^( \*).*|^(^Debug \*).*/, Comment::Special + + # Strings + rule %r/"/, Str::Double, :string_double + rule %r/'/, Str::Single, :string_single + + # Keywords and divisions + rule %r/(?<![\w-])#{identifier}(?![\w-])/i do |m| + if self.class.divisions.include?(m[0].upcase) + token Keyword::Declaration + elsif self.class.sections.include?(m[0].upcase) + token Keyword::Namespace + elsif self.class.keywords.include?(m[0].upcase) + token Keyword + else + token Name + end + end + + # Numbers + rule %r/[-+]?\b\d+(\.\d+)?\b/, Num + + # Punctuation + rule %r/[.,;:()]/, Punctuation + + # Comments + rule %r/\*>.*/, Comment::Single + + # Operators + rule %r/[+\-*\/><=]/, Operator + + # Whitespace remaining + rule %r/\s/, Text::Whitespace + + # Anything else remaining + rule %r/.+/, Text + end + + # TODO double check string escaping in COBOL + # TODO Fix that a string opened by " can't be closed by ' + # TODO Fix that strings can't be multi-line + + # Handle strings where " opens a string and must be closed by " + state :string_double do + # Ensure strings can't span multiple lines + rule %r/[^"\\\n]+/, Str + rule %r/\\./, Str::Escape + rule %r/"/, Str::Double, :pop! + rule %r/\n/, Error # Flag an error if a string goes to the next line + end + + # Handle strings where ' opens a string and must be closed by ' + state :string_single do + # Ensure strings can't span multiple lines + rule %r/[^'\\\n]+/, Str + rule %r/\\./, Str::Escape + rule %r/'/, Str::Single, :pop! + rule %r/\n/, Error # Flag an error if a string goes to the next line + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/groovy.rb new/lib/rouge/lexers/groovy.rb --- old/lib/rouge/lexers/groovy.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/lexers/groovy.rb 2024-11-12 00:02:35.000000000 +0100 @@ -7,11 +7,13 @@ title "Groovy" desc 'The Groovy programming language (http://www.groovy-lang.org/)' tag 'groovy' - filenames '*.groovy', 'Jenkinsfile', '*.Jenkinsfile' + aliases 'nextflow', 'nf' + filenames '*.groovy', 'Jenkinsfile', '*.Jenkinsfile', '*.nf' mimetypes 'text/x-groovy' def self.detect?(text) return true if text.shebang?(/groovy/) + return true if text.shebang?(/nextflow/) end def self.keywords diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/ini.rb new/lib/rouge/lexers/ini.rb --- old/lib/rouge/lexers/ini.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/lexers/ini.rb 2024-11-12 00:02:35.000000000 +0100 @@ -8,9 +8,8 @@ desc 'the INI configuration format' tag 'ini' - # TODO add more here - filenames '*.ini', '*.INI', '*.gitconfig' - mimetypes 'text/x-ini' + filenames '*.ini', '*.INI', '*.gitconfig', '*.cfg', '.editorconfig', '*.inf' + mimetypes 'text/x-ini', 'text/inf' identifier = /[\w\-.]+/ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/javascript.rb new/lib/rouge/lexers/javascript.rb --- old/lib/rouge/lexers/javascript.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/lexers/javascript.rb 2024-11-12 00:02:35.000000000 +0100 @@ -190,8 +190,8 @@ rule %r/function(?=(\(.*\)))/, Keyword::Declaration # For anonymous functions - rule %r/(#{id})[ \t]*(?=(\(.*\)))/m do |m| - if self.class.keywords.include? m[1] + rule %r/(#?#{id})[ \t]*(?=(\(.*\)))/m do |m| + if self.class.keywords.include?(m[1]) # "if" in "if (...)" or "switch" in "switch (...)" are recognized as keywords. token Keyword else @@ -201,7 +201,7 @@ rule %r/[{}]/, Punctuation, :statement - rule id do |m| + rule %r/#?#{id}/ do |m| if self.class.keywords.include? m[0] token Keyword push :expr_start diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/json5.rb new/lib/rouge/lexers/json5.rb --- old/lib/rouge/lexers/json5.rb 1970-01-01 01:00:00.000000000 +0100 +++ new/lib/rouge/lexers/json5.rb 2024-11-12 00:02:35.000000000 +0100 @@ -0,0 +1,74 @@ +# -*- coding: utf-8 -*- # +# frozen_string_literal: true + +module Rouge + module Lexers + load_lexer 'json.rb' + + class JSON5 < JSON + title 'JSON 5' + tag 'json5' + filenames '*.json5' + mimetypes 'application/json5', 'application/x-json5' + + desc 'JSON 5 extension for JSON (json5.org)' + + append :whitespace do + rule %r://.*$:, Comment + + # comments are non-nesting, so a single regex will do + rule %r:/[*].*?[*]/:m, Comment + end + + prepend :name do + rule Javascript.id_regex, Name::Label + rule %r/".*?"/, Name::Label + end + + # comments can appear between keys and :, so we have to + # manage our states a little more carefully + append :object do + rule %r/:/ do + token Punctuation + goto :object_value + end + end + + state :object_value do + mixin :value + rule %r/,/ do + token Punctuation + goto :object + end + + rule %r/}/, Punctuation, :pop! + end + + append :value do + rule %r/'/, Str::Single, :sstring + end + + state :sstring do + rule %r/[^\\']+/, Str::Single + rule %r/\\./m, Str::Escape + rule %r/'/, Str::Single, :pop! + end + + # can escape newlines + append :string do + rule %r/\\./m, Str::Escape + end + + # override: numbers are very different in json5 + state :constants do + rule %r/\b(?:true|false|null)\b/, Keyword::Constant + rule %r/[+-]?\b(?:Infinity|NaN)\b/, Keyword::Constant + rule %r/[+-]?0x\h+/i, Num::Hex + + rule %r/[+-.]?[0-9]+[.]?[0-9]?([eE][-]?[0-9]+)?/i, Num::Float + rule %r/[+-]?\d+e[+-]?\d+/, Num::Integer + rule %r/[+-]?(?:0|[1-9]\d*)(?:e[+-]?\d+)?/i, Num::Integer + end + end + end +end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/ruby.rb new/lib/rouge/lexers/ruby.rb --- old/lib/rouge/lexers/ruby.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/lexers/ruby.rb 2024-11-12 00:02:35.000000000 +0100 @@ -11,7 +11,7 @@ filenames '*.rb', '*.ruby', '*.rbw', '*.rake', '*.gemspec', '*.podspec', 'Rakefile', 'Guardfile', 'Gemfile', 'Capfile', 'Podfile', 'Vagrantfile', '*.ru', '*.prawn', 'Berksfile', '*.arb', - 'Dangerfile', 'Fastfile', 'Deliverfile', 'Appfile' + 'Dangerfile', 'Fastfile', 'Deliverfile', 'Appfile', '*.thor', 'Thorfile' mimetypes 'text/x-ruby', 'application/x-ruby' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/lexers/terraform.rb new/lib/rouge/lexers/terraform.rb --- old/lib/rouge/lexers/terraform.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/lexers/terraform.rb 2024-11-12 00:02:35.000000000 +0100 @@ -39,8 +39,9 @@ state :strings do rule %r/\\./, Str::Escape + rule %r/(\$[\$]+|%[%]+)(\{)/, Str rule %r/\$\{/ do - token Keyword + token Punctuation push :interpolation end end @@ -66,7 +67,7 @@ state :interpolation do rule %r/\}/ do - token Keyword + token Punctuation pop! end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/regex_lexer.rb new/lib/rouge/regex_lexer.rb --- old/lib/rouge/regex_lexer.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/regex_lexer.rb 2024-11-12 00:02:35.000000000 +0100 @@ -166,6 +166,19 @@ puts " yielding: #{tok.qualname}, #{stream[0].inspect}" if @debug @output_stream.call(tok, stream[0]) end + when Array + proc do |stream| + puts " yielding: #{tok.qualname}, #{stream[0].inspect}" if @debug + @output_stream.call(tok, stream[0]) + for i_next_state in next_state do + next @stack.pop if i_next_state == :pop! + next @stack.push(@stack.last) if i_next_state == :push + + state = @states[i_next_state] || self.class.get_state(i_next_state) + puts " pushing :#{state.name}" if @debug + @stack.push(state) + end + end else raise "invalid next state: #{next_state.inspect}" end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/rouge/version.rb new/lib/rouge/version.rb --- old/lib/rouge/version.rb 2024-09-17 02:56:15.000000000 +0200 +++ new/lib/rouge/version.rb 2024-11-12 00:02:35.000000000 +0100 @@ -3,6 +3,6 @@ module Rouge def self.version - "4.4.0" + "4.5.1" end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2024-09-17 02:56:15.000000000 +0200 +++ new/metadata 2024-11-12 00:02:35.000000000 +0100 @@ -1,14 +1,14 @@ --- !ruby/object:Gem::Specification name: rouge version: !ruby/object:Gem::Version - version: 4.4.0 + version: 4.5.1 platform: ruby authors: - Jeanine Adkisson autorequire: bindir: bin cert_chain: [] -date: 2024-09-17 00:00:00.000000000 Z +date: 2024-11-11 00:00:00.000000000 Z dependencies: [] description: Rouge aims to a be a simple, easy-to-extend drop-in replacement for pygments. email: @@ -49,6 +49,7 @@ - lib/rouge/demos/clojure - lib/rouge/demos/cmake - lib/rouge/demos/cmhg +- lib/rouge/demos/cobol - lib/rouge/demos/codeowners - lib/rouge/demos/coffeescript - lib/rouge/demos/common_lisp @@ -125,6 +126,7 @@ - lib/rouge/demos/jsl - lib/rouge/demos/json - lib/rouge/demos/json-doc +- lib/rouge/demos/json5 - lib/rouge/demos/jsonnet - lib/rouge/demos/jsp - lib/rouge/demos/jsx @@ -295,6 +297,7 @@ - lib/rouge/lexers/clojure.rb - lib/rouge/lexers/cmake.rb - lib/rouge/lexers/cmhg.rb +- lib/rouge/lexers/cobol.rb - lib/rouge/lexers/codeowners.rb - lib/rouge/lexers/coffeescript.rb - lib/rouge/lexers/common_lisp.rb @@ -371,6 +374,7 @@ - lib/rouge/lexers/jinja.rb - lib/rouge/lexers/jsl.rb - lib/rouge/lexers/json.rb +- lib/rouge/lexers/json5.rb - lib/rouge/lexers/json_doc.rb - lib/rouge/lexers/jsonnet.rb - lib/rouge/lexers/jsp.rb @@ -553,7 +557,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubygems_version: 3.5.3 +rubygems_version: 3.5.19 signing_key: specification_version: 4 summary: A pure-ruby colorizer based on pygments ++++++ rouge-4.5.1.gem.sha256 ++++++ 2ac81c6dee7019bbc6600d4c2d641d730d65c165941400ebd924259067e690dd rouge-4.5.1.gem