forked from glen/fostr
Add literal string constants (#19)
In addition, for the sake of Haskell code generation, this PR adds static typing with Statix. Resolves #5. Co-authored-by: Glen Whitney <glen@studioinfinity.org> Reviewed-on: glen/fostr#19 Co-Authored-By: Glen Whitney <glen@nobody@nowhere.net> Co-Committed-By: Glen Whitney <glen@nobody@nowhere.net>
This commit is contained in:
parent
c516ed6d7f
commit
2772fd0c5c
16 changed files with 386 additions and 34 deletions
|
@ -1,6 +1,16 @@
|
|||
module basic
|
||||
language fostr
|
||||
|
||||
test hw1_type [[
|
||||
[[stream]] << [['Hello, world! ']] << [[3+2]] << ' times.'
|
||||
]]
|
||||
run get-type on #1 to STREAM()
|
||||
run get-type on #2 to STRING()
|
||||
run get-type on #3 to INT()
|
||||
run get-type to STREAM()
|
||||
/** writes
|
||||
Hello, world! 5 times.**/
|
||||
|
||||
/** md
|
||||
Title: A whirlwind tour of fostr
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
stream << 72 + 87
|
||||
stream << 'Some numbers: '
|
||||
stream << 88
|
||||
+ 96
|
||||
99 + 12 >>
|
||||
|
|
1
tests/hw.fos
Normal file
1
tests/hw.fos
Normal file
|
@ -0,0 +1 @@
|
|||
stream << 'Hello, world!'
|
Loading…
Add table
Add a link
Reference in a new issue