Permalink
Browse files

Grammar: enabled floating point numbers

  • Loading branch information...
1 parent 5ea9937 commit 7639b0c8c81fdd9db9cec7262a2931f5b985a9b1 @fglock committed Mar 22, 2010
Showing with 19 additions and 9 deletions.
  1. +3 −0 ChangeLog
  2. +12 −5 lib/MiniPerl6/Grammar.pm
  3. +4 −4 lib5/MiniPerl6/Grammar.pm
View
@@ -1,3 +1,6 @@
+5.0 (plan)
+- these features are now enabled: while loop, floating point numbers
+
4.0 2010-03-20
- Go backend bootstrap.
The Go backend was updated to the latest Go language spec.
View
@@ -19,7 +19,7 @@ token ident_digit {
}
token ident {
- [ <.word> | _ ] <.ident_digit>
+ [ <!before \d ><.word> | _ ] <.ident_digit>
}
token full_ident {
@@ -343,9 +343,9 @@ token var_ident {
token val {
| <val_undef> { make $$<val_undef> } # undef
# | $<exp> := <val_object> # (not exposed to the outside)
+ | <val_num> { make $$<val_num> } # 123.456
| <val_int> { make $$<val_int> } # 123
| <val_bit> { make $$<val_bit> } # True, False
- | <val_num> { make $$<val_num> } # 123.456
| <val_buf> { make $$<val_buf> } # 'moose'
}
@@ -360,13 +360,22 @@ token val_bit {
grammar MiniPerl6::Grammar {
+token digits { \d [ <digits> | '' ] }
+
token val_undef {
undef <!before \w >
{ make Val::Undef.new( ) }
}
token val_num {
- XXX { make 'TODO: val_num' }
+ <digits>
+ [ [ 'e' | 'E' ] <digits>
+ | \. <digits>
+ [ [ 'e' | 'E' ] <digits>
+ | ''
+ ]
+ ]
+ { make Val::Num.new( num => ~$/ ) }
}
token char_any {
@@ -404,8 +413,6 @@ token val_buf {
| \' <single_quoted_unescape> \' { make Val::Buf.new( buf => $$<single_quoted_unescape> ) }
}
-token digits { \d [ <digits> | '' ] }
-
token val_int {
<digits>
{ make Val::Int.new( int => ~$/ ) }
Oops, something went wrong.

0 comments on commit 7639b0c

Please sign in to comment.