Red: Compiler does not support %"%"

Created on 7 Nov 2017  路  4Comments  路  Source: red/red

Expected behavior

In the interpreter, it's possible to use filename %"%"

Actual behavior

This is not possible when the same script is compiled, error is returned:

*** Syntax Error: Invalid string! value
*** in file: /Users/sony/Code/red/test.red
*** line: 2
*** at: {"%"}

Steps to reproduce the problem

Compile following script:

Red[]
%"%"

Red version and build date, operating system with version.

Latest Red on macOS.

status.built status.tested type.bug

All 4 comments

The complete equivalence of interpreter-lexer and compiler-lexer has obviously not yet been achieved. There are more issues of this nature still pending.
On the substance: I think that this particular filename should be forbidden.

@meijeru why do you think so? If file system supports it, why it should be illegal?

In Red, % normally starts a two-hex digit code for a character. So it would be just to avoid confusion. Anyhow, in the interpreter, %% instead of %"%" also gives an error. This reinforces my plea for more consistent lexing.

The %"..." syntax is an escape mechanism allowing filesystem-specific characters to be provided unescaped. So %"%" should be accepted, as it is accepted by most filesystems.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

SteeveGit picture SteeveGit  路  8Comments

tmpbci picture tmpbci  路  8Comments

luis-lavaire picture luis-lavaire  路  4Comments

dockimbel picture dockimbel  路  4Comments

endo64 picture endo64  路  7Comments