X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=src%2Forg%2Fibex%2Ftool%2FPreprocessor.java;h=8ab48ba63992af631e81cb1a3a1827c31fe4c85e;hb=1f8d04e6dc7984c83037f08cc44ca45a52d5ad19;hp=0df4c0f7fd97c0bf06ff5f53f93975b4c63d4cb3;hpb=040fa5af2cd00017cf3575950cdaade34a6d7f6c;p=org.ibex.tool.git diff --git a/src/org/ibex/tool/Preprocessor.java b/src/org/ibex/tool/Preprocessor.java index 0df4c0f..8ab48ba 100644 --- a/src/org/ibex/tool/Preprocessor.java +++ b/src/org/ibex/tool/Preprocessor.java @@ -1,7 +1,6 @@ -// You may modify, copy, and redistribute this code under the terms of -// the GNU Library Public License version 2.1, with the exception of -// the portion of clause 6a after the semicolon (aka the "obnoxious -// relink clause"). +// Copyright 2000-2005 the Contributors, as shown in the revision logs. +// Licensed under the Apache Public Source License 2.0 ("the License"). +// You may not use this file except in compliance with the License. package org.ibex.tool; @@ -233,14 +232,14 @@ PROCESS: } out.println("//#endif "+expr); - } else if (trimmed.startsWith("//#switch")) { + } else if (trimmed.startsWith("//#switch") || trimmed.startsWith("//#jsswitch")) { int expStart = trimmed.indexOf('(') +1; if (expStart < 1) { err.add(new Error("expected ( in #switch")); continue PROCESS; } int expEnd = trimmed.lastIndexOf(')'); if (expEnd == -1) { err.add(new Error("expected ) in #switch")); continue PROCESS; } if (expEnd - expStart <= 1) { err.add(new Error("badly formed #switch statement")); continue PROCESS; } String expr = trimmed.substring(expStart, expEnd); - + if (trimmed.startsWith("//#jsswitch")) expr = "JSU.toString("+expr+")"; out.print("final String ccSwitch"+enumSwitch+" = (String)("+expr+"); "); out.print("SUCCESS:do { switch(ccSwitch"+enumSwitch+".length()) {\n");