| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -157,8 +157,20 @@ | |||
| 157 | 157 | <rule pattern="(continue|returns|storage|memory|delete|return|throw|break|catch|while|else|from|new|try|for|if|is|as|do|in|_)\b"> | |
| 158 | 158 | <token type="Keyword"/> | |
| 159 | 159 | </rule> | |
| 160 | - <rule pattern="assembly\b"> | ||
| 161 | - <token type="Keyword"/> | ||
| 160 | + <rule pattern="(assembly)(\s+\()(.+)(\)\s+{)"> | ||
| 161 | + <bygroups> | ||
| 162 | + <token type="Keyword"/> | ||
| 163 | + <token type="Text"/> | ||
| 164 | + <token type="LiteralString"/> | ||
| 165 | + <token type="Text"/> | ||
| 166 | + </bygroups> | ||
| 167 | + <push state="assembly"/> | ||
| 168 | + </rule> | ||
| 169 | + <rule pattern="(assembly)(\s+{)"> | ||
| 170 | + <bygroups> | ||
| 171 | + <token type="Keyword"/> | ||
| 172 | + <token type="Text"/> | ||
| 173 | + </bygroups> | ||
| 162 | 174 | <push state="assembly"/> | |
| 163 | 175 | </rule> | |
| 164 | 176 | <rule pattern="(contract|interface|enum|event|struct)(\s+)([a-zA-Z_]\w*)"> | |
@@ -235,7 +247,7 @@ | |||
| 235 | 247 | <token type="Punctuation"/> | |
| 236 | 248 | <pop depth="1"/> | |
| 237 | 249 | </rule> | |
| 238 | - <rule pattern="[(),]"> | ||
| 250 | + <rule pattern="[(),.]"> | ||
| 239 | 251 | <token type="Punctuation"/> | |
| 240 | 252 | </rule> | |
| 241 | 253 | <rule pattern=":=|=:"> | |
@@ -276,4 +288,4 @@ | |||
| 276 | 288 | </rule> | |
| 277 | 289 | </state> | |
| 278 | 290 | </rules> | |
| 279 | - </lexer> | ||
| 291 | + </lexer> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -9,6 +9,14 @@ contract ReactExample { | |||
| 9 | 9 | you_awesome = "You're awesome"; | |
| 10 | 10 | } | |
| 11 | 11 | ||
| 12 | + function AssemblyExample() public { | ||
| 13 | + assembly { | ||
| 14 | + let o := sload(0) | ||
| 15 | + call(gas(), o, 5, 0, 0, 0, 0) | ||
| 16 | + } | ||
| 17 | + require(success, "Failed to send ETH"); | ||
| 18 | + } | ||
| 19 | + | ||
| 12 | 20 | function kill() public { | |
| 13 | 21 | require(msg.sender==owner); | |
| 14 | 22 | selfdestruct(owner); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -58,6 +58,63 @@ | |||
| 58 | 58 | {"type":"Text","value":"\n \n "}, | |
| 59 | 59 | {"type":"KeywordDeclaration","value":"function"}, | |
| 60 | 60 | {"type":"Text","value":" "}, | |
| 61 | + {"type":"NameFunction","value":"AssemblyExample"}, | ||
| 62 | + {"type":"Punctuation","value":"()"}, | ||
| 63 | + {"type":"Text","value":" "}, | ||
| 64 | + {"type":"Keyword","value":"public"}, | ||
| 65 | + {"type":"Text","value":" "}, | ||
| 66 | + {"type":"Punctuation","value":"{"}, | ||
| 67 | + {"type":"Text","value":"\n "}, | ||
| 68 | + {"type":"Keyword","value":"assembly"}, | ||
| 69 | + {"type":"Text","value":" {\n "}, | ||
| 70 | + {"type":"OperatorWord","value":"let"}, | ||
| 71 | + {"type":"Text","value":" "}, | ||
| 72 | + {"type":"NameVariable","value":"o"}, | ||
| 73 | + {"type":"Text","value":" "}, | ||
| 74 | + {"type":"Operator","value":":="}, | ||
| 75 | + {"type":"Text","value":" "}, | ||
| 76 | + {"type":"NameFunction","value":"sload"}, | ||
| 77 | + {"type":"Punctuation","value":"("}, | ||
| 78 | + {"type":"LiteralNumberInteger","value":"0"}, | ||
| 79 | + {"type":"Punctuation","value":")"}, | ||
| 80 | + {"type":"Text","value":"\n "}, | ||
| 81 | + {"type":"NameFunction","value":"call"}, | ||
| 82 | + {"type":"Punctuation","value":"("}, | ||
| 83 | + {"type":"NameFunction","value":"gas"}, | ||
| 84 | + {"type":"Punctuation","value":"(),"}, | ||
| 85 | + {"type":"Text","value":" "}, | ||
| 86 | + {"type":"Name","value":"o"}, | ||
| 87 | + {"type":"Punctuation","value":","}, | ||
| 88 | + {"type":"Text","value":" "}, | ||
| 89 | + {"type":"LiteralNumberInteger","value":"5"}, | ||
| 90 | + {"type":"Punctuation","value":","}, | ||
| 91 | + {"type":"Text","value":" "}, | ||
| 92 | + {"type":"LiteralNumberInteger","value":"0"}, | ||
| 93 | + {"type":"Punctuation","value":","}, | ||
| 94 | + {"type":"Text","value":" "}, | ||
| 95 | + {"type":"LiteralNumberInteger","value":"0"}, | ||
| 96 | + {"type":"Punctuation","value":","}, | ||
| 97 | + {"type":"Text","value":" "}, | ||
| 98 | + {"type":"LiteralNumberInteger","value":"0"}, | ||
| 99 | + {"type":"Punctuation","value":","}, | ||
| 100 | + {"type":"Text","value":" "}, | ||
| 101 | + {"type":"LiteralNumberInteger","value":"0"}, | ||
| 102 | + {"type":"Punctuation","value":")"}, | ||
| 103 | + {"type":"Text","value":"\n "}, | ||
| 104 | + {"type":"Punctuation","value":"}"}, | ||
| 105 | + {"type":"Text","value":"\n "}, | ||
| 106 | + {"type":"NameBuiltin","value":"require"}, | ||
| 107 | + {"type":"Punctuation","value":"("}, | ||
| 108 | + {"type":"Name","value":"success"}, | ||
| 109 | + {"type":"Punctuation","value":","}, | ||
| 110 | + {"type":"Text","value":" "}, | ||
| 111 | + {"type":"LiteralString","value":"\"Failed to send ETH\""}, | ||
| 112 | + {"type":"Punctuation","value":");"}, | ||
| 113 | + {"type":"Text","value":"\n "}, | ||
| 114 | + {"type":"Punctuation","value":"}"}, | ||
| 115 | + {"type":"Text","value":"\n \n "}, | ||
| 116 | + {"type":"KeywordDeclaration","value":"function"}, | ||
| 117 | + {"type":"Text","value":" "}, | ||
| 61 | 118 | {"type":"NameFunction","value":"kill"}, | |
| 62 | 119 | {"type":"Punctuation","value":"()"}, | |
| 63 | 120 | {"type":"Text","value":" "}, | |
| Back | FazBrowse Home | New Git URL |
0 commit comments