from and revert are highlighted as keywords in Solidity code everywhere
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 13k
- Forks
- 1.4k
- Avg merge
- 15h 36m
- Merged PRs (30d)
- 3
Description
Information:
- Prism version: 1.30.0
- Plugins: none
- Environment: browser
Description
from should only be highlighted as a keyword in Solidity when used in import statements.
revert should only be highlighted as a keyword in Solidity when used in revert statements.
test case:
function f(address from) virtual {}
function g(bool revert) virtual {}
Note that there is this rule in Solidity's grammar:
https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.identifier
/**
* Besides regular non-keyword Identifiers, some keywords like 'from' and 'error' can also be used as identifiers.
*/
identifier: Identifier | From | Error | Revert | Global | Transient | Layout | At;
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Use the provided Solidity test case in the Prism test page and consult SolidityParser.g4 lines 425-428 to confirm the allowed identifier contexts. Update the Solidity highlighting behavior so from and revert are keywords only in their statement contexts, then verify the example no longer highlights them as parameter names.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, solidity
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100