codigo0/node_modules/highlight.js/lib/languages/protobuf.js
planetazuzu 5d7a6500fe refactor: Fase 1 - Clean Architecture, refactorización modular y eliminación de duplicidades
-  Ticket 1.1: Estructura Clean Architecture en backend
-  Ticket 1.2: Schemas Zod compartidos
-  Ticket 1.3: Refactorización drugs.ts (1362 → 8 archivos modulares)
-  Ticket 1.4: Refactorización procedures.ts (3583 → 6 archivos modulares)
-  Ticket 1.5: Eliminación de duplicidades (~50 líneas)

Cambios principales:
- Creada estructura Clean Architecture en backend/src/
- Schemas Zod compartidos en backend/src/shared/schemas/
- Refactorización modular de drugs y procedures
- Utilidades genéricas en src/utils/ (filter, validation)
- Eliminados scripts obsoletos y documentación antigua
- Corregidos errores: QueryClient, import test-error-handling
- Build verificado y funcionando correctamente
2026-01-25 21:09:47 +01:00

80 lines
1.4 KiB
JavaScript

/*
Language: Protocol Buffers
Author: Dan Tao <daniel.tao@gmail.com>
Description: Protocol buffer message definition format
Website: https://developers.google.com/protocol-buffers/docs/proto3
Category: protocols
*/
function protobuf(hljs) {
const KEYWORDS = [
"package",
"import",
"option",
"optional",
"required",
"repeated",
"group",
"oneof"
];
const TYPES = [
"double",
"float",
"int32",
"int64",
"uint32",
"uint64",
"sint32",
"sint64",
"fixed32",
"fixed64",
"sfixed32",
"sfixed64",
"bool",
"string",
"bytes"
];
const CLASS_DEFINITION = {
match: [
/(message|enum|service)\s+/,
hljs.IDENT_RE
],
scope: {
1: "keyword",
2: "title.class"
}
};
return {
name: 'Protocol Buffers',
aliases: ['proto'],
keywords: {
keyword: KEYWORDS,
type: TYPES,
literal: [
'true',
'false'
]
},
contains: [
hljs.QUOTE_STRING_MODE,
hljs.NUMBER_MODE,
hljs.C_LINE_COMMENT_MODE,
hljs.C_BLOCK_COMMENT_MODE,
CLASS_DEFINITION,
{
className: 'function',
beginKeywords: 'rpc',
end: /[{;]/,
excludeEnd: true,
keywords: 'rpc returns'
},
{ // match enum items (relevance)
// BLAH = ...;
begin: /^\s*[A-Z_]+(?=\s*=[^\n]+;$)/ }
]
};
}
module.exports = protobuf;