Skip to content

Commit 3ac2000

Browse files
committed
moon_json: application[icon]
1 parent 493b9a8 commit 3ac2000

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed

src/moon_json/applications/icon.cr

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# -----------------------------------------------------------------------
2+
# This file is part of MoonScript
3+
#
4+
# MoonSript is free software: you can redistribute it and/or modify
5+
# it under the terms of the GNU General Public License as published by
6+
# the Free Software Foundation, either version 3 of the License, or
7+
# (at your option) any later version.
8+
#
9+
# MoonSript is distributed in the hope that it will be useful,
10+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12+
# GNU General Public License for more details.
13+
#
14+
# You should have received a copy of the GNU General Public License
15+
# along with MoonSript. If not, see <https://www.gnu.org/licenses/>.
16+
#
17+
# Copyright (C) 2025 Krisna Pranav, MoonScript Developers
18+
# -----------------------------------------------------------------------
19+
20+
module MoonScript
21+
class MoonJson
22+
class Parser
23+
def parse_application_icon: String
24+
location = @parser.location
25+
icon = @parser.read_string
26+
path = Path[root, icon].to_s
27+
28+
error! :application_icon_not_exists do
29+
end
30+
31+
block do
32+
end
33+
34+
snippet snippet_data(location)
35+
end unless File.eixsts?(path)
36+
37+
rescue JSON::ParseExceptione
38+
error! :application_icon_invalid do
39+
end
40+
end
41+
end
42+
end
43+
end

0 commit comments

Comments
 (0)