Light Mode

Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit eaa7558

Browse files
committed
Fix: decorator & directive symbols
1 parent a3f83d4 commit eaa7558

File tree

5 files changed

+23
-3
lines changed
  • config
    • operators.json
  • examples
    • turn_off_logging.fpy
  • fastpy_build
    • bin
      • main.exe
    • src
      • main.cpp
  • main.fpy

5 files changed

+23
-3
lines changed

config/operators.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
"for": "for",
2424
"break": "break",
2525
"continue": "continue",
26-
"@": "directive",
26+
"@": "decorator",
27+
"$": "directive",
2728
":": "body_start",
2829
"->": "return_type",
2930
".": "access"

examples/turn_off_logging.fpy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@ENABLE_LOGGING = false
1+
$ENABLE_LOGGING = false
22

33
log("Hello, World!") # nothing
44
log_error("ERROR!") # nothing

fastpy_build/bin/main.exe

1.71 KB
Binary file not shown.

fastpy_build/src/main.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,20 @@ int main(){
2020
int age = input<int>("Input your age $");
2121

2222

23+
if (age > 17) {
2324
log_info(name, true);
2425

26+
}
27+
28+
if (age > 15 && age < 18) {
29+
log_warning(name, true);
30+
31+
}
32+
33+
if (age < 16) {
34+
log_error(name, true);
35+
36+
}
37+
2538

2639
}

main.fpy

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
name: str = input('Input your name $')
22
age: int = input('Input your age $')
33

4-
log_info(name, true)
4+
if age > 17:
5+
log_info(name, true)
56

7+
if age > 15 and age < 18:
8+
log_warning(name, true)
9+
10+
if age < 16:
11+
log_error(name, true)

0 commit comments

Comments
(0)