diff options
23 files changed, 1447 insertions, 50 deletions
diff --git a/.gitmodules b/.gitmodules index 12beb70c..4494055b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -94,10 +94,6 @@ [submodule "assets/syntaxes/Assembly (ARM)"] path = assets/syntaxes/02_Extra/Assembly (ARM) url = https://github.com/tvi/Sublime-ARM-Assembly -[submodule "assets/syntaxes/syslog-syntax"] - path = assets/syntaxes/02_Extra/Syslog - url = https://github.com/caos21/syslog-syntax.git - branch = master [submodule "assets/syntaxes/protobuf-syntax-highlighting"] path = assets/syntaxes/02_Extra/Protobuf url = https://github.com/VcamX/protobuf-syntax-highlighting.git @@ -216,3 +212,6 @@ [submodule "assets/syntaxes/02_Extra/SystemVerilog"] path = assets/syntaxes/02_Extra/SystemVerilog url = https://github.com/TheClams/SystemVerilog.git +[submodule "assets/syntaxes/02_Extra/SublimeEthereum"] + path = assets/syntaxes/02_Extra/SublimeEthereum + url = https://github.com/davidhq/SublimeEthereum.git diff --git a/CHANGELOG.md b/CHANGELOG.md index d3341148..617f19b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ ## Syntaxes +- Improved the Syslog syntax highlighting, see #1606 (@keith-hall) - Replaced "Advanced CSV" with a custom CSV syntax definition written especially for `bat`; see #1574 (@keith-hall) ## New themes @@ -157,11 +157,12 @@ dependencies = [ [[package]] name = "bugreport" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "116762017f173ea5d8103e75533f6bdb62cb6f2257c9c95672beb085a70daed8" +checksum = "a0e97e538864a7c95d33accbf64c8d354018ba3b6e032502fd0fe7259cf1aa3d" dependencies = [ - "snailquote", + "git-version", + "shell-escape", "sys-info", ] @@ -226,9 +227,9 @@ dependencies = [ [[package]] name = "console" -version = "0.14.0" +version = "0.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cc80946b3480f421c2f17ed1cb841753a371c7c5104f51d507e13f532c856aa" +checksum = "3993e6445baa160675931ec041a5e03ca84b9c6e32a056150d3aa2bdda0a1f45" dependencies = [ "encode_unicode", "lazy_static", @@ -434,6 +435,28 @@ dependencies = [ ] [[package]] +name = "git-version" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94918e83f1e01dedc2e361d00ce9487b14c58c7f40bab148026fa39d42cb41e2" +dependencies = [ + "git-version-macro", + "proc-macro-hack", +] + +[[package]] +name = "git-version-macro" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34a97a52fdee1870a34fa6e4b77570cba531b27d1838874fef4429a791a3d657" +dependencies = [ + "proc-macro-hack", + "proc-macro2", + "quote", + "syn", +] + +[[package]] name = "git2" version = "0.13.17" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -792,6 +815,12 @@ dependencies = [ ] [[package]] +name = "proc-macro-hack" +version = "0.5.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5" + +[[package]] name = "proc-macro2" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1015,6 +1044,12 @@ dependencies = [ ] [[package]] +name = "shell-escape" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45bb67a18fa91266cc7807181f62f9178a6873bfad7dc788c42e6430db40184f" + +[[package]] name = "shell-words" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1027,16 +1062,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" [[package]] -name = "snailquote" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34b729d802f52194598858ac852c3fb3b33f6e026cd03195072ccb7bf3fc810" -dependencies = [ - "thiserror", - "unicode_categories", -] - -[[package]] name = "std_prelude" version = "0.2.12" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1084,9 +1109,9 @@ dependencies = [ [[package]] name = "sys-info" -version = "0.7.0" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5cfbd84f86389198ade41b439f72a5b1b3a8ba728e61cd589e1720d0df44c39" +checksum = "33fcecee49339531cf6bd84ecf3ed94f9c8ef4a7e700f2a1cac9cc1ca485383a" dependencies = [ "cc", "libc", @@ -1137,26 +1162,6 @@ dependencies = [ ] [[package]] -name = "thiserror" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0f4a65597094d4483ddaed134f409b2cb7c1beccf25201a9f73c719254fa98e" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7765189610d8241a44529806d6fd1f2e0a08734313a35d5b3a556f92b381f3c0" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] name = "thread_local" version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -1223,12 +1228,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] -name = "unicode_categories" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" - -[[package]] name = "url" version = "2.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -36,7 +36,7 @@ regex-fancy = ["syntect/regex-fancy"] # Use the rust-only "fancy-regex" engine atty = { version = "0.2.14", optional = true } ansi_term = "^0.12.1" ansi_colours = "^1.0" -console = "0.14.0" +console = "0.14.1" lazy_static = { version = "1.4", optional = true } wild = { version = "2.0", optional = true } content_inspector = "0.2.4" @@ -49,7 +49,7 @@ serde_yaml = "0.8" semver = "0.11" path_abs = { version = "0.5", default-features = false } clircle = "0.3" -bugreport = "0.3" +bugreport = "0.4" dirs-next = { version = "2.0.0", optional = true } [dependencies.git2] diff --git a/assets/patches/Monokai-Extended.tmTheme.patch b/assets/patches/Monokai-Extended.tmTheme.patch index 16624d5f..106b584d 100644 --- a/assets/patches/Monokai-Extended.tmTheme.patch +++ b/assets/patches/Monokai-Extended.tmTheme.patch @@ -16,3 +16,21 @@ index 9c2aa3e..180cbbf 100644 </dict> </dict> <dict> +@@ -1027,7 +1027,7 @@ + <key>name</key> + <string>Invalid</string> + <key>scope</key> +- <string>invalid</string> ++ <string>invalid, markup.error</string> + <key>settings</key> + <dict> + <key>background</key> +@@ -1042,7 +1042,7 @@ + <key>name</key> + <string>Invalid deprecated</string> + <key>scope</key> +- <string>invalid.deprecated</string> ++ <string>invalid.deprecated, markup.warning</string> + <key>settings</key> + <dict> + <key>background</key> diff --git a/assets/syntaxes/02_Extra/FSharp b/assets/syntaxes/02_Extra/FSharp -Subproject c18616d6bd55b188672276da837837070170d96 +Subproject 9e4645c6085871d6fe4ae8dbcbafe93cb155b07 diff --git a/assets/syntaxes/02_Extra/Julia b/assets/syntaxes/02_Extra/Julia -Subproject 45a1b6fe6cc37a2b614ae199d85c702b8711e22 +Subproject cc13e7d4ef74a6556af09d8858d2cc6a47ef545 diff --git a/assets/syntaxes/02_Extra/SCSS_Sass b/assets/syntaxes/02_Extra/SCSS_Sass -Subproject 4868322030c3644d6b8cfff68c85849789d9bdb +Subproject 63819a1ab6b2075360933b2cfe41b416de0e3c2 diff --git a/assets/syntaxes/02_Extra/SublimeEthereum b/assets/syntaxes/02_Extra/SublimeEthereum new file mode 160000 +Subproject b60e0a3e00e68263fcf35ba1a2e0bd0f6e3544f diff --git a/assets/syntaxes/02_Extra/Syslog b/assets/syntaxes/02_Extra/Syslog deleted file mode 160000 -Subproject 7628d4e0b89d3b4f0dcc014bfb4a3e3433f5133 diff --git a/assets/syntaxes/02_Extra/log.sublime-syntax b/assets/syntaxes/02_Extra/log.sublime-syntax new file mode 100644 index 00000000..3c699d2e --- /dev/null +++ b/assets/syntaxes/02_Extra/log.sublime-syntax @@ -0,0 +1,116 @@ +%YAML 1.2 +--- +# See http://www.sublimetext.com/docs/3/syntax.html +file_extensions: + - log +scope: text.log +variables: + ipv4_part: (?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?) +contexts: + main: + - match: (\w+)(=) + captures: + 1: variable.parameter.log + 2: keyword.operator.assignment.log + - match: (')([^']*)(') + scope: string.quoted.single.log + captures: + 1: punctuation.definition.string.begin.log + 3: punctuation.definition.string.end.log + - match: (")([^"]*)(") + scope: string.quoted.double.log + captures: + 1: punctuation.definition.string.begin.log + 3: punctuation.definition.string.end.log + - include: dates + - include: ip_addresses + - include: numbers + - match: \b(?i:fail(?:ure|ed)?|error|exception)\b + scope: markup.error.log + - match: \b(?i:warn(?:ing)?)\b + scope: markup.warning.log + #- include: scope:text.html.markdown#autolink-inet + - match: \b\w+:/{2,3} + scope: markup.underline.link.scheme.log + push: url-host + dates: + - match: \b\d{4}-\d{2}-\d{2}\b + scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log + - match: \b\d{4}/\d{2}/\d{2}\b + scope: meta.date.log meta.number.integer.decimal.log constant.numeric.value.log + - match: \b(?:[01]\d|2[0-3]):(?:[0-5]\d):(?:[0-5]\d)(?:(\.)\d{3})?\b + scope: meta.time.log meta.number.integer.decimal.log constant.numeric.value.log + captures: + 1: punctuation.separator.decimal.log + ip_addresses: + - match: \b(?=(?:{{ipv4_part}}\.){3}{{ipv4_part}}\b) + push: + - meta_scope: meta.ipaddress.v4.log meta.number.integer.decimal.log + - match: \d+ + scope: constant.numeric.value.log + - match: \. + scope: punctuation.separator.sequence.log + - match: '' + pop: true + - match: (?=(?:\h{0,4}:){2,6}\h{1,4}\b) + push: + - meta_scope: meta.ipaddress.v6.log meta.number.integer.hexadecimal.log + - match: \h{1,4} + scope: constant.numeric.value.log + - match: ':' + scope: punctuation.separator.sequence.log + - match: '' + pop: true + numbers: + - match: \b(0x)(\h+)(?:(\.)(\h+))?\b + scope: meta.number.float.hexadecimal.log + captures: + 1: constant.numeric.base.log + 2: constant.numeric.value.log + 3: constant.numeric.value.log punctuation.separator.decimal.log + 4: constant.numeric.value.log + - match: \b\d+(\.)\d+\b + scope: meta.number.float.log constant.numeric.value.log + captures: + 1: punctuation.separator.decimal.log + - match: \b\d+\b + scope: meta.number.integer.log constant.numeric.value.log + url-host: + - meta_content_scope: markup.underline.link.host.log + - match: \[ + scope: punctuation.section.brackets.begin.log + push: + - match: \] + scope: punctuation.section.brackets.end.log + pop: true + - include: ip_addresses + - match: '[^:/\s]+' + - match: '' + set: url-after-host + url-after-host: + - match: (:)(\d+) + scope: markup.underline.link.port.log + captures: + 1: punctuation.separator.mapping.port.log + 2: constant.numeric.value.log + #- include: scope:text.html.markdown#url-escaped-chars + - match: (%)\h{2} + scope: markup.underline.link.path.log constant.character.escape.url.log + captures: + 1: punctuation.definition.escape.log + # After a valid domain, zero or more non-space non-< characters may follow + - match: (?=[?!.,:*_~]*[\s<]) # Trailing punctuation (specifically, ?, !, ., ,, :, *, _, and ~) will not be considered part of the autolink, though they may be included in the interior of the link + pop: true + - match: \( # When an autolink ends in ), we scan the entire autolink for the total number of parentheses. If there is a greater number of closing parentheses than opening ones, we don’t consider the last character part of the autolink, in order to facilitate including an autolink inside a parenthesis + push: + - meta_scope: markup.underline.link.path.log + - match: (?=[?!.,:*_~]*[\s<]) + pop: true + - match: \) + pop: true + - match: (?=\)[?!.,:*_~]*[\s<]) + pop: true + - match: '[^?!.,:*_~\s<&()%]+|\S' + scope: markup.underline.link.path.log + - match: '' + pop: true diff --git a/assets/syntaxes/02_Extra/syslog.sublime-syntax b/assets/syntaxes/02_Extra/syslog.sublime-syntax new file mode 100644 index 00000000..ce782e50 --- /dev/null +++ b/assets/syntaxes/02_Extra/syslog.sublime-syntax @@ -0,0 +1,63 @@ +%YAML 1.2 +--- +# http://www.sublimetext.com/docs/3/syntax.html +name: syslog +file_extensions: + - syslog +scope: text.log.syslog +contexts: + main: + - match: ^(\w+\s+\d+)\s+(\d{2}:\d{2}:\d{2}) + scope: meta.datetime.syslog constant.numeric.syslog + captures: + 1: meta.date.syslog + 2: meta.time.syslog + push: loghost + - match: ^ + push: text + loghost: + - match: '[\w-]+' + scope: entity.other.attribute-name.loghost.syslog + set: process + process: + - match: ([\w-]+)(?:(\[)(\d+)(\]))?(:) + captures: + 1: support.function.process.syslog + 2: punctuation.separator.pid.begin.syslog + 3: meta.pid.syslog meta.number.integer.syslog constant.numeric.value.syslog + 4: punctuation.separator.pid.end.syslog + 5: punctuation.separator.mapping.syslog + set: structured-data + structured-data: + - match: '\[' + scope: punctuation.section.mapping.begin.syslog + push: + - match: \] + scope: punctuation.section.mapping.end.syslog + pop: true + - match: \w+ + scope: variable.parameter.syslog + - match: = + scope: keyword.operator.assignment.syslog + push: + - match: '[^\s\]]+' + scope: constant.other.syslog + pop: true + - match: (?=\]) + pop: true + - match: (?=\S) + set: text + text: + - match: $ + pop: true + - match: '<\w+>' + scope: constant.language.syslog + - match: \b(CMD)\b\s+(\() + captures: + 1: entity.name.label.syslog + 2: punctuation.section.block.begin.syslog + embed: scope:source.shell.bash + escape: \)$ + escape_captures: + 0: punctuation.section.block.end.syslog + - include: scope:text.log diff --git a/src/less.rs b/src/less.rs index 34b57549..f1adca81 100644 --- a/src/less.rs +++ b/src/less.rs @@ -11,7 +11,7 @@ pub fn retrieve_less_version(less_path: &dyn AsRef<OsStr>) -> Option<usize> { fn parse_less_version(output: &[u8]) -> Option<usize> { if output.starts_with(b"less ") { let version = std::str::from_utf8(&output[5..]).ok()?; - let end = version.find(' ')?; + let end = version.find(|c: char| !c.is_ascii_digit())?; version[..end].parse::<usize>().ok() } else { None @@ -58,6 +58,19 @@ Home page: http://www.greenwoodsoftware.com/less"; } #[test] +fn test_parse_less_version_581_2() { + let output = b"less 581.2 (PCRE2 regular expressions) +Copyright (C) 1984-2021 Mark Nudelman + +less comes with NO WARRANTY, to the extent permitted by law. +For information about the terms of redistribution, +see the file named README in the less distribution. +Home page: https://greenwoodsoftware.com/less"; + + assert_eq!(Some(581), parse_less_version(output)); +} + +#[test] fn test_parse_less_version_wrong_program() { let output = b"more from util-linux 2.34"; diff --git a/tests/syntax-tests/highlighted/Log/example.log b/tests/syntax-tests/highlighted/Log/example.log new file mode 100644 index 00000000..8387670c --- /dev/null +++ b/tests/syntax-tests/highlighted/Log/example.log @@ -0,0 +1,2 @@ +[38;2;190;132;255m2021-03-06[0m[38;2;248;248;242m [0m[38;2;190;132;255m23:22:21[0m[38;2;190;132;255m.[0m[38;2;190;132;255m392[0m[38;2;248;248;242m [0m[4;38;2;166;226;46mhttps://[0m[4;38;2;166;226;46m[[0m[4;38;2;190;132;255m2001[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255mdb8[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m4006[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m812[0m[4;38;2;166;226;46m:[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m200e[0m[4;38;2;166;226;46m][0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m8080[0m[4;38;2;166;226;46m/path/the[0m[4;38;2;190;132;255m%[0m[4;38;2;190;132;255m20[0m[4;38;2;166;226;46mpage[0m[4;38;2;166;226;46m.[0m[4;38;2;166;226;46mhtml[0m +[38;2;190;132;255m2021-03-06[0m[38;2;248;248;242m [0m[38;2;190;132;255m23:22:21[0m[38;2;248;248;242m [0m[4;38;2;166;226;46mhttps://[0m[4;38;2;166;226;46mexample.com[0m[4;38;2;166;226;46m:[0m[4;38;2;190;132;255m8080[0m[4;38;2;166;226;46m/path/the[0m[4;38;2;190;132;255m%[0m[4;38;2;190;132;255m20[0m[4;38;2;166;226;46mpage[0m[4;38;2;166;226;46m(with_parens)[0m[4;38;2;166;226;46m.[0m[4;38;2;166;226;46mhtml[0m diff --git a/tests/syntax-tests/highlighted/Solidity/ERC721.sol b/tests/syntax-tests/highlighted/Solidity/ERC721.sol new file mode 100644 index 00000000..7a30e357 --- /dev/null +++ b/tests/syntax-tests/highlighted/Solidity/ERC721.sol @@ -0,0 +1,376 @@ +[38;2;117;113;94m//[0m[38;2;117;113;94m SPDX-License-Identifier: MIT[0m + +[38;2;249;38;114mpragma[0m[38;2;248;248;242m [0m[38;2;249;38;114msolidity[0m[38;2;248;248;242m [0m[38;2;249;38;114m^[0m[38;2;190;132;255m0[0m[38;2;190;132;255m.8.0[0m[38;2;248;248;242m;[0m + +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mI[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m7[0m[38;2;230;219;116m2[0m[38;2;230;219;116m1[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mI[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m7[0m[38;2;230;219;116m2[0m[38;2;230;219;116m1[0m[38;2;230;219;116mR[0m[38;2;230;219;116me[0m[38;2;230;219;116mc[0m[38;2;230;219;116me[0m[38;2;230;219;116mi[0m[38;2;230;219;116mv[0m[38;2;230;219;116me[0m[38;2;230;219;116mr[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116me[0m[38;2;230;219;116mx[0m[38;2;230;219;116mt[0m[38;2;230;219;116me[0m[38;2;230;219;116mn[0m[38;2;230;219;116ms[0m[38;2;230;219;116mi[0m[38;2;230;219;116mo[0m[38;2;230;219;116mn[0m[38;2;230;219;116ms[0m[38;2;230;219;116m/[0m[38;2;230;219;116mI[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m7[0m[38;2;230;219;116m2[0m[38;2;230;219;116m1[0m[38;2;230;219;116mM[0m[38;2;230;219;116me[0m[38;2;230;219;116mt[0m[38;2;230;219;116ma[0m[38;2;230;219;116md[0m[38;2;230;219;116ma[0m[38;2;230;219;116mt[0m[38;2;230;219;116ma[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mu[0m[38;2;230;219;116mt[0m[38;2;230;219;116mi[0m[38;2;230;219;116ml[0m[38;2;230;219;116ms[0m[38;2;230;219;116m/[0m[38;2;230;219;116mA[0m[38;2;230;219;116md[0m[38;2;230;219;116md[0m[38;2;230;219;116mr[0m[38;2;230;219;116me[0m[38;2;230;219;116ms[0m[38;2;230;219;116ms[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mu[0m[38;2;230;219;116mt[0m[38;2;230;219;116mi[0m[38;2;230;219;116ml[0m[38;2;230;219;116ms[0m[38;2;230;219;116m/[0m[38;2;230;219;116mC[0m[38;2;230;219;116mo[0m[38;2;230;219;116mn[0m[38;2;230;219;116mt[0m[38;2;230;219;116me[0m[38;2;230;219;116mx[0m[38;2;230;219;116mt[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mu[0m[38;2;230;219;116mt[0m[38;2;230;219;116mi[0m[38;2;230;219;116ml[0m[38;2;230;219;116ms[0m[38;2;230;219;116m/[0m[38;2;230;219;116mS[0m[38;2;230;219;116mt[0m[38;2;230;219;116mr[0m[38;2;230;219;116mi[0m[38;2;230;219;116mn[0m[38;2;230;219;116mg[0m[38;2;230;219;116ms[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m +[38;2;249;38;114mimport[0m[38;2;248;248;242m [0m[38;2;230;219;116m"[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116m.[0m[38;2;230;219;116m.[0m[38;2;230;219;116m/[0m[38;2;230;219;116mu[0m[38;2;230;219;116mt[0m[38;2;230;219;116mi[0m[38;2;230;219;116ml[0m[38;2;230;219;116ms[0m[38;2;230;219;116m/[0m[38;2;230;219;116mi[0m[38;2;230;219;116mn[0m[38;2;230;219;116mt[0m[38;2;230;219;116mr[0m[38;2;230;219;116mo[0m[38;2;230;219;116ms[0m[38;2;230;219;116mp[0m[38;2;230;219;116me[0m[38;2;230;219;116mc[0m[38;2;230;219;116mt[0m[38;2;230;219;116mi[0m[38;2;230;219;116mo[0m[38;2;230;219;116mn[0m[38;2;230;219;116m/[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m1[0m[38;2;230;219;116m6[0m[38;2;230;219;116m5[0m[38;2;230;219;116m.[0m[38;2;230;219;116ms[0m[38;2;230;219;116mo[0m[38;2;230;219;116ml[0m[38;2;230;219;116m"[0m[38;2;248;248;242m;[0m + +[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including[0m +[38;2;117;113;94m * the Metadata extension, but not including the Enumerable extension, which is available separately as[0m +[38;2;117;113;94m * {ERC721Enumerable}.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;249;38;114mcontract[0m[38;2;248;248;242m [0m[4;38;2;102;217;239mERC721[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mContext[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mERC165[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mIERC721[0m[38;2;248;248;242m,[0m[38;2;248;248;242m [0m[3;38;2;166;226;46mIERC721Metadata[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;249;38;114musing[0m[38;2;248;248;242m Address [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114musing[0m[38;2;248;248;242m Strings [0m[38;2;249;38;114mfor[0m[38;2;248;248;242m [0m[38;2;190;132;255muint256[0m[38;2;248;248;242m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Token name[0m +[38;2;248;248;242m [0m[38;2;190;132;255mstring[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate [0m[38;2;248;248;242m_name[0m[38;2;248;248;242m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Token symbol[0m +[38;2;248;248;242m [0m[38;2;190;132;255mstring[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate [0m[38;2;248;248;242m_symbol[0m[38;2;248;248;242m;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Mapping from token ID to owner address[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mmapping[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255muint256[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m _owners;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Mapping owner address to token count[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mmapping[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255maddress[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;190;132;255muint256[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m _balances;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Mapping from token ID to approved address[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mmapping[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255muint256[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m _tokenApprovals;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m//[0m[38;2;117;113;94m Mapping from owner to operator approvals[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mmapping[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255maddress[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[3;38;2;102;217;239mmapping[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255maddress[0m[38;2;248;248;242m [0m[38;2;249;38;114m=>[0m[38;2;248;248;242m [0m[38;2;190;132;255mbool[0m[38;2;248;248;242m)[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mprivate[0m[38;2;248;248;242m _operatorApprovals;[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[38;2;166;226;46mconstructor[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255mstring[0m[38;2;248;248;242m [0m[38;2;249;38;114mmemory[0m[3;38;2;253;151;31m name_[0m[38;2;248;248;242m, [0m[38;2;190;132;255mstring[0m[38;2;248;248;242m [0m[38;2;249;38;114mmemory[0m[3;38;2;253;151;31m symbol_[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;248;248;242m_name[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m name_;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m_symbol[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m symbol_;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev See {IERC165-supportsInterface}.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46msupportsInterface[0m[38;2;248;248;242m([0m[38;2;190;132;255mbytes4[0m[38;2;248;248;242m [0m[3;38;2;253;151;31minterfaceId[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;249;38;114mvirtual[0m[38;2;248;248;242m [0m[38;2;249;38;114moverride[0m[38;2;248;248;242m(ERC165, IERC165) [0m[38;2;249;38;114mreturns[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255mbool[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m interfaceId [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;102;217;239mtype[0m[38;2;248;248;242m([0m[38;2;248;248;242mIERC721[0m[38;2;248;248;242m)[0m[38;2;248;248;242m.interfaceId[0m +[38;2;248;248;242m [0m[38;2;249;38;114m||[0m[38;2;248;248;242m interfaceId [0m[38;2;249;38;114m==[0m[38;2;248;248;242m [0m[38;2;102;217;239mtype[0m[38;2;248;248;242m([0m[38;2;248;248;242mIERC721Metadata[0m[38;2;248;248;242m)[0m[38;2;248;248;242m.interfaceId[0m +[38;2;248;248;242m [0m[38;2;249;38;114m||[0m[38;2;248;248;242m [0m[38;2;249;38;114msuper[0m[38;2;248;248;242m.[0m[38;2;102;217;239msupportsInterface[0m[38;2;248;248;242m([0m[38;2;248;248;242minterfaceId[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev See {IERC721-balanceOf}.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mbalanceOf[0m[38;2;248;248;242m([0m[38;2;190;132;255maddress[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mowner[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;249;38;114mvirtual[0m[38;2;248;248;242m [0m[38;2;249;38;114moverride[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturns[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255muint256[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;249;38;114mrequire[0m[38;2;248;248;242m(owner [0m[38;2;249;38;114m!=[0m[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m7[0m[38;2;230;219;116m2[0m[38;2;230;219;116m1[0m[38;2;230;219;116m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mb[0m[38;2;230;219;116ma[0m[38;2;230;219;116ml[0m[38;2;230;219;116ma[0m[38;2;230;219;116mn[0m[38;2;230;219;116mc[0m[38;2;230;219;116me[0m[38;2;248;248;242m [0m[38;2;230;219;116mq[0m[38;2;230;219;116mu[0m[38;2;230;219;116me[0m[38;2;230;219;116mr[0m[38;2;230;219;116my[0m[38;2;248;248;242m [0m[38;2;230;219;116mf[0m[38;2;230;219;116mo[0m[38;2;230;219;116mr[0m[38;2;248;248;242m [0m[38;2;230;219;116mt[0m[38;2;230;219;116mh[0m[38;2;230;219;116me[0m[38;2;248;248;242m [0m[38;2;230;219;116mz[0m[38;2;230;219;116me[0m[38;2;230;219;116mr[0m[38;2;230;219;116mo[0m[38;2;248;248;242m [0m[38;2;230;219;116ma[0m[38;2;230;219;116md[0m[38;2;230;219;116md[0m[38;2;230;219;116mr[0m[38;2;230;219;116me[0m[38;2;230;219;116ms[0m[38;2;230;219;116ms[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m _balances[0m[38;2;248;248;242m[[0m[38;2;248;248;242mowner[0m[38;2;248;248;242m][0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev See {IERC721-ownerOf}.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mownerOf[0m[38;2;248;248;242m([0m[38;2;190;132;255muint256[0m[38;2;248;248;242m [0m[3;38;2;253;151;31mtokenId[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249;38;114mpublic[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;249;38;114mvirtual[0m[38;2;248;248;242m [0m[38;2;249;38;114moverride[0m[38;2;248;248;242m [0m[38;2;249;38;114mreturns[0m[38;2;248;248;242m [0m[38;2;248;248;242m([0m[38;2;190;132;255maddress[0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;248;248;242m{[0m +[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m [0m[38;2;248;248;242mowner[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m _owners[0m[38;2;248;248;242m[[0m[38;2;248;248;242mtokenId[0m[38;2;248;248;242m][0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mrequire[0m[38;2;248;248;242m(owner [0m[38;2;249;38;114m!=[0m[38;2;248;248;242m [0m[38;2;190;132;255maddress[0m[38;2;248;248;242m([0m[38;2;190;132;255m0[0m[38;2;248;248;242m)[0m[38;2;248;248;242m, [0m[38;2;230;219;116m"[0m[38;2;230;219;116mE[0m[38;2;230;219;116mR[0m[38;2;230;219;116mC[0m[38;2;230;219;116m7[0m[38;2;230;219;116m2[0m[38;2;230;219;116m1[0m[38;2;230;219;116m:[0m[38;2;248;248;242m [0m[38;2;230;219;116mo[0m[38;2;230;219;116mw[0m[38;2;230;219;116mn[0m[38;2;230;219;116me[0m[38;2;230;219;116mr[0m[38;2;248;248;242m [0m[38;2;230;219;116mq[0m[38;2;230;219;116mu[0m[38;2;230;219;116me[0m[38;2;230;219;116mr[0m[38;2;230;219;116my[0m[38;2;248;248;242m [0m[38;2;230;219;116mf[0m[38;2;230;219;116mo[0m[38;2;230;219;116mr[0m[38;2;248;248;242m [0m[38;2;230;219;116mn[0m[38;2;230;219;116mo[0m[38;2;230;219;116mn[0m[38;2;230;219;116me[0m[38;2;230;219;116mx[0m[38;2;230;219;116mi[0m[38;2;230;219;116ms[0m[38;2;230;219;116mt[0m[38;2;230;219;116me[0m[38;2;230;219;116mn[0m[38;2;230;219;116mt[0m[38;2;248;248;242m [0m[38;2;230;219;116mt[0m[38;2;230;219;116mo[0m[38;2;230;219;116mk[0m[38;2;230;219;116me[0m[38;2;230;219;116mn[0m[38;2;230;219;116m"[0m[38;2;248;248;242m)[0m[38;2;248;248;242m;[0m +[38;2;248;248;242m [0m[38;2;249;38;114mreturn[0m[38;2;248;248;242m owner;[0m +[38;2;248;248;242m [0m[38;2;248;248;242m}[0m + +[38;2;248;248;242m [0m[38;2;117;113;94m/**[0m +[38;2;117;113;94m * @dev See {IERC721Metadata-name}.[0m +[38;2;117;113;94m [0m[38;2;117;113;94m*/[0m +[38;2;248;248;242m [0m[3;38;2;102;217;239mfunction[0m[38;2;248;248;242m [0m[38;2;166;226;46mname[0m[38;2;248;248;242m([0m[38;2;248;248;242m)[0m[38;2;248;248;242m [0m[38;2;249; |