Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Duplicate identity Keyword in YANG Lexer #1499

Merged
merged 2 commits into from Apr 14, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions lib/rouge/lexers/yang.rb
Expand Up @@ -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

Expand All @@ -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

Expand All @@ -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

Expand Down