Added support for Solidity.#464
Conversation
|
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
|
I tried to create a Google account to accept the CLA, but apparently this requires a phone number (which I prefer to not share with you). Instead, I would like to accept the CLA with this comment, in the form as linked above, for all my contributions related to this pull request (past, present, and future). I sincerely hope that googlebot will be the only one unsatisfied with this solution. |
| } | ||
| } | ||
| fixedSizes = fixedSizes.slice(0, -1); | ||
| var keywords = 'abstract|anonymous|as|assembly|break|case|catch|constant' + |
There was a problem hiding this comment.
There are a few more here, e.g., addmod, sha3, etc.
Actually, after a quick diff with this lexer, it appears the following keywords are missing:
addmod
after
assert
block
ecrecover
event
false
keccak256
msg
mulmod
now
null
revert
ripemd160
selfdestruct
sha256
sha3
suicide
super
this
true
tx
| // literals | ||
| [PR['PR_LITERAL'], new RegExp('^(?:0x[a-fA-F0-9_]+|\\d+)(\\s+(?:' + units + '))?')], // decimal or hex number with optional unit | ||
| [PR['PR_LITERAL'], /^"(?:[^"\\\r\n]|\\.)*"|^'(?:[^'\\\r\n]|\\.)*'/], // string | ||
| [PR['PR_LITERAL'], /^hex(?:"(?:[a-fA-F0-9_]{2})*"|'(?:[a-fA-F0-9_]{2})*')/], // hex |
There was a problem hiding this comment.
I'm not sure I understand this one. Is it supposed to be /^hex( or /^0x(?
There was a problem hiding this comment.
I think it is supposed to be hex: http://solidity.readthedocs.io/en/develop/types.html#hexadecimal-literals
ligi
left a comment
There was a problem hiding this comment.
@ComandanteCheth I have a signed the needed CLA already once and could resubmit this PR for you if you want. Context: https://www.reddit.com/r/ethereum/comments/6bgc9x/need_a_googlecodeprettify_lexer_for_solidity/
| // literals | ||
| [PR['PR_LITERAL'], new RegExp('^(?:0x[a-fA-F0-9_]+|\\d+)(\\s+(?:' + units + '))?')], // decimal or hex number with optional unit | ||
| [PR['PR_LITERAL'], /^"(?:[^"\\\r\n]|\\.)*"|^'(?:[^'\\\r\n]|\\.)*'/], // string | ||
| [PR['PR_LITERAL'], /^hex(?:"(?:[a-fA-F0-9_]{2})*"|'(?:[a-fA-F0-9_]{2})*')/], // hex |
There was a problem hiding this comment.
I think it is supposed to be hex: http://solidity.readthedocs.io/en/develop/types.html#hexadecimal-literals
|
@ligi not sure whether @ComandanteCheth will reply. Can you resubmit anyways since you signed already? |
|
Unfortunately I can't - not technically - but legally - I would need the consent of @ComandanteCheth - otherwise I cannot just resubmit without violating law AFAIK. I would have to rewrite it - and I don't really want to touch JS - also not sure how to do it differently than in this PR. Kind of a sad situation .. |
|
@ligi the APLv2 should be fine as long as you retain the copyright message set by @ComandanteCheth @gapar2 the only legally unclear issue is the CLA, can we bypass that by resubmitting the PR? https://opensource.stackexchange.com/questions/5661/can-i-resubmit-someone-elses-pull-request-if-he-does-not-sign-cla/5662#5662 (check the last paragraph of the answer). |
|
@ComandanteCheth is lost in space :( |
|
@ComandanteCheth Are you still alive ? |
Solidity is the main language for contracts on the Ethereum platform. Support is desired by the community on ethereum.stackexchange.com.