History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-375
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Cedric Vivier
Reporter: Hans-Christian Holm
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

char() should accept int literal as argument

Created: 29/Jun/05 07:48 AM   Updated: 05/Feb/08 03:55 PM
Component/s: Parser
Affects Version/s: 0.5.6
Fix Version/s: 0.8.1

Time Tracking:
Not Specified

File Attachments: 1. Text File svn-diff1.txt (1 kb)



 Description  « Hide
char(65) and char(0x41) should be equivalent to char('A') etc.

 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Sorin Ionescu - 29/Jun/05 11:58 PM
While char() looks like a function, it is not a function; it's literal. However, I see no reason why an implicit casting should not work. Does explicit currently work?

C#:
char a = (char) 0x41;
char a = (char) 65;

So, you could write in your boo code cast(char, 65) and cast(char, 0x41). But yes, char(integral) and char(hex) would be nicer.


Chintan Rao H - 21/Jul/07 09:45 PM
This is the output of svn diff for grammar files in src/Base.Lang.Parser directory ; just did svn diff *.g in that directory.
char(+ve Int) ( things like char(0x41) and char(65) work as well as char('A') ) works fine with this patch.

Cedric Vivier - 05/Feb/08 09:36 AM
isn't the patch ok for inclusion?

(after adding some testcases maybe)


Rodrigo B. de Oliveira - 05/Feb/08 12:47 PM
Yes, after adding some test cases and refactoring ParseIntegerLiteralExpression so that:

e=ParseIntegerLiteralExpression(i, val, false);

Can be replaced by something like:

int value = ParseInteger(i, val, false);


Cedric Vivier - 05/Feb/08 03:55 PM
fixed in rev. 2847