arduino.js 20 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006
  1. /*
  2. Language: C++
  3. Category: common, system
  4. Website: https://isocpp.org
  5. */
  6. /** @type LanguageFn */
  7. function cPlusPlus(hljs) {
  8. const regex = hljs.regex;
  9. // added for historic reasons because `hljs.C_LINE_COMMENT_MODE` does
  10. // not include such support nor can we be sure all the grammars depending
  11. // on it would desire this behavior
  12. const C_LINE_COMMENT_MODE = hljs.COMMENT('//', '$', { contains: [ { begin: /\\\n/ } ] });
  13. const DECLTYPE_AUTO_RE = 'decltype\\(auto\\)';
  14. const NAMESPACE_RE = '[a-zA-Z_]\\w*::';
  15. const TEMPLATE_ARGUMENT_RE = '<[^<>]+>';
  16. const FUNCTION_TYPE_RE = '(?!struct)('
  17. + DECLTYPE_AUTO_RE + '|'
  18. + regex.optional(NAMESPACE_RE)
  19. + '[a-zA-Z_]\\w*' + regex.optional(TEMPLATE_ARGUMENT_RE)
  20. + ')';
  21. const CPP_PRIMITIVE_TYPES = {
  22. className: 'type',
  23. begin: '\\b[a-z\\d_]*_t\\b'
  24. };
  25. // https://en.cppreference.com/w/cpp/language/escape
  26. // \\ \x \xFF \u2837 \u00323747 \374
  27. const CHARACTER_ESCAPES = '\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)';
  28. const STRINGS = {
  29. className: 'string',
  30. variants: [
  31. {
  32. begin: '(u8?|U|L)?"',
  33. end: '"',
  34. illegal: '\\n',
  35. contains: [ hljs.BACKSLASH_ESCAPE ]
  36. },
  37. {
  38. begin: '(u8?|U|L)?\'(' + CHARACTER_ESCAPES + '|.)',
  39. end: '\'',
  40. illegal: '.'
  41. },
  42. hljs.END_SAME_AS_BEGIN({
  43. begin: /(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,
  44. end: /\)([^()\\ ]{0,16})"/
  45. })
  46. ]
  47. };
  48. const NUMBERS = {
  49. className: 'number',
  50. variants: [
  51. // Floating-point literal.
  52. { begin:
  53. "[+-]?(?:" // Leading sign.
  54. // Decimal.
  55. + "(?:"
  56. +"[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?"
  57. + "|\\.[0-9](?:'?[0-9])*"
  58. + ")(?:[Ee][+-]?[0-9](?:'?[0-9])*)?"
  59. + "|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*"
  60. // Hexadecimal.
  61. + "|0[Xx](?:"
  62. +"[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?"
  63. + "|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*"
  64. + ")[Pp][+-]?[0-9](?:'?[0-9])*"
  65. + ")(?:" // Literal suffixes.
  66. + "[Ff](?:16|32|64|128)?"
  67. + "|(BF|bf)16"
  68. + "|[Ll]"
  69. + "|" // Literal suffix is optional.
  70. + ")"
  71. },
  72. // Integer literal.
  73. { begin:
  74. "[+-]?\\b(?:" // Leading sign.
  75. + "0[Bb][01](?:'?[01])*" // Binary.
  76. + "|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*" // Hexadecimal.
  77. + "|0(?:'?[0-7])*" // Octal or just a lone zero.
  78. + "|[1-9](?:'?[0-9])*" // Decimal.
  79. + ")(?:" // Literal suffixes.
  80. + "[Uu](?:LL?|ll?)"
  81. + "|[Uu][Zz]?"
  82. + "|(?:LL?|ll?)[Uu]?"
  83. + "|[Zz][Uu]"
  84. + "|" // Literal suffix is optional.
  85. + ")"
  86. // Note: there are user-defined literal suffixes too, but perhaps having the custom suffix not part of the
  87. // literal highlight actually makes it stand out more.
  88. }
  89. ],
  90. relevance: 0
  91. };
  92. const PREPROCESSOR = {
  93. className: 'meta',
  94. begin: /#\s*[a-z]+\b/,
  95. end: /$/,
  96. keywords: { keyword:
  97. 'if else elif endif define undef warning error line '
  98. + 'pragma _Pragma ifdef ifndef include' },
  99. contains: [
  100. {
  101. begin: /\\\n/,
  102. relevance: 0
  103. },
  104. hljs.inherit(STRINGS, { className: 'string' }),
  105. {
  106. className: 'string',
  107. begin: /<.*?>/
  108. },
  109. C_LINE_COMMENT_MODE,
  110. hljs.C_BLOCK_COMMENT_MODE
  111. ]
  112. };
  113. const TITLE_MODE = {
  114. className: 'title',
  115. begin: regex.optional(NAMESPACE_RE) + hljs.IDENT_RE,
  116. relevance: 0
  117. };
  118. const FUNCTION_TITLE = regex.optional(NAMESPACE_RE) + hljs.IDENT_RE + '\\s*\\(';
  119. // https://en.cppreference.com/w/cpp/keyword
  120. const RESERVED_KEYWORDS = [
  121. 'alignas',
  122. 'alignof',
  123. 'and',
  124. 'and_eq',
  125. 'asm',
  126. 'atomic_cancel',
  127. 'atomic_commit',
  128. 'atomic_noexcept',
  129. 'auto',
  130. 'bitand',
  131. 'bitor',
  132. 'break',
  133. 'case',
  134. 'catch',
  135. 'class',
  136. 'co_await',
  137. 'co_return',
  138. 'co_yield',
  139. 'compl',
  140. 'concept',
  141. 'const_cast|10',
  142. 'consteval',
  143. 'constexpr',
  144. 'constinit',
  145. 'continue',
  146. 'decltype',
  147. 'default',
  148. 'delete',
  149. 'do',
  150. 'dynamic_cast|10',
  151. 'else',
  152. 'enum',
  153. 'explicit',
  154. 'export',
  155. 'extern',
  156. 'false',
  157. 'final',
  158. 'for',
  159. 'friend',
  160. 'goto',
  161. 'if',
  162. 'import',
  163. 'inline',
  164. 'module',
  165. 'mutable',
  166. 'namespace',
  167. 'new',
  168. 'noexcept',
  169. 'not',
  170. 'not_eq',
  171. 'nullptr',
  172. 'operator',
  173. 'or',
  174. 'or_eq',
  175. 'override',
  176. 'private',
  177. 'protected',
  178. 'public',
  179. 'reflexpr',
  180. 'register',
  181. 'reinterpret_cast|10',
  182. 'requires',
  183. 'return',
  184. 'sizeof',
  185. 'static_assert',
  186. 'static_cast|10',
  187. 'struct',
  188. 'switch',
  189. 'synchronized',
  190. 'template',
  191. 'this',
  192. 'thread_local',
  193. 'throw',
  194. 'transaction_safe',
  195. 'transaction_safe_dynamic',
  196. 'true',
  197. 'try',
  198. 'typedef',
  199. 'typeid',
  200. 'typename',
  201. 'union',
  202. 'using',
  203. 'virtual',
  204. 'volatile',
  205. 'while',
  206. 'xor',
  207. 'xor_eq'
  208. ];
  209. // https://en.cppreference.com/w/cpp/keyword
  210. const RESERVED_TYPES = [
  211. 'bool',
  212. 'char',
  213. 'char16_t',
  214. 'char32_t',
  215. 'char8_t',
  216. 'double',
  217. 'float',
  218. 'int',
  219. 'long',
  220. 'short',
  221. 'void',
  222. 'wchar_t',
  223. 'unsigned',
  224. 'signed',
  225. 'const',
  226. 'static'
  227. ];
  228. const TYPE_HINTS = [
  229. 'any',
  230. 'auto_ptr',
  231. 'barrier',
  232. 'binary_semaphore',
  233. 'bitset',
  234. 'complex',
  235. 'condition_variable',
  236. 'condition_variable_any',
  237. 'counting_semaphore',
  238. 'deque',
  239. 'false_type',
  240. 'future',
  241. 'imaginary',
  242. 'initializer_list',
  243. 'istringstream',
  244. 'jthread',
  245. 'latch',
  246. 'lock_guard',
  247. 'multimap',
  248. 'multiset',
  249. 'mutex',
  250. 'optional',
  251. 'ostringstream',
  252. 'packaged_task',
  253. 'pair',
  254. 'promise',
  255. 'priority_queue',
  256. 'queue',
  257. 'recursive_mutex',
  258. 'recursive_timed_mutex',
  259. 'scoped_lock',
  260. 'set',
  261. 'shared_future',
  262. 'shared_lock',
  263. 'shared_mutex',
  264. 'shared_timed_mutex',
  265. 'shared_ptr',
  266. 'stack',
  267. 'string_view',
  268. 'stringstream',
  269. 'timed_mutex',
  270. 'thread',
  271. 'true_type',
  272. 'tuple',
  273. 'unique_lock',
  274. 'unique_ptr',
  275. 'unordered_map',
  276. 'unordered_multimap',
  277. 'unordered_multiset',
  278. 'unordered_set',
  279. 'variant',
  280. 'vector',
  281. 'weak_ptr',
  282. 'wstring',
  283. 'wstring_view'
  284. ];
  285. const FUNCTION_HINTS = [
  286. 'abort',
  287. 'abs',
  288. 'acos',
  289. 'apply',
  290. 'as_const',
  291. 'asin',
  292. 'atan',
  293. 'atan2',
  294. 'calloc',
  295. 'ceil',
  296. 'cerr',
  297. 'cin',
  298. 'clog',
  299. 'cos',
  300. 'cosh',
  301. 'cout',
  302. 'declval',
  303. 'endl',
  304. 'exchange',
  305. 'exit',
  306. 'exp',
  307. 'fabs',
  308. 'floor',
  309. 'fmod',
  310. 'forward',
  311. 'fprintf',
  312. 'fputs',
  313. 'free',
  314. 'frexp',
  315. 'fscanf',
  316. 'future',
  317. 'invoke',
  318. 'isalnum',
  319. 'isalpha',
  320. 'iscntrl',
  321. 'isdigit',
  322. 'isgraph',
  323. 'islower',
  324. 'isprint',
  325. 'ispunct',
  326. 'isspace',
  327. 'isupper',
  328. 'isxdigit',
  329. 'labs',
  330. 'launder',
  331. 'ldexp',
  332. 'log',
  333. 'log10',
  334. 'make_pair',
  335. 'make_shared',
  336. 'make_shared_for_overwrite',
  337. 'make_tuple',
  338. 'make_unique',
  339. 'malloc',
  340. 'memchr',
  341. 'memcmp',
  342. 'memcpy',
  343. 'memset',
  344. 'modf',
  345. 'move',
  346. 'pow',
  347. 'printf',
  348. 'putchar',
  349. 'puts',
  350. 'realloc',
  351. 'scanf',
  352. 'sin',
  353. 'sinh',
  354. 'snprintf',
  355. 'sprintf',
  356. 'sqrt',
  357. 'sscanf',
  358. 'std',
  359. 'stderr',
  360. 'stdin',
  361. 'stdout',
  362. 'strcat',
  363. 'strchr',
  364. 'strcmp',
  365. 'strcpy',
  366. 'strcspn',
  367. 'strlen',
  368. 'strncat',
  369. 'strncmp',
  370. 'strncpy',
  371. 'strpbrk',
  372. 'strrchr',
  373. 'strspn',
  374. 'strstr',
  375. 'swap',
  376. 'tan',
  377. 'tanh',
  378. 'terminate',
  379. 'to_underlying',
  380. 'tolower',
  381. 'toupper',
  382. 'vfprintf',
  383. 'visit',
  384. 'vprintf',
  385. 'vsprintf'
  386. ];
  387. const LITERALS = [
  388. 'NULL',
  389. 'false',
  390. 'nullopt',
  391. 'nullptr',
  392. 'true'
  393. ];
  394. // https://en.cppreference.com/w/cpp/keyword
  395. const BUILT_IN = [ '_Pragma' ];
  396. const CPP_KEYWORDS = {
  397. type: RESERVED_TYPES,
  398. keyword: RESERVED_KEYWORDS,
  399. literal: LITERALS,
  400. built_in: BUILT_IN,
  401. _type_hints: TYPE_HINTS
  402. };
  403. const FUNCTION_DISPATCH = {
  404. className: 'function.dispatch',
  405. relevance: 0,
  406. keywords: {
  407. // Only for relevance, not highlighting.
  408. _hint: FUNCTION_HINTS },
  409. begin: regex.concat(
  410. /\b/,
  411. /(?!decltype)/,
  412. /(?!if)/,
  413. /(?!for)/,
  414. /(?!switch)/,
  415. /(?!while)/,
  416. hljs.IDENT_RE,
  417. regex.lookahead(/(<[^<>]+>|)\s*\(/))
  418. };
  419. const EXPRESSION_CONTAINS = [
  420. FUNCTION_DISPATCH,
  421. PREPROCESSOR,
  422. CPP_PRIMITIVE_TYPES,
  423. C_LINE_COMMENT_MODE,
  424. hljs.C_BLOCK_COMMENT_MODE,
  425. NUMBERS,
  426. STRINGS
  427. ];
  428. const EXPRESSION_CONTEXT = {
  429. // This mode covers expression context where we can't expect a function
  430. // definition and shouldn't highlight anything that looks like one:
  431. // `return some()`, `else if()`, `(x*sum(1, 2))`
  432. variants: [
  433. {
  434. begin: /=/,
  435. end: /;/
  436. },
  437. {
  438. begin: /\(/,
  439. end: /\)/
  440. },
  441. {
  442. beginKeywords: 'new throw return else',
  443. end: /;/
  444. }
  445. ],
  446. keywords: CPP_KEYWORDS,
  447. contains: EXPRESSION_CONTAINS.concat([
  448. {
  449. begin: /\(/,
  450. end: /\)/,
  451. keywords: CPP_KEYWORDS,
  452. contains: EXPRESSION_CONTAINS.concat([ 'self' ]),
  453. relevance: 0
  454. }
  455. ]),
  456. relevance: 0
  457. };
  458. const FUNCTION_DECLARATION = {
  459. className: 'function',
  460. begin: '(' + FUNCTION_TYPE_RE + '[\\*&\\s]+)+' + FUNCTION_TITLE,
  461. returnBegin: true,
  462. end: /[{;=]/,
  463. excludeEnd: true,
  464. keywords: CPP_KEYWORDS,
  465. illegal: /[^\w\s\*&:<>.]/,
  466. contains: [
  467. { // to prevent it from being confused as the function title
  468. begin: DECLTYPE_AUTO_RE,
  469. keywords: CPP_KEYWORDS,
  470. relevance: 0
  471. },
  472. {
  473. begin: FUNCTION_TITLE,
  474. returnBegin: true,
  475. contains: [ TITLE_MODE ],
  476. relevance: 0
  477. },
  478. // needed because we do not have look-behind on the below rule
  479. // to prevent it from grabbing the final : in a :: pair
  480. {
  481. begin: /::/,
  482. relevance: 0
  483. },
  484. // initializers
  485. {
  486. begin: /:/,
  487. endsWithParent: true,
  488. contains: [
  489. STRINGS,
  490. NUMBERS
  491. ]
  492. },
  493. // allow for multiple declarations, e.g.:
  494. // extern void f(int), g(char);
  495. {
  496. relevance: 0,
  497. match: /,/
  498. },
  499. {
  500. className: 'params',
  501. begin: /\(/,
  502. end: /\)/,
  503. keywords: CPP_KEYWORDS,
  504. relevance: 0,
  505. contains: [
  506. C_LINE_COMMENT_MODE,
  507. hljs.C_BLOCK_COMMENT_MODE,
  508. STRINGS,
  509. NUMBERS,
  510. CPP_PRIMITIVE_TYPES,
  511. // Count matching parentheses.
  512. {
  513. begin: /\(/,
  514. end: /\)/,
  515. keywords: CPP_KEYWORDS,
  516. relevance: 0,
  517. contains: [
  518. 'self',
  519. C_LINE_COMMENT_MODE,
  520. hljs.C_BLOCK_COMMENT_MODE,
  521. STRINGS,
  522. NUMBERS,
  523. CPP_PRIMITIVE_TYPES
  524. ]
  525. }
  526. ]
  527. },
  528. CPP_PRIMITIVE_TYPES,
  529. C_LINE_COMMENT_MODE,
  530. hljs.C_BLOCK_COMMENT_MODE,
  531. PREPROCESSOR
  532. ]
  533. };
  534. return {
  535. name: 'C++',
  536. aliases: [
  537. 'cc',
  538. 'c++',
  539. 'h++',
  540. 'hpp',
  541. 'hh',
  542. 'hxx',
  543. 'cxx'
  544. ],
  545. keywords: CPP_KEYWORDS,
  546. illegal: '</',
  547. classNameAliases: { 'function.dispatch': 'built_in' },
  548. contains: [].concat(
  549. EXPRESSION_CONTEXT,
  550. FUNCTION_DECLARATION,
  551. FUNCTION_DISPATCH,
  552. EXPRESSION_CONTAINS,
  553. [
  554. PREPROCESSOR,
  555. { // containers: ie, `vector <int> rooms (9);`
  556. begin: '\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function)\\s*<(?!<)',
  557. end: '>',
  558. keywords: CPP_KEYWORDS,
  559. contains: [
  560. 'self',
  561. CPP_PRIMITIVE_TYPES
  562. ]
  563. },
  564. {
  565. begin: hljs.IDENT_RE + '::',
  566. keywords: CPP_KEYWORDS
  567. },
  568. {
  569. match: [
  570. // extra complexity to deal with `enum class` and `enum struct`
  571. /\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,
  572. /\s+/,
  573. /\w+/
  574. ],
  575. className: {
  576. 1: 'keyword',
  577. 3: 'title.class'
  578. }
  579. }
  580. ])
  581. };
  582. }
  583. /*
  584. Language: Arduino
  585. Author: Stefania Mellai <s.mellai@arduino.cc>
  586. Description: The Arduino® Language is a superset of C++. This rules are designed to highlight the Arduino® source code. For info about language see http://www.arduino.cc.
  587. Website: https://www.arduino.cc
  588. Category: system
  589. */
  590. /** @type LanguageFn */
  591. function arduino(hljs) {
  592. const ARDUINO_KW = {
  593. type: [
  594. "boolean",
  595. "byte",
  596. "word",
  597. "String"
  598. ],
  599. built_in: [
  600. "KeyboardController",
  601. "MouseController",
  602. "SoftwareSerial",
  603. "EthernetServer",
  604. "EthernetClient",
  605. "LiquidCrystal",
  606. "RobotControl",
  607. "GSMVoiceCall",
  608. "EthernetUDP",
  609. "EsploraTFT",
  610. "HttpClient",
  611. "RobotMotor",
  612. "WiFiClient",
  613. "GSMScanner",
  614. "FileSystem",
  615. "Scheduler",
  616. "GSMServer",
  617. "YunClient",
  618. "YunServer",
  619. "IPAddress",
  620. "GSMClient",
  621. "GSMModem",
  622. "Keyboard",
  623. "Ethernet",
  624. "Console",
  625. "GSMBand",
  626. "Esplora",
  627. "Stepper",
  628. "Process",
  629. "WiFiUDP",
  630. "GSM_SMS",
  631. "Mailbox",
  632. "USBHost",
  633. "Firmata",
  634. "PImage",
  635. "Client",
  636. "Server",
  637. "GSMPIN",
  638. "FileIO",
  639. "Bridge",
  640. "Serial",
  641. "EEPROM",
  642. "Stream",
  643. "Mouse",
  644. "Audio",
  645. "Servo",
  646. "File",
  647. "Task",
  648. "GPRS",
  649. "WiFi",
  650. "Wire",
  651. "TFT",
  652. "GSM",
  653. "SPI",
  654. "SD"
  655. ],
  656. _hints: [
  657. "setup",
  658. "loop",
  659. "runShellCommandAsynchronously",
  660. "analogWriteResolution",
  661. "retrieveCallingNumber",
  662. "printFirmwareVersion",
  663. "analogReadResolution",
  664. "sendDigitalPortPair",
  665. "noListenOnLocalhost",
  666. "readJoystickButton",
  667. "setFirmwareVersion",
  668. "readJoystickSwitch",
  669. "scrollDisplayRight",
  670. "getVoiceCallStatus",
  671. "scrollDisplayLeft",
  672. "writeMicroseconds",
  673. "delayMicroseconds",
  674. "beginTransmission",
  675. "getSignalStrength",
  676. "runAsynchronously",
  677. "getAsynchronously",
  678. "listenOnLocalhost",
  679. "getCurrentCarrier",
  680. "readAccelerometer",
  681. "messageAvailable",
  682. "sendDigitalPorts",
  683. "lineFollowConfig",
  684. "countryNameWrite",
  685. "runShellCommand",
  686. "readStringUntil",
  687. "rewindDirectory",
  688. "readTemperature",
  689. "setClockDivider",
  690. "readLightSensor",
  691. "endTransmission",
  692. "analogReference",
  693. "detachInterrupt",
  694. "countryNameRead",
  695. "attachInterrupt",
  696. "encryptionType",
  697. "readBytesUntil",
  698. "robotNameWrite",
  699. "readMicrophone",
  700. "robotNameRead",
  701. "cityNameWrite",
  702. "userNameWrite",
  703. "readJoystickY",
  704. "readJoystickX",
  705. "mouseReleased",
  706. "openNextFile",
  707. "scanNetworks",
  708. "noInterrupts",
  709. "digitalWrite",
  710. "beginSpeaker",
  711. "mousePressed",
  712. "isActionDone",
  713. "mouseDragged",
  714. "displayLogos",
  715. "noAutoscroll",
  716. "addParameter",
  717. "remoteNumber",
  718. "getModifiers",
  719. "keyboardRead",
  720. "userNameRead",
  721. "waitContinue",
  722. "processInput",
  723. "parseCommand",
  724. "printVersion",
  725. "readNetworks",
  726. "writeMessage",
  727. "blinkVersion",
  728. "cityNameRead",
  729. "readMessage",
  730. "setDataMode",
  731. "parsePacket",
  732. "isListening",
  733. "setBitOrder",
  734. "beginPacket",
  735. "isDirectory",
  736. "motorsWrite",
  737. "drawCompass",
  738. "digitalRead",
  739. "clearScreen",
  740. "serialEvent",
  741. "rightToLeft",
  742. "setTextSize",
  743. "leftToRight",
  744. "requestFrom",
  745. "keyReleased",
  746. "compassRead",
  747. "analogWrite",
  748. "interrupts",
  749. "WiFiServer",
  750. "disconnect",
  751. "playMelody",
  752. "parseFloat",
  753. "autoscroll",
  754. "getPINUsed",
  755. "setPINUsed",
  756. "setTimeout",
  757. "sendAnalog",
  758. "readSlider",
  759. "analogRead",
  760. "beginWrite",
  761. "createChar",
  762. "motorsStop",
  763. "keyPressed",
  764. "tempoWrite",
  765. "readButton",
  766. "subnetMask",
  767. "debugPrint",
  768. "macAddress",
  769. "writeGreen",
  770. "randomSeed",
  771. "attachGPRS",
  772. "readString",
  773. "sendString",
  774. "remotePort",
  775. "releaseAll",
  776. "mouseMoved",
  777. "background",
  778. "getXChange",
  779. "getYChange",
  780. "answerCall",
  781. "getResult",
  782. "voiceCall",
  783. "endPacket",
  784. "constrain",
  785. "getSocket",
  786. "writeJSON",
  787. "getButton",
  788. "available",
  789. "connected",
  790. "findUntil",
  791. "readBytes",
  792. "exitValue",
  793. "readGreen",
  794. "writeBlue",
  795. "startLoop",
  796. "IPAddress",
  797. "isPressed",
  798. "sendSysex",
  799. "pauseMode",
  800. "gatewayIP",
  801. "setCursor",
  802. "getOemKey",
  803. "tuneWrite",
  804. "noDisplay",
  805. "loadImage",
  806. "switchPIN",
  807. "onRequest",
  808. "onReceive",
  809. "changePIN",
  810. "playFile",
  811. "noBuffer",
  812. "parseInt",
  813. "overflow",
  814. "checkPIN",
  815. "knobRead",
  816. "beginTFT",
  817. "bitClear",
  818. "updateIR",
  819. "bitWrite",
  820. "position",
  821. "writeRGB",
  822. "highByte",
  823. "writeRed",
  824. "setSpeed",
  825. "readBlue",
  826. "noStroke",
  827. "remoteIP",
  828. "transfer",
  829. "shutdown",
  830. "hangCall",
  831. "beginSMS",
  832. "endWrite",
  833. "attached",
  834. "maintain",
  835. "noCursor",
  836. "checkReg",
  837. "checkPUK",
  838. "shiftOut",
  839. "isValid",
  840. "shiftIn",
  841. "pulseIn",
  842. "connect",
  843. "println",
  844. "localIP",
  845. "pinMode",
  846. "getIMEI",
  847. "display",
  848. "noBlink",
  849. "process",
  850. "getBand",
  851. "running",
  852. "beginSD",
  853. "drawBMP",
  854. "lowByte",
  855. "setBand",
  856. "release",
  857. "bitRead",
  858. "prepare",
  859. "pointTo",
  860. "readRed",
  861. "setMode",
  862. "noFill",
  863. "remove",
  864. "listen",
  865. "stroke",
  866. "detach",
  867. "attach",
  868. "noTone",
  869. "exists",
  870. "buffer",
  871. "height",
  872. "bitSet",
  873. "circle",
  874. "config",
  875. "cursor",
  876. "random",
  877. "IRread",
  878. "setDNS",
  879. "endSMS",
  880. "getKey",
  881. "micros",
  882. "millis",
  883. "begin",
  884. "print",
  885. "write",
  886. "ready",
  887. "flush",
  888. "width",
  889. "isPIN",
  890. "blink",
  891. "clear",
  892. "press",
  893. "mkdir",
  894. "rmdir",
  895. "close",
  896. "point",
  897. "yield",
  898. "image",
  899. "BSSID",
  900. "click",
  901. "delay",
  902. "read",
  903. "text",
  904. "move",
  905. "peek",
  906. "beep",
  907. "rect",
  908. "line",
  909. "open",
  910. "seek",
  911. "fill",
  912. "size",
  913. "turn",
  914. "stop",
  915. "home",
  916. "find",
  917. "step",
  918. "tone",
  919. "sqrt",
  920. "RSSI",
  921. "SSID",
  922. "end",
  923. "bit",
  924. "tan",
  925. "cos",
  926. "sin",
  927. "pow",
  928. "map",
  929. "abs",
  930. "max",
  931. "min",
  932. "get",
  933. "run",
  934. "put"
  935. ],
  936. literal: [
  937. "DIGITAL_MESSAGE",
  938. "FIRMATA_STRING",
  939. "ANALOG_MESSAGE",
  940. "REPORT_DIGITAL",
  941. "REPORT_ANALOG",
  942. "INPUT_PULLUP",
  943. "SET_PIN_MODE",
  944. "INTERNAL2V56",
  945. "SYSTEM_RESET",
  946. "LED_BUILTIN",
  947. "INTERNAL1V1",
  948. "SYSEX_START",
  949. "INTERNAL",
  950. "EXTERNAL",
  951. "DEFAULT",
  952. "OUTPUT",
  953. "INPUT",
  954. "HIGH",
  955. "LOW"
  956. ]
  957. };
  958. const ARDUINO = cPlusPlus(hljs);
  959. const kws = /** @type {Record<string,any>} */ (ARDUINO.keywords);
  960. kws.type = [
  961. ...kws.type,
  962. ...ARDUINO_KW.type
  963. ];
  964. kws.literal = [
  965. ...kws.literal,
  966. ...ARDUINO_KW.literal
  967. ];
  968. kws.built_in = [
  969. ...kws.built_in,
  970. ...ARDUINO_KW.built_in
  971. ];
  972. kws._hints = ARDUINO_KW._hints;
  973. ARDUINO.name = 'Arduino';
  974. ARDUINO.aliases = [ 'ino' ];
  975. ARDUINO.supersetOf = "cpp";
  976. return ARDUINO;
  977. }
  978. export { arduino as default };