From 45c54467ae7864e397bd6196dbd48d63a9f4e1bd Mon Sep 17 00:00:00 2001 From: GRIBOK <40306040+gribok@users.noreply.github.com> Date: Tue, 14 Apr 2020 09:00:46 +0200 Subject: [PATCH] Remove duplicate identity keyword in YANG Lexer (#1499) This commit alphabetises all of the keywords and removes a duplicate entry for `identity`. Co-authored-by: Michael Camilleri --- lib/rouge/lexers/yang.rb | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/lib/rouge/lexers/yang.rb b/lib/rouge/lexers/yang.rb index 7b5ba66ca2..ce237e7705 100644 --- a/lib/rouge/lexers/yang.rb +++ b/lib/rouge/lexers/yang.rb @@ -21,13 +21,13 @@ module submodule def self.module_header_stmts_keywords @module_header_stmts_keywords ||= Set.new %w( - yang-version namespace prefix belongs-to + belongs-to namespace prefix yang-version ) end def self.meta_stmts_keywords @meta_stmts_keywords ||= Set.new %w( - organization contact description reference revision + contact description organization reference revision ) end @@ -39,23 +39,23 @@ def self.linkage_stmts_keywords def self.body_stmts_keywords @body_stms_keywords ||= Set.new %w( - extension feature identity typedef grouping augment rpc notification - deviation action argument identity if-feature input output + action argument augment deviation extension feature grouping identity + if-feature input notification output rpc typedef ) end def self.data_def_stmts_keywords @data_def_stms_keywords ||= Set.new %w( - container leaf-list leaf list choice anydata anyxml uses case config - deviate must when presence refine + anydata anyxml case choice config container deviate leaf leaf-list + list must presence refine uses when ) end def self.type_stmts_keywords @type_stmts_keywords ||= Set.new %w( - type units default status bit enum error-app-tag error-message - fraction-digits length min-elements max-elements modifier ordered-by - path pattern position range require-instance value yin-element base + base bit default enum error-app-tag error-message fraction-digits + length max-elements min-elements modifier ordered-by path pattern + position range require-instance status type units value yin-element ) end @@ -68,17 +68,17 @@ def self.list_stmts_keywords #RFC7950 other keywords def self.constants_keywords @constants_keywords ||= Set.new %w( - true false current obsolete deprecated add delete replace - not-supported invert-match max min unbounded user + add current delete deprecated false invert-match max min + not-supported obsolete replace true unbounded user ) end #RFC7950 Built-In Types def self.types @types ||= Set.new %w( - binary bits boolean decimal64 empty enumeration int8 int16 int32 - int64 string uint8 uint16 uint32 uint64 union leafref identityref - instance-identifier + binary bits boolean decimal64 empty enumeration identityref + instance-identifier int16 int32 int64 int8 leafref string uint16 + uint32 uint64 uint8 union ) end