Skip to content

Commit

Permalink
Merge pull request #4 from ligolang/quyen@remove_pascal
Browse files Browse the repository at this point in the history
Remove Pascaligo / reasonLigo
  • Loading branch information
Laucans authored Feb 6, 2024
2 parents 1dce6f4 + 35ae28c commit 53a489e
Show file tree
Hide file tree
Showing 271 changed files with 10 additions and 12,839 deletions.
10 changes: 2 additions & 8 deletions src/frontend/src/app/App.components/Drawer/Drawer.controller.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,12 @@ export const Drawer = () => {
const history = useHistory()

let defaultLanguage = 'JsLIGO'
if (pathname.match(/pascal/i)) defaultLanguage = 'PascaLIGO'
if (pathname.match(/js/i)) defaultLanguage = 'JsLIGO'
if (pathname.match(/camel/i)) defaultLanguage = 'CameLIGO'
const [activeLanguage, setActiveLanguage] = useState(defaultLanguage)

useEffect(() => {
let defaultLanguage = 'JsLIGO'
if (pathname.match(/pascal/i)) defaultLanguage = 'PascaLIGO'
if (pathname.match(/js/i)) defaultLanguage = 'JsLIGO'
if (pathname.match(/camel/i)) defaultLanguage = 'CameLIGO'
setActiveLanguage(defaultLanguage)
Expand All @@ -35,16 +33,12 @@ export const Drawer = () => {
function removeAuthUserCallback() { }

function changeLanguageCallback(e: string) {
if (e === 'PascaLIGO') {
history.push(pathname.replace(new RegExp('camel|reason|js', 'i'), 'pascal'))
setActiveLanguage('PascaLIGO')
}
if (e === 'JsLIGO') {
history.push(pathname.replace(new RegExp('camel|reason|pascal', 'i'), 'js'))
history.push(pathname.replace(new RegExp('camel|reason', 'i'), 'js'))
setActiveLanguage('JsLIGO')
}
if (e === 'CameLIGO') {
history.push(pathname.replace(new RegExp('pascal|reason|js', 'i'), 'camel'))
history.push(pathname.replace(new RegExp('reason|js', 'i'), 'camel'))
setActiveLanguage('CameLIGO')
}
}
Expand Down
4 changes: 1 addition & 3 deletions src/frontend/src/app/App.components/Drawer/Drawer.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ export const DrawerView = ({
showing,
hideCallback,
pathname,
user,
removeAuthUserCallback,
changeLanguageCallback,
activeLanguage,
}: DrawerViewProps) => (
Expand All @@ -31,7 +29,7 @@ export const DrawerView = ({
<h1>Menu</h1>

<Select
options={['PascaLIGO', 'CameLIGO', 'JsLIGO']}
options={['CameLIGO', 'JsLIGO']}
defaultOption={activeLanguage}
selectCallback={(e) => changeLanguageCallback(e)}
/>
Expand Down
6 changes: 0 additions & 6 deletions src/frontend/src/app/App.routes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,12 @@ export const AppRoutes = ({ location }: any) => (
<Route exact path="/change-password">
<ChangePassword />
</Route>
<Route exact path="/pascal/chapter-about">
<ChapterAbout />
</Route>
<Route exact path="/js/chapter-about">
<ChapterAbout />
</Route>
<Route exact path="/camel/chapter-about">
<ChapterAbout />
</Route>
<Route path="/pascal/chapter-*">
<Chapter />
</Route>
<Route path="/js/chapter-*">
<Chapter />
</Route>
Expand Down
144 changes: 0 additions & 144 deletions src/frontend/src/pages/Chapter/Chapter.data.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,6 @@ import { data as camelDataVariables } from '../Chapters/Camel/ChapterVariables'
import { data as camelDataVariant } from '../Chapters/Camel/ChapterVariant'
/* prettier-ignore */

import { data as pascalDataAddresses } from "../Chapters/Pascal/ChapterAddresses";
import { data as pascalDataBuiltIns } from '../Chapters/Pascal/ChapterBuiltIns'
import { data as pascalDataConditionals } from '../Chapters/Pascal/ChapterConditionals'
import { data as pascalDataDeployContract } from '../Chapters/Pascal/ChapterDeployContract'
import { data as pascalDataFA12 } from '../Chapters/Pascal/ChapterFA12'
import { data as pascalDataFunctions } from '../Chapters/Pascal/ChapterFunctions'
import { data as pascalDataInteractions } from '../Chapters/Pascal/ChapterInteractions'
import { data as pascalDataInterop } from '../Chapters/Pascal/ChapterInterop'
import { data as pascalDataLambda } from '../Chapters/Pascal/ChapterLambda'
import { data as pascalDataLists } from '../Chapters/Pascal/ChapterLists'
import { data as pascalDataLoops } from '../Chapters/Pascal/ChapterLoops'
import { data as pascalDataMainFunction } from '../Chapters/Pascal/ChapterMainFunction'
import { data as pascalDataMaps } from '../Chapters/Pascal/ChapterMaps'
import { data as pascalDataMath } from '../Chapters/Pascal/ChapterMath'
import { data as pascalDataMultisig } from '../Chapters/Pascal/ChapterMultisig'
import { data as pascalDataOption } from '../Chapters/Pascal/ChapterOption'
import { data as pascalDataPolymorphism } from '../Chapters/Pascal/ChapterPolymorphism'
import { data as pascalDataPreprocessor } from '../Chapters/Pascal/ChapterPreprocessor'
import { data as pascalDataRecords } from '../Chapters/Pascal/ChapterRecords'
import { data as pascalDataStrings } from '../Chapters/Pascal/ChapterStrings'
import { data as pascalDataTimestamps } from '../Chapters/Pascal/ChapterTimestamps'
import { data as pascalDataTransactions } from '../Chapters/Pascal/ChapterTransactions'
import { data as pascalDataTuples } from '../Chapters/Pascal/ChapterTuples'
import { data as pascalDataTypes } from '../Chapters/Pascal/ChapterTypes'
import { data as pascalDataVariables } from '../Chapters/Pascal/ChapterVariables'
import { data as pascalDataVariant } from '../Chapters/Pascal/ChapterVariant'

import { data as jsDataAddresses } from '../Chapters/JS/ChapterAddresses'
import { data as jsDataBuiltIns } from '../Chapters/JS/ChapterBuiltIns'
import { data as jsDataConditionals } from '../Chapters/JS/ChapterConditionals'
Expand Down Expand Up @@ -81,123 +54,6 @@ import { data as jsDataVariables } from '../Chapters/JS/ChapterVariables'
import { data as jsDataVariant } from '../Chapters/JS/ChapterVariant'

export const chapterData = [
{
pathname: '/pascal/chapter-about',
language: 'PascaLIGO',
name: '1 - Pascal - About',
data: { course: undefined, exercise: undefined, solution: undefined, supports: {} },
},
{ pathname: '/pascal/chapter-types', language: 'PascaLIGO', name: '2 - Pascal - Types', data: pascalDataTypes },
{
pathname: '/pascal/chapter-variables',
language: 'PascaLIGO',
name: '3 - Pascal - Variables',
data: pascalDataVariables,
},
{ pathname: '/pascal/chapter-math', language: 'PascaLIGO', name: '4 - Pascal - Math', data: pascalDataMath },
{ pathname: '/pascal/chapter-strings', language: 'PascaLIGO', name: '5 - Pascal - Strings', data: pascalDataStrings },
{
pathname: '/pascal/chapter-functions',
language: 'PascaLIGO',
name: '6 - Pascal - Functions',
data: pascalDataFunctions,
},
{
pathname: '/pascal/chapter-conditionals',
language: 'PascaLIGO',
name: '7 - Pascal - Conditionals',
data: pascalDataConditionals,
},
{ pathname: '/pascal/chapter-tuples', language: 'PascaLIGO', name: '8 - Pascal - Tuples', data: pascalDataTuples },
{ pathname: '/pascal/chapter-records', language: 'PascaLIGO', name: '9 - Pascal - Records', data: pascalDataRecords },
{ pathname: '/pascal/chapter-maps', language: 'PascaLIGO', name: '10 - Pascal - Maps', data: pascalDataMaps },
{ pathname: '/pascal/chapter-lists', language: 'PascaLIGO', name: '11 - Pascal - Lists', data: pascalDataLists },
{
pathname: '/pascal/chapter-variants',
language: 'PascaLIGO',
name: '12 - Pascal - Variants',
data: pascalDataVariant,
},
{
pathname: '/pascal/chapter-main-function',
language: 'PascaLIGO',
name: '13 - Pascal - Main function',
data: pascalDataMainFunction,
},
{ pathname: '/pascal/chapter-loops', language: 'PascaLIGO', name: '14 - Pascal - Loops', data: pascalDataLoops },
{
pathname: '/pascal/chapter-addresses',
language: 'PascaLIGO',
name: '15 - Pascal - Addresses',
data: pascalDataAddresses,
},
{
pathname: '/pascal/chapter-built-ins',
language: 'PascaLIGO',
name: '16 - Pascal - Built-ins',
data: pascalDataBuiltIns,
},
{
pathname: '/pascal/chapter-transactions',
language: 'PascaLIGO',
name: '17 - Pascal - Transactions',
data: pascalDataTransactions,
},
{
pathname: '/pascal/chapter-timestamps',
language: 'PascaLIGO',
name: '18 - Pascal - Timestamps',
data: pascalDataTimestamps,
},
{ pathname: '/pascal/chapter-option', language: 'PascaLIGO', name: '19 - Pascal - Option', data: pascalDataOption },
{
pathname: '/pascal/chapter-interactions',
language: 'PascaLIGO',
name: '20 - Pascal - Interactions',
data: pascalDataInteractions,
},
{
pathname: '/pascal/chapter-lazyinteraction',
language: 'PascaLIGO',
name: '21 - Pascal - Lazy interaction',
data: pascalDataPolymorphism,
},
{
pathname: '/pascal/chapter-lambda',
language: 'PascaLIGO',
name: '22 - Pascal - Lambda',
data: pascalDataLambda,
},
{
pathname: '/pascal/chapter-deploycontract',
language: 'PascaLIGO',
name: '23 - Pascal - Deploy contract',
data: pascalDataDeployContract,
},
{
pathname: '/pascal/chapter-multisig',
language: 'PascaLIGO',
name: '24 - Pascal - Multisignature',
data: pascalDataMultisig,
},
{
pathname: '/pascal/chapter-interop',
language: 'PascaLIGO',
name: '25 - Pascal - Interoperability',
data: pascalDataInterop,
},
{
pathname: '/pascal/chapter-preprocessor',
language: 'PascaLIGO',
name: '26 - Pascal - Preprocessor',
data: pascalDataPreprocessor,
},
{
pathname: '/pascal/chapter-fa12',
language: 'PascaLIGO',
name: '27 - Pascal - Fungible token (FA1.2)',
data: pascalDataFA12,
},
{
pathname: '/js/chapter-about',
language: 'JsLIGO',
Expand Down
9 changes: 4 additions & 5 deletions src/frontend/src/pages/Chapter/Chapter.view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ const MonacoReadOnly = ({ children }: any) => {
<Editor
height={height}
value={children}
language="pascaligo"
language="jsligo"
theme={monacoTheme}
options={{
...monacoFontOpt,
Expand All @@ -66,7 +66,7 @@ const MonacoReadOnly = ({ children }: any) => {
const MonacoEditorSupport = ({ support }: any) => {
return (
<div>
<Editor height="500px" value={support} language="pascaligo" theme={monacoTheme} options={monacoFontOpt} />
<Editor height="500px" value={support} language="jsligo" theme={monacoTheme} options={monacoFontOpt} />
</div>
)
}
Expand All @@ -77,7 +77,7 @@ const MonacoEditor = ({ proposedSolution, proposedSolutionCallback }: any) => {
<Editor
height="500px"
value={proposedSolution}
language="pascaligo"
language="jsligo"
theme={monacoTheme}
onChange={(val, _) => proposedSolutionCallback(val)}
options={{ ...monacoFontOpt, readOnly: false }}
Expand All @@ -93,7 +93,7 @@ const MonacoDiff = ({ solution, proposedSolution }: any) => {
height="500px"
original={proposedSolution}
modified={solution}
language="pascaligo"
language="jsligo"
// @ts-ignore
theme={monacoTheme}
options={{ ...monacoFontOpt, readOnly: false }}
Expand Down Expand Up @@ -192,7 +192,6 @@ export const ChapterView = ({
const { pathname } = useLocation()

let extension = ''
if (pathname.match(/pascal/i)) extension = 'ligo'
if (pathname.match(/js/i)) extension = 'jsligo'
if (pathname.match(/camel/i)) extension = 'mligo'

Expand Down
30 changes: 0 additions & 30 deletions src/frontend/src/pages/Chapters/Pascal/ChapterAddresses/course.md

This file was deleted.

This file was deleted.

11 changes: 0 additions & 11 deletions src/frontend/src/pages/Chapters/Pascal/ChapterAddresses/index.ts

This file was deleted.

This file was deleted.

49 changes: 0 additions & 49 deletions src/frontend/src/pages/Chapters/Pascal/ChapterBuiltIns/course.md

This file was deleted.

This file was deleted.

Loading

0 comments on commit 53a489e

Please sign in to comment.