# -*- coding: utf-8 -*- ## frozen_string_literal: truemoduleRougemoduleLexersclassSyzprog<RegexLexertitle"Syzprog"desc"Program description language used by syzkaller"tag'syzprog'defself.keywords@keywords||=Set.new%w(
ANY ANYBLOB ANYPTR ANYPTR64 ANYPTRS ANYRES16 ANYRES32 ANYRES64
ANYRESDEC ANYRESHEX ANYRESOCT ANYUNION AUTO false nil true void
async fail_nth rerun
)endcomment=/#.*$/inline_spaces=/[ \t]+/eol_spaces=/[\n\r]+/spaces=/\s+/id=/[a-zA-Z_][a-zA-Z0-9_]*/num_id=/[a-zA-Z0-9_]+/res_id=/r[0-9]+/state:inline_breakdoruleinline_spaces,Textrule%r//,Text,:pop!endstate:eol_breakdoruleeol_spaces,Textrulecomment,Commentrule%r//,Text,:pop!endstate:space_breakdorulespaces,Textrulecomment,Commentrule%r//,Text,:pop!endstate:mixin_numberdorule%r/-?0x[\da-f]+/i,Num::Hexrule%r/-?\d+/,Num::Integerendstate:mixin_stringdorule%r/"[^"]*"/,Str::Doublerule%r/`[^`]*`/,Str::Backtickrule%r/'[^']*'/,Str::Singleendstate:mixin_termdomixin:mixin_numbermixin:mixin_stringrule%r/#{res_id}/,Keyword::Pseudoruleiddo|m|ifself.class.keywords.include?(m[0])tokenKeywordelsetokenNameendendendstate:mods_listdorulespaces,Textrulecomment,Commentmixin:mixin_termrule%r/[,:]/,Punctuationrule%r/\)/,Punctuation,:pop!endstate:syscall_modsdorule%r/\(/,Punctuation,:mods_listrule%r//,Text,:pop!endstate:syscall_argsdorulespaces,Textrulecomment,Commentmixin:mixin_termmixin:mixin_numbermixin:mixin_string# This punctuation is a part of the syntax:rule%r/[@&=,<>{}\[\]]/,Punctuation# This punctuation is not, highlight just in case:rule%r/[!#\$%\^\*\-\+\/\|~:;.\?]/,Punctuationrule%r/\(/,Punctuation,:syscall_argsrule%r/\)/,Punctuation,:pop!endstate:rootdo# Whitespace.rulespaces,Text# Comments.rulecomment,Comment# Return values.rule%r/(#{res_id})(#{spaces})(=)/dogroupsKeyword::Pseudo,Text,Punctuationend# Syscalls.rule%r/(#{id})(\$)?(#{num_id})?(#{spaces})?(\()/do|m|groupsName::Function,Punctuation,Name::Function::Magic,Text,Punctuationpush:syscall_modspush:inline_breakpush:syscall_argspush:space_breakendendendendend