Skip to content

Commit

Permalink
fixed this.syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
TheMilkies committed Jun 11, 2023
1 parent 8f491e2 commit 3af6969
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 34 deletions.
21 changes: 0 additions & 21 deletions github_stuff/flex_setup.md

This file was deleted.

10 changes: 5 additions & 5 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,18 +35,18 @@ If you're still here; that means you suffered enough CMake (or Autotools) to rec
### Debian/Ubuntu
Run the following commands:
```sh
wget https://github.com/TheMilkies/Cate/releases/download/v2.9.3/cate_2.9-3_amd64.deb
sudo dpkg -i cate_2.9-3_amd64.deb
rm cate_2.9-3_amd64.deb
wget https://github.com/TheMilkies/Cate/releases/download/v2.9.4/cate_2.9-4_amd64.deb
sudo dpkg -i cate_2.9-4_amd64.deb
rm cate_2.9-4_amd64.deb
```

### Other distributions
Run the following commands:
```sh
mkdir catering
cd catering
wget https://github.com/TheMilkies/Cate/releases/download/v2.9.3/linux_cate_v2.9.3.zip
unzip linux_cate_v2.9.3.zip
wget https://github.com/TheMilkies/Cate/releases/download/v2.9.4/linux_cate_v2.9.4.zip
unzip linux_cate_v2.9.4.zip
sudo ./install.sh
cd ..
rm -rf catering
Expand Down
17 changes: 9 additions & 8 deletions src/Parser/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,11 @@ void Parser::parse()
break;

case IDENTIFIER: {
if(global()) break;
auto parent = current.text;
if(global()) {
break;
}
/*property: string_literal '.' string_literal*/
auto& parent = current.text;
auto other_class = get_class(parent);

if (!other_class)
Expand All @@ -140,7 +142,7 @@ void Parser::parse()
}

case DOT:
if(current_class == nullptr)
if(!current_class)
fatal("No object was selected.\n"
"if you're trying to use a global variable, it's without the dot.");

Expand Down Expand Up @@ -221,11 +223,11 @@ void Parser::parse()
if (errors_exist) exit(1); //if there was a non-fatal error, exit.
}

#define set_string(x) {expect(STRING_LITERAL); global_values.x = current.text;}
#define set_string(x) {expect(ASSIGN); expect(STRING_LITERAL);\
global_values.x = current.text; return true;}
bool Parser::global()
{
child = current.text;
expect(ASSIGN);

if (child == "cc" || child == "compiler")
set_string(compiler)
Expand All @@ -236,15 +238,14 @@ bool Parser::global()
child == "object_folder" ||
child == "build_directory")
set_string(object_dir)
#define set_bool(x) {global_values.x = expect_bool();}
#define set_bool(x) {expect(ASSIGN); global_values.x = expect_bool(); return true;}
else if (child == "threading")
set_bool(threading)
else if (child == "smol" || child == "smolize")
set_bool(smol)

else return false;
return false;
#undef set_bool
return true;
}

Class *Parser::get_class(std::string_view name)
Expand Down

0 comments on commit 3af6969

Please sign in to comment.