You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Title
```catala
declaration structure Individual:
data income content money
data number_of_children content integer
declaration scope IncomeTaxComputation:
input individual content Individual
internal fixed_percentage content decimal
output income_tax content money
```
## Article 1
The income tax for an individual is defined as a fixed percentage of the
individual's income over a year.
```catala
scope IncomeTaxComputation:
definition income_tax equals
individual.income * fixed_percentage
```
Returns upon typechecking the following very confusing error:
┌─[ERROR]─
│
│ "IncomeTaxComputation": this scope has not been declared anywhere, is it a typo?
│
├─➤ tutorial.catala_en:31.7-31.27:
│ │
│ 31 │ scope IncomeTaxComputation:
│ │ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Title
└─ Article 2
This is because there is a space before the triple backtick Catala code block fences at the beginning and end of the first code block. The parser then fails to recognize the code block and just does not parse the scope declarations. This is extremely confusing for beginners...
Fixes
Either the parser should be made more robust to handle spaces in front of triple backticks to recognize Catala code blocks
Or the parser should throw a warning when these spaces are here and it causes it to not parse the code block as Catala code
The text was updated successfully, but these errors were encountered:
The following program:
Returns upon typechecking the following very confusing error:
This is because there is a space before the triple backtick Catala code block fences at the beginning and end of the first code block. The parser then fails to recognize the code block and just does not parse the scope declarations. This is extremely confusing for beginners...
Fixes
The text was updated successfully, but these errors were encountered: