Skip to content

Conversation

@Sekhmet
Copy link

@Sekhmet Sekhmet commented Nov 19, 2025

The only change needed to make it work was to replace lexemes with new keywords.$pattern.

Tests are passing, and I was able to use it with some example Solidity codes with highlight.js@11.11.1

Note: package-lock.json was updated using modern version of npm. I could downgrade it if needed.

AccessControl.sol being rendered via Highlight.js 11

See image

Old lexemes behavior in Highlight.js

See image (Highlight.js 10)
See image (Highlight.js 11)

Code (GitHub doesn't properly lex identifiers with $):

pragma experimental SMTChecker$v1;

using StringUtils$LEX for string;

abstract contract AccessControl$LEX is IAccessControl$LEX { }

import "util.sol" as util$asdf;

function id$tx {}

function _checkRole(bytes32 role$11, address account) internal view virtual {
  block.number
}

struct Shipment$LEX {}

enum Status$LEX {
    None$LEX,
}

assembly {
  code.hey := mload(0x40)
}

The only change needed to make it work was to replace lexemes with new
keywords.$pattern.

Tests are passsing, and I was able to use it with some example Solidity
codes with highlight.js@11.11.1
Replaced all existing uses of lexemes to use $pattern.
In case lexemes were not actually used those were removed.

I verified those still work in some code sample (see attached image).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant